feat:协程搜索 part2

This commit is contained in:
jxxghp
2025-07-31 21:26:55 +08:00
parent 109164b673
commit 3fc2c7d6cc
4 changed files with 321 additions and 6 deletions

View File

@@ -630,6 +630,21 @@ class ChainBase(metaclass=ABCMeta):
return self.run_module("search_torrents", site=site, keywords=keywords,
mtype=mtype, page=page)
async def async_search_torrents(self, site: dict,
keywords: List[str],
mtype: Optional[MediaType] = None,
page: Optional[int] = 0) -> List[TorrentInfo]:
"""
异步搜索一个站点的种子资源
:param site: 站点
:param keywords: 搜索关键词列表
:param mtype: 媒体类型
:param page: 页码
:reutrn: 资源列表
"""
return await self.async_run_module("search_torrents", site=site, keywords=keywords,
mtype=mtype, page=page)
def refresh_torrents(self, site: dict, keyword: Optional[str] = None,
cat: Optional[str] = None, page: Optional[int] = 0) -> List[TorrentInfo]:
"""