From 7b9155fb46548c131b532788b7f3f1615f971616 Mon Sep 17 00:00:00 2001 From: xuzhi Date: Sun, 2 Jun 2024 02:27:32 +0000 Subject: [PATCH] Update cleaninvalidseed to v2.0 --- package.json | 3 ++- plugins/cleaninvalidseed/__init__.py | 25 +++---------------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index a4ca416..d81aeb3 100644 --- a/package.json +++ b/package.json @@ -702,11 +702,12 @@ "name": "清理QB无效做种", "description": "清理已经被站点删除的种子及对应源文件,仅支持QB", "labels": "Qbittorrent", - "version": "1.9", + "version": "2.0", "icon": "clean_a.png", "author": "DzAvril", "level": 1, "history": { + "v2.0": "修复检测不到无效做种的bug", "v1.9": "增加自定义需删除做种的tracker的错误信息", "v1.8": "增加远程命令切换全量通知;修复bug", "v1.7": "修复因消息内容包含'_'导致telegram API调用失败的问题", diff --git a/plugins/cleaninvalidseed/__init__.py b/plugins/cleaninvalidseed/__init__.py index 427420f..1e8ea24 100644 --- a/plugins/cleaninvalidseed/__init__.py +++ b/plugins/cleaninvalidseed/__init__.py @@ -28,7 +28,7 @@ class CleanInvalidSeed(_PluginBase): # 插件图标 plugin_icon = "clean_a.png" # 插件版本 - plugin_version = "1.9" + plugin_version = "2.0" # 插件作者 plugin_author = "DzAvril" # 作者主页 @@ -287,7 +287,8 @@ class CleanInvalidSeed(_PluginBase): working_tracker_set = set() exclude_categories = self._exclude_categories.split("\n") if self._exclude_categories else [] exclude_labels = self._exclude_labels.split("\n") if self._exclude_labels else [] - error_msgs = self._error_msg + self._custom_error_msg.split("\n") if self._exclude_labels else [] + custom_msgs = self._custom_error_msg.split("\n") if self._custom_error_msg else [] + error_msgs = self._error_msg + custom_msgs # 第一轮筛选出所有未工作的种子 for torrent in all_torrents: trackers = torrent.trackers @@ -818,23 +819,3 @@ class CleanInvalidSeed(_PluginBase): self._scheduler = None except Exception as e: logger.error("退出插件失败:%s" % str(e)) - - -if __name__ == "__main__": - clean = CleanInvalidSeed() - config = { - "enabled": True, - "notify": True, - "download_dirs": "/sata16t/春天:/保种/春天\n/sata16t/观众:/保种/观众\n/sata16t/UB:/保种/UB\n/sata16t/听听歌:/保种/听听歌\n/ssd/Download/shualiu:/Downloads/shualiu", - "delete_invalid_torrents": False, - "delete_invalid_files": False, - "detect_invalid_files": True, - "notify_all": False, - "onlyonce": False, - "cron": "0 0 * * *", - "exclude_keywords": "ABF-075\nIPZZ-002-C_GG5\nIPZZ-061\n.!qB", - "exclude_categories": "电影", - "exclude_labels": "春天", - } - clean.init_plugin(config) - clean.clean_invalid_seed() \ No newline at end of file