低端影视.py

This commit is contained in:
Harold
2026-04-19 17:19:45 +08:00
parent 89cb53297c
commit b3b21ee0e3
2 changed files with 14 additions and 2 deletions
+10
View File
@@ -172,6 +172,16 @@ class TestDDYSSpider(unittest.TestCase):
self.assertIn("夸克查看$https://pan.quark.cn/s/abc123", vod["vod_play_url"])
self.assertIn("百度查看$https://pan.baidu.com/s/demo", vod["vod_play_url"])
def test_extract_pan_sources_deduplicates_same_link_with_different_labels(self):
html = """
<div class="download-type-content" id="download-type-quark">
<button onclick="trackAndOpenResource(atob('aHR0cHM6Ly9wYW4ucXVhcmsuY24vcy8xNGE0MDVhOWJiMGQ='))">查看</button>
<button onclick="trackAndOpenResource(atob('aHR0cHM6Ly9wYW4ucXVhcmsuY24vcy8xNGE0MDVhOWJiMGQ='))">一键复制</button>
</div>
"""
groups = self.spider._extract_pan_sources(html)
self.assertEqual(groups, [{"from": "quark", "urls": "查看$https://pan.quark.cn/s/14a405a9bb0d"}])
@patch.object(Spider, "_request_html")
def test_detail_content_reads_detail_page_and_returns_single_vod(self, mock_request_html):
mock_request_html.return_value = """