mirror of
https://github.com/d0zingcat/MoviePilot-Plugins.git
synced 2026-05-13 23:16:47 +00:00
Merge pull request #667 from so1ve/feat/transfer-skip-verify
This commit is contained in:
@@ -104,11 +104,12 @@
|
||||
"name": "自动转移做种",
|
||||
"description": "定期转移下载器中的做种任务到另一个下载器。",
|
||||
"labels": "做种",
|
||||
"version": "1.9",
|
||||
"version": "1.10",
|
||||
"icon": "seed.png",
|
||||
"author": "jxxghp",
|
||||
"level": 2,
|
||||
"history": {
|
||||
"v1.10": "支持跳过校验(仅支持 qBittorrent)",
|
||||
"v1.9": "优化执行周期输入,需要MoviePilot v2.2.1+",
|
||||
"v1.8": "支持qbittorrent 5",
|
||||
"v1.7": "MoviePilot V2 版本自动转移做种插件",
|
||||
|
||||
@@ -28,7 +28,7 @@ class TorrentTransfer(_PluginBase):
|
||||
# 插件图标
|
||||
plugin_icon = "seed.png"
|
||||
# 插件版本
|
||||
plugin_version = "1.9"
|
||||
plugin_version = "1.10"
|
||||
# 插件作者
|
||||
plugin_author = "jxxghp"
|
||||
# 作者主页
|
||||
@@ -61,6 +61,7 @@ class TorrentTransfer(_PluginBase):
|
||||
_deleteduplicate = False
|
||||
_fromtorrentpath = None
|
||||
_autostart = False
|
||||
_skipverify = False
|
||||
_transferemptylabel = False
|
||||
_add_torrent_tags = None
|
||||
# 退出事件
|
||||
@@ -92,6 +93,7 @@ class TorrentTransfer(_PluginBase):
|
||||
self._fromtorrentpath = config.get("fromtorrentpath")
|
||||
self._nopaths = config.get("nopaths")
|
||||
self._autostart = config.get("autostart")
|
||||
self._skipverify = config.get("skipverify")
|
||||
self._transferemptylabel = config.get("transferemptylabel")
|
||||
self._add_torrent_tags = config.get("add_torrent_tags") or ""
|
||||
self._torrent_tags = self._add_torrent_tags.strip().split(",") if self._add_torrent_tags else []
|
||||
@@ -467,6 +469,19 @@ class TorrentTransfer(_PluginBase):
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"component": "VCol",
|
||||
"props": {"cols": 12, "md": 3},
|
||||
"content": [
|
||||
{
|
||||
"component": "VSwitch",
|
||||
"props": {
|
||||
"model": "skipverify",
|
||||
"label": "跳过校验(仅QB有效)",
|
||||
},
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
'component': 'VCol',
|
||||
'props': {
|
||||
@@ -536,6 +551,7 @@ class TorrentTransfer(_PluginBase):
|
||||
"fromtorrentpath": "",
|
||||
"nopaths": "",
|
||||
"autostart": True,
|
||||
"skipverify": False,
|
||||
"transferemptylabel": False,
|
||||
"add_torrent_tags": "已整理,转移做种"
|
||||
}
|
||||
@@ -572,7 +588,8 @@ class TorrentTransfer(_PluginBase):
|
||||
state = downloader.add_torrent(content=content,
|
||||
download_dir=save_path,
|
||||
is_paused=True,
|
||||
tag=self._torrent_tags + [tag])
|
||||
tag=self._torrent_tags + [tag],
|
||||
is_skip_checking=self._skipverify)
|
||||
if not state:
|
||||
return None
|
||||
else:
|
||||
@@ -803,14 +820,19 @@ class TorrentTransfer(_PluginBase):
|
||||
|
||||
# TR会自动校验,QB需要手动校验
|
||||
if self.downloader_helper.is_downloader("qbittorrent", service=to_service):
|
||||
logger.info(f"qbittorrent 开始校验 {download_id} ...")
|
||||
to_downloader.recheck_torrents(ids=[download_id])
|
||||
|
||||
# 追加校验任务
|
||||
logger.info(f"添加校验检查任务:{download_id} ...")
|
||||
if not self._recheck_torrents.get(to_service.name):
|
||||
self._recheck_torrents[to_service.name] = []
|
||||
self._recheck_torrents[to_service.name].append(download_id)
|
||||
if self._skipverify:
|
||||
if self._autostart:
|
||||
logger.info(f"{download_id} 跳过校验,开启自动开始,注意观察种子的完整性")
|
||||
self.__add_recheck_torrents(to_service, download_id)
|
||||
else:
|
||||
# 跳过校验
|
||||
logger.info(f"{download_id} 跳过校验,请自行检查手动开始任务...")
|
||||
else:
|
||||
logger.info(f"qbittorrent 开始校验 {download_id} ...")
|
||||
to_downloader.recheck_torrents(ids=[download_id])
|
||||
self.__add_recheck_torrents(to_service, download_id)
|
||||
else:
|
||||
self.__add_recheck_torrents(to_service, download_id)
|
||||
|
||||
# 删除源种子,不能删除文件!
|
||||
if self._deletesource:
|
||||
@@ -843,6 +865,13 @@ class TorrentTransfer(_PluginBase):
|
||||
logger.info(f"没有需要转移的种子")
|
||||
logger.info("转移做种任务执行完成")
|
||||
|
||||
def __add_recheck_torrents(self, service: ServiceInfo, download_id: str):
|
||||
# 追加校验任务
|
||||
logger.info(f"添加校验检查任务:{download_id} ...")
|
||||
if not self._recheck_torrents.get(service.name):
|
||||
self._recheck_torrents[service.name] = []
|
||||
self._recheck_torrents[service.name].append(download_id)
|
||||
|
||||
def check_recheck(self):
|
||||
"""
|
||||
定时检查下载器中种子是否校验完成,校验完成且完整的自动开始辅种
|
||||
|
||||
Reference in New Issue
Block a user