feat: 补全短剧全量清单并接入 DramaBox 官网登录

This commit is contained in:
Nixevol
2026-10-22 02:20:16 +08:00
parent 39774ad9cc
commit 00e78661a7
22 changed files with 894 additions and 194 deletions
+21
View File
@@ -37,6 +37,27 @@ def test_direct_media_and_hls_choice() -> None:
raise AssertionError("mp4 不应走播放列表")
def test_catalog_follows_pages_until_the_api_stops() -> None:
from server.services.huangdou.catalog import _take_new
pages = {
1: [{"id": str(i), "name": f"剧{i}"} for i in range(50)],
2: [{"id": str(i), "name": f"剧{i}"} for i in range(50, 100)],
3: [{"id": str(i), "name": f"剧{i}"} for i in range(100, 120)],
}
got = _take_new(lambda page: pages.get(page, []), set())
assert len(got) == 120
assert got[-1]["id"] == "119"
repeated = {
1: [{"id": str(i), "name": f"剧{i}"} for i in range(50)],
2: [{"id": str(i), "name": f"剧{i}"} for i in range(50)],
}
got = _take_new(lambda page: repeated.get(page, []), set())
assert len(got) == 50
if __name__ == "__main__":
test_direct_media_and_hls_choice()
test_catalog_follows_pages_until_the_api_stops()
print("ok")