feat 过滤规则存数据库

This commit is contained in:
jxxghp
2023-07-19 11:35:18 +08:00
parent 1012120bec
commit e6bacf3b7b
9 changed files with 43 additions and 29 deletions

View File

@ -189,15 +189,18 @@ class ChainBase(AbstractSingleton, metaclass=Singleton):
"""
return self.run_module("refresh_torrents", site=site)
def filter_torrents(self, torrent_list: List[TorrentInfo],
def filter_torrents(self, rule_string: str,
torrent_list: List[TorrentInfo],
season_episodes: Dict[int, list] = None) -> List[TorrentInfo]:
"""
过滤种子资源
:param rule_string: 过滤规则
:param torrent_list: 资源列表
:param season_episodes: 季集数过滤 {season:[episodes]}
:return: 过滤后的资源列表,添加资源优先级
"""
return self.run_module("filter_torrents", torrent_list=torrent_list, season_episodes=season_episodes)
return self.run_module("filter_torrents", rule_string=rule_string,
torrent_list=torrent_list, season_episodes=season_episodes)
def download(self, torrent_path: Path, cookie: str,
episodes: Set[int] = None) -> Optional[Tuple[Optional[str], str]]: