fix iyuuautoseed

This commit is contained in:
jxxghp 2023-08-10 19:00:09 +08:00
parent 1ccc9dad57
commit a16d01a04d
2 changed files with 6 additions and 15 deletions

View File

@ -393,9 +393,6 @@ class IYUUAutoSeed(_PluginBase):
""" """
开始辅种 开始辅种
""" """
if not self._enabled or not self._token or not self._downloaders:
logger.warn("辅种服务未启用或未配置")
return
if not self.iyuuhelper: if not self.iyuuhelper:
return return
logger.info("开始辅种任务 ...") logger.info("开始辅种任务 ...")
@ -492,7 +489,7 @@ class IYUUAutoSeed(_PluginBase):
# 下载器 # 下载器
downloader_obj = self.__get_downloader(downloader) downloader_obj = self.__get_downloader(downloader)
# 获取下载器中的种子状态 # 获取下载器中的种子状态
torrents = downloader_obj.get_torrents(ids=recheck_torrents) torrents, _ = downloader_obj.get_torrents(ids=recheck_torrents)
if torrents: if torrents:
can_seeding_torrents = [] can_seeding_torrents = []
for torrent in torrents: for torrent in torrents:
@ -695,9 +692,9 @@ class IYUUAutoSeed(_PluginBase):
self.realtotal += 1 self.realtotal += 1
# 查询hash值是否已经在下载器中 # 查询hash值是否已经在下载器中
downloader_obj = self.__get_downloader(downloader) downloader_obj = self.__get_downloader(downloader)
torrent_info = downloader_obj.get_torrents(ids=[seed.get("info_hash")]) torrent_info, _ = downloader_obj.get_torrents(ids=[seed.get("info_hash")])
if torrent_info: if torrent_info:
logger.debug(f"{seed.get('info_hash')} 已在下载器中,跳过 ...") logger.info(f"{seed.get('info_hash')} 已在下载器中,跳过 ...")
self.exist += 1 self.exist += 1
return False return False
# 站点流控 # 站点流控

View File

@ -486,12 +486,6 @@ class TorrentTransfer(_PluginBase):
""" """
开始移转做种 开始移转做种
""" """
if not self._enabled \
or not self._fromdownloader \
or not self._todownloader \
or not self._fromtorrentpath:
logger.warn("移转做种服务未启用或未配置")
return
logger.info("开始移转做种任务 ...") logger.info("开始移转做种任务 ...")
# 源下载器 # 源下载器
downloader = self._fromdownloader downloader = self._fromdownloader
@ -556,9 +550,9 @@ class TorrentTransfer(_PluginBase):
continue continue
# 查询hash值是否已经在目的下载器中 # 查询hash值是否已经在目的下载器中
todownloader_obj = self.__get_downloader(todownloader) todownloader_obj = self.__get_downloader(todownloader)
torrent_info = todownloader_obj.get_torrents(ids=[hash_item.get('hash')]) torrent_info, _ = todownloader_obj.get_torrents(ids=[hash_item.get('hash')])
if torrent_info: if torrent_info:
logger.debug(f"{hash_item.get('hash')} 已在目的下载器中,跳过 ...") logger.info(f"{hash_item.get('hash')} 已在目的下载器中,跳过 ...")
continue continue
# 转换保存路径 # 转换保存路径
download_dir = self.__convert_save_path(hash_item.get('save_path'), download_dir = self.__convert_save_path(hash_item.get('save_path'),
@ -670,7 +664,7 @@ class TorrentTransfer(_PluginBase):
logger.info(f"开始检查下载器 {downloader} 的校验任务 ...") logger.info(f"开始检查下载器 {downloader} 的校验任务 ...")
self._is_recheck_running = True self._is_recheck_running = True
downloader_obj = self.__get_downloader(downloader) downloader_obj = self.__get_downloader(downloader)
torrents = downloader_obj.get_torrents(ids=recheck_torrents) torrents, _ = downloader_obj.get_torrents(ids=recheck_torrents)
if torrents: if torrents:
can_seeding_torrents = [] can_seeding_torrents = []
for torrent in torrents: for torrent in torrents: