This commit is contained in:
jxxghp
2024-12-29 17:43:32 +08:00
parent 81e58e059b
commit 980715d0a9
8 changed files with 75 additions and 71 deletions

View File

@@ -301,11 +301,12 @@
"name": "IYUU自动辅种",
"description": "基于IYUU官方Api实现自动辅种。",
"labels": "做种,IYUU",
"version": "1.9.6",
"version": "1.9.7",
"icon": "IYUU.png",
"author": "jxxghp",
"level": 2,
"history": {
"v1.9.7": "支持qbittorrent 5",
"v1.9.6": "调整IYUU最新域名",
"v1.9.5": "Revert qBittorrent跳检之后自动开始",
"v1.9.4": "修复qBittorrent辅种后不会自动开始做种",
@@ -325,11 +326,12 @@
"name": "青蛙辅种助手",
"description": "参考ReseedPuppy和IYUU辅种插件实现自动辅种支持站点青蛙、AGSVPT、麒麟、UBits、聆音、憨憨等。",
"labels": "做种",
"version": "2.3",
"version": "2.4",
"icon": "qingwa.png",
"author": "233@qingwa",
"level": 2,
"history": {
"v2.4": "支持qbittorrent 5",
"v2.2": "站点停用后会同步暂停对该站点的辅种",
"v2.3": "站点辅种支持代理"
}
@@ -354,11 +356,12 @@
"name": "自动转移做种",
"description": "定期转移下载器中的做种任务到另一个下载器。",
"labels": "做种",
"version": "1.6",
"version": "1.7",
"icon": "seed.png",
"author": "jxxghp",
"level": 2,
"history": {
"v1.7": "支持qbittorrent 5",
"v1.6": "支持根据种子类别进行转移,并允许修改转移后的默认标签",
"v1.5": "修复在转移时只保留了第一个tracker导致红种问题。此修复确保保留所有的tracker以提高在不同网络条件下的可达性",
"v1.4": "支持自动删除源下载器在目的下载器中存在的种子"
@@ -674,11 +677,12 @@
"name": "QB远程操作",
"description": "通过定时任务或交互命令远程操作QB暂停/开始/限速等。",
"labels": "下载管理,Qbittorrent",
"version": "1.5",
"version": "1.6",
"icon": "Qbittorrent_A.png",
"author": "DzAvril",
"level": 1,
"history": {
"v1.6": "支持qbittorrent 5",
"v1.5": "可选特定路径下的做种不会被暂停",
"v1.4": "可选某些站点不再做种(暂停做种后不会被恢复)"
}

View File

@@ -99,11 +99,12 @@
"name": "自动转移做种",
"description": "定期转移下载器中的做种任务到另一个下载器。",
"labels": "做种",
"version": "1.7.1",
"version": "1.8",
"icon": "seed.png",
"author": "jxxghp",
"level": 2,
"history": {
"v1.8": "支持qbittorrent 5",
"v1.7": "MoviePilot V2 版本自动转移做种插件",
"v1.7.1": "修复兼容性问题"
}
@@ -203,11 +204,12 @@
"name": "IYUU自动辅种",
"description": "基于IYUU官方Api实现自动辅种。",
"labels": "做种,IYUU",
"version": "2.2",
"version": "2.3",
"icon": "IYUU.png",
"author": "jxxghp",
"level": 2,
"history": {
"v2.3": "支持qbittorrent 5",
"v2.2": "修复种子校验服务未生效",
"v2.1": "调整IYUU最新域名",
"v2.0": "兼容MoviePilot V2 版本"
@@ -217,11 +219,12 @@
"name": "QB远程操作",
"description": "通过定时任务或交互命令远程操作QB暂停/开始/限速等。",
"labels": "下载管理,Qbittorrent",
"version": "2.0",
"version": "2.1",
"icon": "Qbittorrent_A.png",
"author": "DzAvril",
"level": 1,
"history": {
"v2.1": "支持qbittorrent 5",
"v2.0": "适配MoviePilot V2 版本"
}
},

View File

@@ -33,7 +33,7 @@ class IYUUAutoSeed(_PluginBase):
# 插件图标
plugin_icon = "IYUU.png"
# 插件版本
plugin_version = "2.2"
plugin_version = "2.3"
# 插件作者
plugin_author = "jxxghp"
# 作者主页
@@ -1018,7 +1018,7 @@ class IYUUAutoSeed(_PluginBase):
判断种子是否可以做种并处于暂停状态
"""
try:
return torrent.get("state") == "pausedUP" or torrent.get("state") == "stoppedUP" if dl_type == "qbittorrent" \
return torrent.get("state") in ["pausedUP", "stoppedUP"] if dl_type == "qbittorrent" \
else (torrent.status.stopped and torrent.percent_done == 1)
except Exception as e:
print(str(e))

View File

@@ -28,7 +28,7 @@ class QbCommand(_PluginBase):
# 插件图标
plugin_icon = "Qbittorrent_A.png"
# 插件版本
plugin_version = "2.0"
plugin_version = "2.1"
# 插件作者
plugin_author = "DzAvril"
# 作者主页
@@ -678,7 +678,7 @@ class QbCommand(_PluginBase):
torrents = []
for torrent in all_torrents:
if torrent.get("state") == "pausedUP" or torrent.get("state") == "stoppedUP":
if torrent.get("state") in ["pausedUP", "stoppedUP"]:
tracker_url = self.get_torrent_tracker(torrent)
if not tracker_url:
logger.info(f"获取种子 {torrent.name} Tracker失败不过滤该种子")

View File

@@ -28,7 +28,7 @@ class TorrentTransfer(_PluginBase):
# 插件图标
plugin_icon = "seed.png"
# 插件版本
plugin_version = "1.7.1"
plugin_version = "1.8"
# 插件作者
plugin_author = "jxxghp"
# 作者主页
@@ -952,7 +952,7 @@ class TorrentTransfer(_PluginBase):
判断种子是否可以做种并处于暂停状态
"""
try:
return (torrent.get("state") == "pausedUP" or torrent.get("state") == "stoppedUP") if dl_type == "qbittorrent" \
return (torrent.get("state") in ["pausedUP", "stoppedUP"]) if dl_type == "qbittorrent" \
else (torrent.status.stopped and torrent.percent_done == 1)
except Exception as e:
print(str(e))

View File

@@ -180,7 +180,7 @@ class CrossSeed(_PluginBase):
# 插件图标
plugin_icon = "qingwa.png"
# 插件版本
plugin_version = "2.3"
plugin_version = "2.4"
# 插件作者
plugin_author = "233@qingwa"
# 作者主页
@@ -1164,7 +1164,7 @@ class CrossSeed(_PluginBase):
判断种子是否可以做种并处于暂停状态
"""
try:
return torrent.get("state") == "pausedUP" or torrent.get("state") == "stoppedUP" if dl_type == "qbittorrent" \
return torrent.get("state") in ["pausedUP", "stoppedUP"] if dl_type == "qbittorrent" \
else (torrent.status.stopped and torrent.percent_done == 1)
except Exception as e:
print(str(e))

View File

@@ -34,7 +34,7 @@ class IYUUAutoSeed(_PluginBase):
# 插件图标
plugin_icon = "IYUU.png"
# 插件版本
plugin_version = "1.9.6"
plugin_version = "1.9.7"
# 插件作者
plugin_author = "jxxghp"
# 作者主页
@@ -1006,7 +1006,7 @@ class IYUUAutoSeed(_PluginBase):
判断种子是否可以做种并处于暂停状态
"""
try:
return torrent.get("state") == "pausedUP" or torrent.get("state") == "stoppedUP" if dl_type == "qbittorrent" \
return torrent.get("state") in ["pausedUP", "stoppedUP"] if dl_type == "qbittorrent" \
else (torrent.status.stopped and torrent.percent_done == 1)
except Exception as e:
print(str(e))

View File

@@ -27,7 +27,7 @@ class QbCommand(_PluginBase):
# 插件图标
plugin_icon = "Qbittorrent_A.png"
# 插件版本
plugin_version = "1.5"
plugin_version = "1.6"
# 插件作者
plugin_author = "DzAvril"
# 作者主页
@@ -61,6 +61,7 @@ class QbCommand(_PluginBase):
_multi_level_root_domain = ["edu.cn", "com.cn", "net.cn", "org.cn"]
_scheduler = None
_exclude_dirs = ""
def init_plugin(self, config: dict = None):
self._sites = SitesHelper()
self._siteoper = SiteOper()
@@ -98,8 +99,7 @@ class QbCommand(_PluginBase):
self._scheduler.add_job(
self.pause_torrent,
"date",
run_date=datetime.now(tz=pytz.timezone(settings.TZ))
+ timedelta(seconds=3),
run_date=datetime.now(tz=pytz.timezone(settings.TZ)) + timedelta(seconds=3),
)
elif self._only_resume_once:
self._scheduler = BackgroundScheduler(timezone=settings.TZ)
@@ -107,8 +107,7 @@ class QbCommand(_PluginBase):
self._scheduler.add_job(
self.resume_torrent,
"date",
run_date=datetime.now(tz=pytz.timezone(settings.TZ))
+ timedelta(seconds=3),
run_date=datetime.now(tz=pytz.timezone(settings.TZ)) + timedelta(seconds=3),
)
self._only_resume_once = False
@@ -132,9 +131,9 @@ class QbCommand(_PluginBase):
self._scheduler.start()
if (
self._only_pause_upload
or self._only_pause_download
or self._only_pause_checking
self._only_pause_upload
or self._only_pause_download
or self._only_pause_checking
):
if self._only_pause_upload:
self._scheduler = BackgroundScheduler(timezone=settings.TZ)
@@ -142,8 +141,7 @@ class QbCommand(_PluginBase):
self._scheduler.add_job(
self.pause_torrent,
"date",
run_date=datetime.now(tz=pytz.timezone(settings.TZ))
+ timedelta(seconds=3),
run_date=datetime.now(tz=pytz.timezone(settings.TZ)) + timedelta(seconds=3),
kwargs={
'type': self.TorrentType.UPLOADING
}
@@ -154,8 +152,7 @@ class QbCommand(_PluginBase):
self._scheduler.add_job(
self.pause_torrent,
"date",
run_date=datetime.now(tz=pytz.timezone(settings.TZ))
+ timedelta(seconds=3),
run_date=datetime.now(tz=pytz.timezone(settings.TZ)) + timedelta(seconds=3),
kwargs={
'type': self.TorrentType.DOWNLOADING
}
@@ -166,8 +163,7 @@ class QbCommand(_PluginBase):
self._scheduler.add_job(
self.pause_torrent,
"date",
run_date=datetime.now(tz=pytz.timezone(settings.TZ))
+ timedelta(seconds=3),
run_date=datetime.now(tz=pytz.timezone(settings.TZ)) + timedelta(seconds=3),
kwargs={
'type': self.TorrentType.CHECKING
}
@@ -364,9 +360,9 @@ class QbCommand(_PluginBase):
if torrent.state_enum.is_uploading and not torrent.state_enum.is_paused:
uploading_torrents.append(torrent.get("hash"))
elif (
torrent.state_enum.is_downloading
and not torrent.state_enum.is_paused
and not torrent.state_enum.is_checking
torrent.state_enum.is_downloading
and not torrent.state_enum.is_paused
and not torrent.state_enum.is_checking
):
downloading_torrents.append(torrent.get("hash"))
elif torrent.state_enum.is_checking:
@@ -448,12 +444,12 @@ class QbCommand(_PluginBase):
mtype=NotificationType.SiteMessage,
title=f"【QB暂停任务启动】",
text=f"种子总数: {len(all_torrents)} \n"
f"做种数量: {len(hash_uploading)}\n"
f"下载数量: {len(hash_downloading)}\n"
f"检查数量: {len(hash_checking)}\n"
f"暂停数量: {len(hash_paused)}\n"
f"错误数量: {len(hash_error)}\n"
f"暂停操作中请稍等...\n",
f"做种数量: {len(hash_uploading)}\n"
f"下载数量: {len(hash_downloading)}\n"
f"检查数量: {len(hash_checking)}\n"
f"暂停数量: {len(hash_paused)}\n"
f"错误数量: {len(hash_error)}\n"
f"暂停操作中请稍等...\n",
)
pause_torrents = self.filter_pause_torrents(all_torrents)
hash_downloading, hash_uploading, hash_paused, hash_checking, hash_error = (
@@ -501,11 +497,11 @@ class QbCommand(_PluginBase):
mtype=NotificationType.SiteMessage,
title=f"【QB暂停任务完成】",
text=f"种子总数: {len(all_torrents)} \n"
f"做种数量: {len(hash_uploading)}\n"
f"下载数量: {len(hash_downloading)}\n"
f"检查数量: {len(hash_checking)}\n"
f"暂停数量: {len(hash_paused)}\n"
f"错误数量: {len(hash_error)}\n",
f"做种数量: {len(hash_uploading)}\n"
f"下载数量: {len(hash_downloading)}\n"
f"检查数量: {len(hash_checking)}\n"
f"暂停数量: {len(hash_paused)}\n"
f"错误数量: {len(hash_error)}\n",
)
def __is_excluded(self, file_path) -> bool:
@@ -516,6 +512,7 @@ class QbCommand(_PluginBase):
if exclude_dir and exclude_dir in str(file_path):
return True
return False
def filter_pause_torrents(self, all_torrents):
torrents = []
for torrent in all_torrents:
@@ -557,12 +554,12 @@ class QbCommand(_PluginBase):
mtype=NotificationType.SiteMessage,
title=f"【QB开始任务启动】",
text=f"种子总数: {len(all_torrents)} \n"
f"做种数量: {len(hash_uploading)}\n"
f"下载数量: {len(hash_downloading)}\n"
f"检查数量: {len(hash_checking)}\n"
f"暂停数量: {len(hash_paused)}\n"
f"错误数量: {len(hash_error)}\n"
f"开始操作中请稍等...\n",
f"做种数量: {len(hash_uploading)}\n"
f"下载数量: {len(hash_downloading)}\n"
f"检查数量: {len(hash_checking)}\n"
f"暂停数量: {len(hash_paused)}\n"
f"错误数量: {len(hash_error)}\n"
f"开始操作中请稍等...\n",
)
resume_torrents = self.filter_resume_torrents(all_torrents)
@@ -599,11 +596,11 @@ class QbCommand(_PluginBase):
mtype=NotificationType.SiteMessage,
title=f"【QB开始任务完成】",
text=f"种子总数: {len(all_torrents)} \n"
f"做种数量: {len(hash_uploading)}\n"
f"下载数量: {len(hash_downloading)}\n"
f"检查数量: {len(hash_checking)}\n"
f"暂停数量: {len(hash_paused)}\n"
f"错误数量: {len(hash_error)}\n",
f"做种数量: {len(hash_uploading)}\n"
f"下载数量: {len(hash_downloading)}\n"
f"检查数量: {len(hash_checking)}\n"
f"暂停数量: {len(hash_paused)}\n"
f"错误数量: {len(hash_error)}\n",
)
def filter_resume_torrents(self, all_torrents):
@@ -622,7 +619,7 @@ class QbCommand(_PluginBase):
torrents = []
for torrent in all_torrents:
if torrent.get("state") == "pausedUP" or torrent.get("state") == "stoppedUP":
if torrent.get("state") in ["pausedUP", "stoppedUP"]:
tracker_url = self.get_torrent_tracker(torrent)
if not tracker_url:
logger.info(f"获取种子 {torrent.name} Tracker失败不过滤该种子")
@@ -673,11 +670,11 @@ class QbCommand(_PluginBase):
mtype=NotificationType.SiteMessage,
title=f"【QB任务状态】",
text=f"种子总数: {len(all_torrents)} \n"
f"做种数量: {len(hash_uploading)}\n"
f"下载数量: {len(hash_downloading)}\n"
f"检查数量: {len(hash_checking)}\n"
f"暂停数量: {len(hash_paused)}\n"
f"错误数量: {len(hash_error)}\n"
f"做种数量: {len(hash_uploading)}\n"
f"下载数量: {len(hash_downloading)}\n"
f"检查数量: {len(hash_checking)}\n"
f"暂停数量: {len(hash_paused)}\n"
f"错误数量: {len(hash_error)}\n"
)
@eventmanager.register(EventType.PluginAction)
@@ -705,10 +702,10 @@ class QbCommand(_PluginBase):
return True
if (
not upload_limit
or not upload_limit.isdigit()
or not download_limit
or not download_limit.isdigit()
not upload_limit
or not upload_limit.isdigit()
or not download_limit
or not download_limit.isdigit()
):
self.post_message(
mtype=NotificationType.SiteMessage,
@@ -854,11 +851,11 @@ class QbCommand(_PluginBase):
customSites = self.__custom_sites()
site_options = [
{"title": site.name, "value": site.id}
for site in self._siteoper.list_order_by_pri()
] + [
{"title": site.get("name"), "value": site.get("id")} for site in customSites
]
{"title": site.name, "value": site.id}
for site in self._siteoper.list_order_by_pri()
] + [
{"title": site.get("name"), "value": site.get("id")} for site in customSites
]
return [
{
"component": "VForm",