feat: 支持站点音乐分类搜索

This commit is contained in:
jxxghp
2026-08-13 19:45:09 +08:00
parent c86307ddd1
commit 23a90991fc
14 changed files with 464 additions and 38 deletions
+24
View File
@@ -225,6 +225,30 @@ def test_typed_search_path_falls_back_to_all_path():
assert parsed_url.path == "/torrents.php"
def test_video_search_uses_dedicated_path_without_synthesized_category_params():
"""专属影视路径已携带分类时,不应再追加站点不支持的默认 cat 参数。"""
indexer = _build_indexer(
domain="https://iptorrents.com/",
search={
"paths": [
{"path": "t?q={keyword}", "type": "all"},
{"path": "t?72&q={keyword}", "type": "movie"},
{"path": "t?73&q={keyword}", "type": "tv"},
],
},
category={
"movie": [{"id": 72, "cat": "Movies"}],
"tv": [{"id": 73, "cat": "TV"}],
},
)
movie_url = _get_search_url(indexer, "Movie 2026", MediaType.MOVIE)
tv_url = _get_search_url(indexer, "Series S01", MediaType.TV)
assert movie_url == "https://iptorrents.com/t?72&q=Movie%202026"
assert tv_url == "https://iptorrents.com/t?73&q=Series%20S01"
def test_music_browse_uses_dedicated_music_entry():
"""
订阅刷新浏览音乐资源时应使用站点的音乐专用入口,而不是默认首页。