From d2b6a678b5cd28993d579783993044ee648c544e Mon Sep 17 00:00:00 2001 From: Attente <19653207+wikrin@users.noreply.github.com> Date: Sat, 11 Jan 2025 22:54:45 +0800 Subject: [PATCH 1/7] =?UTF-8?q?feat(bangumicoll):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=A4=9A=E8=AF=AD=E8=A8=80=E6=A0=87=E9=A2=98,=20=E5=8E=BB?= =?UTF-8?q?=E9=99=A4=E5=A4=9A=E4=BD=99=E8=AE=BE=E7=BD=AE=E9=A1=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 3 ++- plugins/bangumicoll/__init__.py | 28 ++++++++++---------- plugins/bangumicoll/page_components.py | 36 +------------------------- 3 files changed, 17 insertions(+), 50 deletions(-) diff --git a/package.json b/package.json index 7746741..79101c4 100644 --- a/package.json +++ b/package.json @@ -927,12 +927,13 @@ "name": "Bangumi收藏订阅", "description": "Bangumi用户收藏添加到订阅", "labels": "订阅", - "version": "1.5.2", + "version": "1.5.3", "icon": "bangumi_b.png", "author": "Attente", "level": 1, "v2": true, "history": { + "v1.5.3": "增加多语言标题匹配, 去除未实现设置项", "v1.5.2": "修复定时任务未正确注册的问题", "v1.5.1": "修复季度信息未传递的问题. 新增站点列表同步删除", "v1.5": "修复总集数会同步TMDB变动的问题,增加开关选项" diff --git a/plugins/bangumicoll/__init__.py b/plugins/bangumicoll/__init__.py index 5728e41..5f4fba0 100644 --- a/plugins/bangumicoll/__init__.py +++ b/plugins/bangumicoll/__init__.py @@ -36,7 +36,7 @@ class BangumiColl(_PluginBase): # 插件图标 plugin_icon = "bangumi_b.png" # 插件版本 - plugin_version = "1.5.2" + plugin_version = "1.5.3" # 插件作者 plugin_author = "Attente" # 作者主页 @@ -60,8 +60,6 @@ class BangumiColl(_PluginBase): _cron: str = "" _notify: bool = False _onlyonce: bool = False - _include: str = "" - _exclude: str = "" _uid: str = "" _collection_type = [] _save_path: str = "" @@ -130,8 +128,6 @@ class BangumiColl(_PluginBase): "cron": self._cron, "uid": self._uid, "collection_type": self._collection_type, - "include": self._include, - "exclude": self._exclude, "save_path": self._save_path, "sites": self._sites, } @@ -151,7 +147,7 @@ class BangumiColl(_PluginBase): """ 注册插件公共服务 """ - if self._enabled or self._cron: + if self._enabled: trigger = CronTrigger.from_crontab(self._cron) if self._cron else "interval" kwargs = {"hours": 6} if not self._cron else {} return [ @@ -219,7 +215,6 @@ class BangumiColl(_PluginBase): logger.error(f"Bangumi用户:{self._uid} ,没有任何收藏") return {} - logger.info("解析Bangumi条目信息...") return { item.get("subject_id"): { "name": item['subject'].get('name'), @@ -264,14 +259,18 @@ class BangumiColl(_PluginBase): fail_items = {} for self._subid, item in items.items(): - meta = MetaInfo(item.get("name_cn")) + if item.get("name_cn"): + meta = MetaInfo(item.get("name_cn")) + meta.en_name = item.get("name") + else: + meta = MetaInfo(item.get("name")) if not meta.name: - fail_items[self._subid] = f"{item.get('name_cn')} 未识别到有效数据" - logger.warn(f"{item.get('name_cn')} 未识别到有效数据") + fail_items[self._subid] = f"{self._subid} 未识别到有效数据" + logger.warn(f"{self._subid} 未识别到有效数据") continue meta.year = item.get("date")[:4] if item.get("date") else None - mediainfo = self.chain.recognize_media(meta=meta) + mediainfo = self.chain.recognize_media(meta=meta, cache=False) meta.total_episode = item.get("eps", 0) if not mediainfo: fail_items[self._subid] = f"{item.get('name_cn')} 媒体信息识别失败" @@ -301,7 +300,7 @@ class BangumiColl(_PluginBase): **self.prepare_kwargs(meta, mediainfo), ) if not sid: - fail_items[self._subid] = f"{item.get('name_cn')} {msg}" + fail_items[self._subid] = f"{item.get('name_cn') or item.get('name')} {msg}" return fail_items @@ -362,8 +361,9 @@ class BangumiColl(_PluginBase): data = res.json().get("data", [{}])[0] prev = data.get("sort", 1) - data.get("ep", 1) total = res.json().get("total", None) - meta.begin_episode = prev + 1 - meta.end_episode = prev + total if total else None + begin = prev + 1 + end = prev + total if total else None + meta.set_episodes(begin, end) except Exception as e: logger.error(f"获取集数信息失败: {str(e)}") finally: diff --git a/plugins/bangumicoll/page_components.py b/plugins/bangumicoll/page_components.py index 044299c..d27ad49 100644 --- a/plugins/bangumicoll/page_components.py +++ b/plugins/bangumicoll/page_components.py @@ -72,6 +72,7 @@ def form(sites_options) -> list: 'content': [ { 'component': 'VTextField', + # 'component': 'VCronField', # 暂不支持 'props': { 'model': 'cron', 'label': '执行周期', @@ -115,39 +116,6 @@ def form(sites_options) -> list: }, ], }, - { - 'component': 'VRow', - 'content': [ - { - 'component': 'VCol', - 'props': {'cols': 12, 'md': 6}, - 'content': [ - { - 'component': 'VTextField', - 'props': { - 'model': 'include', - 'label': '包含', - 'placeholder': '暂未实现', - }, - } - ], - }, - { - 'component': 'VCol', - 'props': {'cols': 12, 'md': 6}, - 'content': [ - { - 'component': 'VTextField', - 'props': { - 'model': 'exclude', - 'label': '排除', - 'placeholder': '暂未实现', - }, - } - ], - }, - ], - }, { 'component': 'VRow', 'content': [ @@ -262,8 +230,6 @@ def form(sites_options) -> list: "cron": "", "uid": "", "collection_type": [3], - "include": "", - "exclude": "", "save_path": "", "sites": [], } From a745d568029b3335416652a5a7d6b7bf60bb2cf5 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 13 Jan 2025 13:17:36 +0800 Subject: [PATCH 2/7] =?UTF-8?q?feat=EF=BC=9A=E7=BB=9F=E4=B8=80=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=89=A7=E8=A1=8C=E5=91=A8=E6=9C=9F=E5=BD=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.v2.json | 36 ++++++++++++------- plugins.v2/autoclean/__init__.py | 4 +-- plugins.v2/autosignin/__init__.py | 7 ++-- plugins.v2/brushflow/__init__.py | 4 +-- plugins.v2/ffmpegthumb/__init__.py | 4 +-- plugins.v2/iyuuautoseed/__init__.py | 4 +-- plugins.v2/libraryscraper/__init__.py | 4 +-- plugins.v2/moviepilotupdatenotify/__init__.py | 4 +-- plugins.v2/personmeta/__init__.py | 4 +-- plugins.v2/rsssubscribe/__init__.py | 4 +-- plugins.v2/synccookiecloud/__init__.py | 4 +-- plugins.v2/torrentremover/__init__.py | 4 +-- plugins.v2/torrenttransfer/__init__.py | 4 +-- 13 files changed, 50 insertions(+), 37 deletions(-) diff --git a/package.v2.json b/package.v2.json index 57b8699..5198442 100644 --- a/package.v2.json +++ b/package.v2.json @@ -20,11 +20,12 @@ "name": "站点刷流", "description": "自动托管刷流,将会提高对应站点的访问频率。", "labels": "刷流,仪表板", - "version": "4.1", + "version": "4.2", "icon": "brush.jpg", "author": "jxxghp,InfinityPacer", "level": 2, "history": { + "v4.2": "优化执行周期输入,需要MoviePilot v2.2.1+", "v4.1": "支持通过CRON表达式配置开启时间,固定10分钟为执行周期", "v4.0": "站点独立配置项支持配置NexusPHP 站点自动跳过下载提示页", "v3.9": "MoviePilot V2 版本站点刷流插件" @@ -34,11 +35,12 @@ "name": "站点自动签到", "description": "自动模拟登录、签到站点。", "labels": "站点", - "version": "2.5.2", + "version": "2.5.3", "icon": "signin.png", "author": "thsrite", "level": 2, "history": { + "v2.5.3": "优化执行周期输入,需要MoviePilot v2.2.1+", "v2.5.2": "修复HDArea签到", "v2.5.1": "修复空签到失败问题", "v2.5": "MoviePilot V2 版本站点自动签到插件" @@ -99,11 +101,12 @@ "name": "自动转移做种", "description": "定期转移下载器中的做种任务到另一个下载器。", "labels": "做种", - "version": "1.8", + "version": "1.9", "icon": "seed.png", "author": "jxxghp", "level": 2, "history": { + "v1.9": "优化执行周期输入,需要MoviePilot v2.2.1+", "v1.8": "支持qbittorrent 5", "v1.7": "MoviePilot V2 版本自动转移做种插件", "v1.7.1": "修复兼容性问题" @@ -113,11 +116,12 @@ "name": "自定义订阅", "description": "定时刷新RSS报文,识别内容后添加订阅或直接下载。", "labels": "订阅", - "version": "2.0", + "version": "2.1", "icon": "rss.png", "author": "jxxghp", "level": 2, "history": { + "v2.1": "优化执行周期输入,需要MoviePilot v2.2.1+", "v2.0": "兼容MoviePilot V2 版本" } }, @@ -125,11 +129,12 @@ "name": "FFmpeg缩略图", "description": "TheMovieDb没有背景图片时使用FFmpeg截取视频文件缩略图", "labels": "刮削", - "version": "2.0", + "version": "2.1", "icon": "ffmpeg.png", "author": "jxxghp", "level": 1, "history": { + "v2.1": "优化执行周期输入,需要MoviePilot v2.2.1+", "v2.0": "兼容MoviePilot V2 版本" } }, @@ -137,11 +142,12 @@ "name": "媒体库刮削", "description": "定时对媒体库进行刮削,补齐缺失元数据和图片。", "labels": "刮削", - "version": "2.0", + "version": "2.1", "icon": "scraper.png", "author": "jxxghp", "level": 1, "history": { + "v2.1": "优化执行周期输入,需要MoviePilot v2.2.1+", "v2.0": "兼容MoviePilot V2 版本", "v1.5": "修复未获取fanart图片的问题", "v1.4.1": "修复nfo文件读取失败时任务中断问题" @@ -151,11 +157,12 @@ "name": "演职人员刮削", "description": "刮削演职人员图片以及中文名称。", "labels": "媒体库,刮削", - "version": "2.0.1", + "version": "2.1", "icon": "actor.png", "author": "jxxghp", "level": 1, "history": { + "v2.1": "优化执行周期输入,需要MoviePilot v2.2.1+", "v2.0": "兼容MoviePilot V2 版本", "v1.4": "人物图片调整为优先从TMDB获取,避免douban图片CDN加载过慢的问题", "v1.3": "修复v1.8.5版本后刮削报错问题" @@ -179,11 +186,12 @@ "name": "定时清理媒体库", "description": "定时清理用户下载的种子、源文件、媒体库文件。", "labels": "媒体库", - "version": "2.0", + "version": "2.1", "icon": "clean.png", "author": "thsrite", "level": 2, "history": { + "v2.1": "优化执行周期输入,需要MoviePilot v2.2.1+", "v2.0": "兼容MoviePilot V2 版本" } }, @@ -191,11 +199,12 @@ "name": "自动删种", "description": "自动删除下载器中的下载任务。", "labels": "做种", - "version": "2.1.1", + "version": "2.2", "icon": "delete.jpg", "author": "jxxghp", "level": 2, "history": { + "v2.2": "优化执行周期输入,需要MoviePilot v2.2.1+", "v2.1.1": "修复兼容MoviePilot V2 版本", "v2.0": "兼容MoviePilot V2 版本" } @@ -204,11 +213,12 @@ "name": "IYUU自动辅种", "description": "基于IYUU官方Api实现自动辅种。", "labels": "做种,IYUU", - "version": "2.5", + "version": "2.6", "icon": "IYUU.png", "author": "jxxghp", "level": 2, "history": { + "v2.6": "优化执行周期输入,需要MoviePilot v2.2.1+", "v2.5": "修复qb辅种结束后自动开始暂停的种子", "v2.4": "辅种结束后,一起开始所有辅种后暂停的种子(排除了出错的种子)", "v2.3": "支持qbittorrent 5", @@ -246,11 +256,12 @@ "name": "同步CookieCloud", "description": "同步MoviePilot站点Cookie到本地CookieCloud。", "labels": "站点", - "version": "2.1", + "version": "2.2", "icon": "Cookiecloud_A.png", "author": "thsrite", "level": 1, "history": { + "v2.2": "优化执行周期输入,需要MoviePilot v2.2.1+", "v2.1": "兼容MoviePilot V2" } }, @@ -295,11 +306,12 @@ "name": "MoviePilot更新推送", "description": "MoviePilot推送release更新通知、自动重启。", "labels": "消息通知,自动更新", - "version": "2.0", + "version": "2.1", "icon": "Moviepilot_A.png", "author": "thsrite", "level": 1, "history": { + "v2.1": "优化执行周期输入,需要MoviePilot v2.2.1+", "v2.0": "兼容MoviePilot V2" } } diff --git a/plugins.v2/autoclean/__init__.py b/plugins.v2/autoclean/__init__.py index 7d909ac..26a83dc 100644 --- a/plugins.v2/autoclean/__init__.py +++ b/plugins.v2/autoclean/__init__.py @@ -27,7 +27,7 @@ class AutoClean(_PluginBase): # 插件图标 plugin_icon = "clean.png" # 插件版本 - plugin_version = "2.0" + plugin_version = "2.1" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -351,7 +351,7 @@ class AutoClean(_PluginBase): }, 'content': [ { - 'component': 'VTextField', + 'component': 'VCronField', 'props': { 'model': 'cron', 'label': '执行周期', diff --git a/plugins.v2/autosignin/__init__.py b/plugins.v2/autosignin/__init__.py index 07425f6..82913a6 100644 --- a/plugins.v2/autosignin/__init__.py +++ b/plugins.v2/autosignin/__init__.py @@ -37,7 +37,7 @@ class AutoSignIn(_PluginBase): # 插件图标 plugin_icon = "signin.png" # 插件版本 - plugin_version = "2.5.2" + plugin_version = "2.5.3" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -359,7 +359,7 @@ class AutoSignIn(_PluginBase): }, 'content': [ { - 'component': 'VTextField', + 'component': 'VCronField', 'props': { 'model': 'cron', 'label': '执行周期', @@ -856,9 +856,10 @@ class AutoSignIn(_PluginBase): message=f"站点【{url}】不存在" ) else: + site_name, message = self.signin_site(site_info) return schemas.Response( success=True, - message=self.signin_site(site_info) + message=f"站点【{site_name}】{message or '签到成功'}" ) def signin_site(self, site_info: CommentedMap) -> Tuple[str, str]: diff --git a/plugins.v2/brushflow/__init__.py b/plugins.v2/brushflow/__init__.py index b22c76c..3a84f8c 100644 --- a/plugins.v2/brushflow/__init__.py +++ b/plugins.v2/brushflow/__init__.py @@ -251,7 +251,7 @@ class BrushFlow(_PluginBase): # 插件图标 plugin_icon = "brush.jpg" # 插件版本 - plugin_version = "4.1" + plugin_version = "4.2" # 插件作者 plugin_author = "jxxghp,InfinityPacer" # 作者主页 @@ -924,7 +924,7 @@ class BrushFlow(_PluginBase): }, 'content': [ { - 'component': 'VTextField', + 'component': 'VCronField', 'props': { 'model': 'cron', 'label': '执行周期', diff --git a/plugins.v2/ffmpegthumb/__init__.py b/plugins.v2/ffmpegthumb/__init__.py index b645f31..5550ace 100644 --- a/plugins.v2/ffmpegthumb/__init__.py +++ b/plugins.v2/ffmpegthumb/__init__.py @@ -28,7 +28,7 @@ class FFmpegThumb(_PluginBase): # 插件图标 plugin_icon = "ffmpeg.png" # 插件版本 - plugin_version = "2.0" + plugin_version = "2.1" # 插件作者 plugin_author = "jxxghp" # 作者主页 @@ -176,7 +176,7 @@ class FFmpegThumb(_PluginBase): }, 'content': [ { - 'component': 'VTextField', + 'component': 'VCronField', 'props': { 'model': 'cron', 'label': '定时扫描周期', diff --git a/plugins.v2/iyuuautoseed/__init__.py b/plugins.v2/iyuuautoseed/__init__.py index 748ff3e..1960d4c 100644 --- a/plugins.v2/iyuuautoseed/__init__.py +++ b/plugins.v2/iyuuautoseed/__init__.py @@ -33,7 +33,7 @@ class IYUUAutoSeed(_PluginBase): # 插件图标 plugin_icon = "IYUU.png" # 插件版本 - plugin_version = "2.5" + plugin_version = "2.6" # 插件作者 plugin_author = "jxxghp" # 作者主页 @@ -309,7 +309,7 @@ class IYUUAutoSeed(_PluginBase): }, 'content': [ { - 'component': 'VTextField', + 'component': 'VCronField', 'props': { 'model': 'cron', 'label': '执行周期', diff --git a/plugins.v2/libraryscraper/__init__.py b/plugins.v2/libraryscraper/__init__.py index 682e969..d7b9198 100644 --- a/plugins.v2/libraryscraper/__init__.py +++ b/plugins.v2/libraryscraper/__init__.py @@ -27,7 +27,7 @@ class LibraryScraper(_PluginBase): # 插件图标 plugin_icon = "scraper.png" # 插件版本 - plugin_version = "2.0" + plugin_version = "2.1" # 插件作者 plugin_author = "jxxghp" # 作者主页 @@ -205,7 +205,7 @@ class LibraryScraper(_PluginBase): }, 'content': [ { - 'component': 'VTextField', + 'component': 'VCronField', 'props': { 'model': 'cron', 'label': '执行周期', diff --git a/plugins.v2/moviepilotupdatenotify/__init__.py b/plugins.v2/moviepilotupdatenotify/__init__.py index 3841ce0..05866a3 100644 --- a/plugins.v2/moviepilotupdatenotify/__init__.py +++ b/plugins.v2/moviepilotupdatenotify/__init__.py @@ -23,7 +23,7 @@ class MoviePilotUpdateNotify(_PluginBase): # 插件图标 plugin_icon = "Moviepilot_A.png" # 插件版本 - plugin_version = "2.0" + plugin_version = "2.1" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -288,7 +288,7 @@ class MoviePilotUpdateNotify(_PluginBase): }, 'content': [ { - 'component': 'VTextField', + 'component': 'VCronField', 'props': { 'model': 'cron', 'label': '检查周期', diff --git a/plugins.v2/personmeta/__init__.py b/plugins.v2/personmeta/__init__.py index f1c5049..4be5e26 100644 --- a/plugins.v2/personmeta/__init__.py +++ b/plugins.v2/personmeta/__init__.py @@ -38,7 +38,7 @@ class PersonMeta(_PluginBase): # 插件图标 plugin_icon = "actor.png" # 插件版本 - plugin_version = "2.0.1" + plugin_version = "2.1" # 插件作者 plugin_author = "jxxghp" # 作者主页 @@ -199,7 +199,7 @@ class PersonMeta(_PluginBase): }, 'content': [ { - 'component': 'VTextField', + 'component': 'VCronField', 'props': { 'model': 'cron', 'label': '媒体库扫描周期', diff --git a/plugins.v2/rsssubscribe/__init__.py b/plugins.v2/rsssubscribe/__init__.py index 4480b2d..9af08e9 100644 --- a/plugins.v2/rsssubscribe/__init__.py +++ b/plugins.v2/rsssubscribe/__init__.py @@ -33,7 +33,7 @@ class RssSubscribe(_PluginBase): # 插件图标 plugin_icon = "rss.png" # 插件版本 - plugin_version = "2.0" + plugin_version = "2.1" # 插件作者 plugin_author = "jxxghp" # 作者主页 @@ -249,7 +249,7 @@ class RssSubscribe(_PluginBase): }, 'content': [ { - 'component': 'VTextField', + 'component': 'VCronField', 'props': { 'model': 'cron', 'label': '执行周期', diff --git a/plugins.v2/synccookiecloud/__init__.py b/plugins.v2/synccookiecloud/__init__.py index 6fcd4c4..81205d6 100644 --- a/plugins.v2/synccookiecloud/__init__.py +++ b/plugins.v2/synccookiecloud/__init__.py @@ -24,7 +24,7 @@ class SyncCookieCloud(_PluginBase): # 插件图标 plugin_icon = "Cookiecloud_A.png" # 插件版本 - plugin_version = "2.1" + plugin_version = "2.2" # 插件作者 plugin_author = "thsrite" # 作者主页 @@ -243,7 +243,7 @@ class SyncCookieCloud(_PluginBase): }, 'content': [ { - 'component': 'VTextField', + 'component': 'VCronField', 'props': { 'model': 'cron', 'label': '执行周期', diff --git a/plugins.v2/torrentremover/__init__.py b/plugins.v2/torrentremover/__init__.py index f3ab683..ddae9d9 100644 --- a/plugins.v2/torrentremover/__init__.py +++ b/plugins.v2/torrentremover/__init__.py @@ -26,7 +26,7 @@ class TorrentRemover(_PluginBase): # 插件图标 plugin_icon = "delete.jpg" # 插件版本 - plugin_version = "2.1.1" + plugin_version = "2.2" # 插件作者 plugin_author = "jxxghp" # 作者主页 @@ -207,7 +207,7 @@ class TorrentRemover(_PluginBase): }, 'content': [ { - 'component': 'VTextField', + 'component': 'VCronField', 'props': { 'model': 'cron', 'label': '执行周期', diff --git a/plugins.v2/torrenttransfer/__init__.py b/plugins.v2/torrenttransfer/__init__.py index 35c1438..9beb8f4 100644 --- a/plugins.v2/torrenttransfer/__init__.py +++ b/plugins.v2/torrenttransfer/__init__.py @@ -28,7 +28,7 @@ class TorrentTransfer(_PluginBase): # 插件图标 plugin_icon = "seed.png" # 插件版本 - plugin_version = "1.8" + plugin_version = "1.9" # 插件作者 plugin_author = "jxxghp" # 作者主页 @@ -259,7 +259,7 @@ class TorrentTransfer(_PluginBase): }, 'content': [ { - 'component': 'VTextField', + 'component': 'VCronField', 'props': { 'model': 'cron', 'label': '执行周期', From b91d710313cbc27ee307938c6fe82662710dc941 Mon Sep 17 00:00:00 2001 From: chenkun Date: Mon, 13 Jan 2025 17:03:15 +0800 Subject: [PATCH 3/7] =?UTF-8?q?feat:=20IYUU=E8=87=AA=E5=8A=A8=E8=BE=85?= =?UTF-8?q?=E7=A7=8D=E6=8F=92=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=B8=BB?= =?UTF-8?q?=E8=BE=85=E5=88=86=E7=A6=BB=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.v2.json | 3 +- plugins.v2/iyuuautoseed/__init__.py | 166 +++++++++++++++++++--------- 2 files changed, 117 insertions(+), 52 deletions(-) diff --git a/package.v2.json b/package.v2.json index 5198442..b239f54 100644 --- a/package.v2.json +++ b/package.v2.json @@ -215,9 +215,10 @@ "labels": "做种,IYUU", "version": "2.6", "icon": "IYUU.png", - "author": "jxxghp", + "author": "jxxghp,ckun", "level": 2, "history": { + "v2.7": "增加主辅分离配置,单独指定辅种下载器", "v2.6": "优化执行周期输入,需要MoviePilot v2.2.1+", "v2.5": "修复qb辅种结束后自动开始暂停的种子", "v2.4": "辅种结束后,一起开始所有辅种后暂停的种子(排除了出错的种子)", diff --git a/plugins.v2/iyuuautoseed/__init__.py b/plugins.v2/iyuuautoseed/__init__.py index 1960d4c..e5fedbc 100644 --- a/plugins.v2/iyuuautoseed/__init__.py +++ b/plugins.v2/iyuuautoseed/__init__.py @@ -35,7 +35,7 @@ class IYUUAutoSeed(_PluginBase): # 插件版本 plugin_version = "2.6" # 插件作者 - plugin_author = "jxxghp" + plugin_author = "jxxghp,ckun" # 作者主页 author_url = "https://github.com/jxxghp" # 插件配置项ID前缀 @@ -59,6 +59,8 @@ class IYUUAutoSeed(_PluginBase): _onlyonce = False _token = None _downloaders = [] + # 辅种下载器 + _auto_downloader = None _sites = [] _notify = False _nolabels = None @@ -107,6 +109,7 @@ class IYUUAutoSeed(_PluginBase): self._cron = config.get("cron") self._token = config.get("token") self._downloaders = config.get("downloaders") + self._auto_downloader = config.get("auto_downloader") self._sites = config.get("sites") or [] self._notify = config.get("notify") self._nolabels = config.get("nolabels") @@ -182,6 +185,25 @@ class IYUUAutoSeed(_PluginBase): return active_services + @property + def auto_service_info(self) -> Optional[Dict[str, ServiceInfo]]: + """ + 服务信息 + """ + if not self._auto_downloader: + logger.warning("尚未配置主辅分离下载器,请检查配置") + return None + + service = self.downloader_helper.get_service(name=self._auto_downloader) + if not service: + logger.warning("获取主辅分离下载器实例失败,请检查配置") + return None + + if service.instance.is_inactive(): + logger.warning(f"下载器 {service.name} 未连接,请检查配置") + return None + return service + def get_state(self) -> bool: return True if self._enabled and self._cron and self._token and self._downloaders else False @@ -327,7 +349,7 @@ class IYUUAutoSeed(_PluginBase): 'component': 'VCol', 'props': { 'cols': 12, - 'md': 6 + 'md': 4 }, 'content': [ { @@ -348,7 +370,25 @@ class IYUUAutoSeed(_PluginBase): 'component': 'VCol', 'props': { 'cols': 12, - 'md': 6 + 'md': 4 + }, + 'content': [ + { + 'component': 'VSelect', + 'props': { + 'model': 'auto_downloader', + 'label': '主辅分离', + 'items': [{"title": config.name, "value": config.name} + for config in self.downloader_helper.get_configs().values()] + } + } + ] + }, + { + 'component': 'VCol', + 'props': { + 'cols': 12, + 'md': 4 }, 'content': [ { @@ -524,6 +564,7 @@ class IYUUAutoSeed(_PluginBase): "cron": "", "token": "", "downloaders": [], + "auto_downloader": "", "sites": [], "nopaths": "", "nolabels": "", @@ -544,6 +585,7 @@ class IYUUAutoSeed(_PluginBase): "cron": self._cron, "token": self._token, "downloaders": self._downloaders, + "auto_downloader": self._auto_downloader, "sites": self._sites, "notify": self._notify, "nolabels": self._nolabels, @@ -643,22 +685,13 @@ class IYUUAutoSeed(_PluginBase): self.check_recheck() else: logger.info(f"没有需要辅种的种子") - # qb 中,辅种结束后,一起开始所有辅种后暂停的种子(排除了出错的种子),及时人工确认也是手动开始这部分种子 - for service in self.service_infos.values(): - downloader = service.name - downloader_obj = service.instance - # 只处理 qb - if service.type == "qbittorrent": - paused_torrents, _ = downloader_obj.get_torrents(status="paused") - # errored_torrents, _ = downloader_obj.get_torrents(status=["errored"]) - pausedUP_torrent_hashs = [] - for torrent in paused_torrents: - if torrent.state in ['pausedUP', 'stoppedUP']: - pausedUP_torrent_hashs.append(torrent.hash) - logger.info(f"下载器 {downloader} 自动开始种子 {torrent.name}") - else: - logger.info(f"下载器 {downloader} 不自动开始种子 {torrent.name}, state={torrent.state}") - downloader_obj.start_torrents(ids=pausedUP_torrent_hashs) + # 指定主辅分离时只检查辅种下载器 + if not self.auto_service_info: + self.start_service_torrents(self.auto_service_info) + else: + # qb 中,辅种结束后,一起开始所有辅种后暂停的种子(排除了出错的种子),及时人工确认也是手动开始这部分种子 + for service in self.service_infos.values(): + self.start_service_torrents(service) # 保存缓存 self.__update_config() # 发送消息 @@ -676,49 +709,80 @@ class IYUUAutoSeed(_PluginBase): ) logger.info("辅种任务执行完成") + def start_service_torrents(self, service: ServiceInfo): + """ + 指定下载器开始种子 + """ + downloader = service.name + downloader_obj = service.instance + # 只处理 qb + if service.type == "qbittorrent": + paused_torrents, _ = downloader_obj.get_torrents(status="paused") + # errored_torrents, _ = downloader_obj.get_torrents(status=["errored"]) + pausedUP_torrent_hashs = [] + for torrent in paused_torrents: + if torrent.state in ['pausedUP', 'stoppedUP']: + pausedUP_torrent_hashs.append(torrent.hash) + logger.info(f"下载器 {downloader} 自动开始种子 {torrent.name}") + else: + logger.info(f"下载器 {downloader} 不自动开始种子 {torrent.name}, state={torrent.state}") + downloader_obj.start_torrents(ids=pausedUP_torrent_hashs) + def check_recheck(self): """ 定时检查下载器中种子是否校验完成,校验完成且完整的自动开始辅种 """ - if not self.service_infos: - return if not self._recheck_torrents: return if self._is_recheck_running: return self._is_recheck_running = True + if not self.auto_service_info: + # 检查指定下载器 + self.check_recheck_service(self.auto_service_info) + self._is_recheck_running = False + return + if not self.service_infos: + return for service in self.service_infos.values(): # 需要检查的种子 - downloader = service.name - downloader_obj = service.instance - recheck_torrents = self._recheck_torrents.get(downloader) or [] - if not recheck_torrents: - continue - logger.info(f"开始检查下载器 {downloader} 的校验任务 ...") - # 获取下载器中的种子状态 - torrents, _ = downloader_obj.get_torrents(ids=recheck_torrents) - if torrents: - can_seeding_torrents = [] - for torrent in torrents: - # 获取种子hash - hash_str = self.__get_hash(torrent=torrent, dl_type=service.type) - if self.__can_seeding(torrent=torrent, dl_type=service.type): - can_seeding_torrents.append(hash_str) - if can_seeding_torrents: - logger.info(f"共 {len(can_seeding_torrents)} 个任务校验完成,开始辅种 ...") - # 开始任务 - downloader_obj.start_torrents(ids=can_seeding_torrents) - # 去除已经处理过的种子 - self._recheck_torrents[downloader] = list( - set(recheck_torrents).difference(set(can_seeding_torrents))) - elif torrents is None: - logger.info(f"下载器 {downloader} 查询校验任务失败,将在下次继续查询 ...") - continue - else: - logger.info(f"下载器 {downloader} 中没有需要检查的校验任务,清空待处理列表 ...") - self._recheck_torrents[downloader] = [] + self.check_recheck_service(service) self._is_recheck_running = False + def check_recheck_service(self, service: ServiceInfo): + """ + 检查指定下载器中种子是否校验完成,校验完成且完整的自动开始辅种 + """ + # 需要检查的种子 + downloader = service.name + downloader_obj = service.instance + recheck_torrents = self._recheck_torrents.get(downloader) or [] + if not recheck_torrents: + return + logger.info(f"开始检查下载器 {downloader} 的校验任务 ...") + # 获取下载器中的种子状态 + torrents, _ = downloader_obj.get_torrents(ids=recheck_torrents) + if torrents: + can_seeding_torrents = [] + for torrent in torrents: + # 获取种子hash + hash_str = self.__get_hash(torrent=torrent, dl_type=service.type) + if self.__can_seeding(torrent=torrent, dl_type=service.type): + can_seeding_torrents.append(hash_str) + if can_seeding_torrents: + logger.info(f"共 {len(can_seeding_torrents)} 个任务校验完成,开始辅种 ...") + # 开始任务 + downloader_obj.start_torrents(ids=can_seeding_torrents) + # 去除已经处理过的种子 + self._recheck_torrents[downloader] = list( + set(recheck_torrents).difference(set(can_seeding_torrents))) + elif torrents is None: + logger.info(f"下载器 {downloader} 查询校验任务失败,将在下次继续查询 ...") + return + else: + logger.info(f"下载器 {downloader} 中没有需要检查的校验任务,清空待处理列表 ...") + self._recheck_torrents[downloader] = [] + def __seed_torrents(self, hash_strs: list, service: ServiceInfo): """ 执行一批种子的辅种 @@ -770,9 +834,9 @@ class IYUUAutoSeed(_PluginBase): if seed.get("info_hash") in self._error_caches or seed.get("info_hash") in self._permanent_error_caches: logger.info(f"种子 {seed.get('info_hash')} 辅种失败且已缓存,跳过 ...") continue - # 添加任务 + # 添加任务 如果配置了主辅分离使用辅种下载器 success = self.__download_torrent(seed=seed, - service=service, + service=self.auto_service_info if self.auto_service_info else service, save_path=save_paths.get(current_hash)) if success: success_torrents.append(seed.get("info_hash")) From 176d4d599104c2f548d3e7130e54cc533acd0442 Mon Sep 17 00:00:00 2001 From: chenkun Date: Mon, 13 Jan 2025 17:33:28 +0800 Subject: [PATCH 4/7] =?UTF-8?q?fix:=20ui=E5=8F=AF=E4=BB=A5=E5=8F=96?= =?UTF-8?q?=E6=B6=88=E4=B8=BB=E8=BE=85=E4=B8=8B=E8=BD=BD=E5=99=A8=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=EF=BC=8C=E9=85=8D=E7=BD=AE=E5=90=8E=E5=BC=BA=E5=88=B6?= =?UTF-8?q?=E8=B5=B0=E8=BE=85=E7=A7=8D=E4=B8=8B=E8=BD=BD=E5=99=A8=E9=81=BF?= =?UTF-8?q?=E5=85=8D=E8=BE=85=E7=A7=8D=E4=B8=8B=E8=BD=BD=E4=B8=8D=E9=80=9A?= =?UTF-8?q?=E6=97=B6=E8=B5=B0=E9=BB=98=E8=AE=A4=E5=AF=BC=E8=87=B4=E9=87=8D?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins.v2/iyuuautoseed/__init__.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/plugins.v2/iyuuautoseed/__init__.py b/plugins.v2/iyuuautoseed/__init__.py index e5fedbc..ef3ab7b 100644 --- a/plugins.v2/iyuuautoseed/__init__.py +++ b/plugins.v2/iyuuautoseed/__init__.py @@ -186,7 +186,7 @@ class IYUUAutoSeed(_PluginBase): return active_services @property - def auto_service_info(self) -> Optional[Dict[str, ServiceInfo]]: + def auto_service_info(self) -> ServiceInfo | None: """ 服务信息 """ @@ -376,6 +376,8 @@ class IYUUAutoSeed(_PluginBase): { 'component': 'VSelect', 'props': { + 'chips': True, + 'clearable': True, 'model': 'auto_downloader', 'label': '主辅分离', 'items': [{"title": config.name, "value": config.name} @@ -835,9 +837,14 @@ class IYUUAutoSeed(_PluginBase): logger.info(f"种子 {seed.get('info_hash')} 辅种失败且已缓存,跳过 ...") continue # 添加任务 如果配置了主辅分离使用辅种下载器 - success = self.__download_torrent(seed=seed, - service=self.auto_service_info if self.auto_service_info else service, - save_path=save_paths.get(current_hash)) + if self._auto_downloader: + success = self.__download_torrent(seed=seed, + service=self.auto_service_info, + save_path=save_paths.get(current_hash)) + else: + success = self.__download_torrent(seed=seed, + service=service, + save_path=save_paths.get(current_hash)) if success: success_torrents.append(seed.get("info_hash")) @@ -1334,4 +1341,4 @@ class IYUUAutoSeed(_PluginBase): self._sites = sites # 保存配置 - self.__update_config() + self.__update_config() \ No newline at end of file From eeaa9bf9f7d773a4d626ea7f1ba4ab90c1cee8ca Mon Sep 17 00:00:00 2001 From: chenkun Date: Mon, 13 Jan 2025 17:34:48 +0800 Subject: [PATCH 5/7] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins.v2/iyuuautoseed/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins.v2/iyuuautoseed/__init__.py b/plugins.v2/iyuuautoseed/__init__.py index ef3ab7b..f8d54c3 100644 --- a/plugins.v2/iyuuautoseed/__init__.py +++ b/plugins.v2/iyuuautoseed/__init__.py @@ -33,7 +33,7 @@ class IYUUAutoSeed(_PluginBase): # 插件图标 plugin_icon = "IYUU.png" # 插件版本 - plugin_version = "2.6" + plugin_version = "2.7" # 插件作者 plugin_author = "jxxghp,ckun" # 作者主页 From 2797c97c6a705a79235a85ab0f94162b46376555 Mon Sep 17 00:00:00 2001 From: chenkun Date: Mon, 13 Jan 2025 17:37:57 +0800 Subject: [PATCH 6/7] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.v2.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.v2.json b/package.v2.json index b239f54..cc8b08e 100644 --- a/package.v2.json +++ b/package.v2.json @@ -213,7 +213,7 @@ "name": "IYUU自动辅种", "description": "基于IYUU官方Api实现自动辅种。", "labels": "做种,IYUU", - "version": "2.6", + "version": "2.7", "icon": "IYUU.png", "author": "jxxghp,ckun", "level": 2, From e9889b337e71c18eb6f6f3612d667f042260ec1f Mon Sep 17 00:00:00 2001 From: chenkun Date: Tue, 14 Jan 2025 09:30:36 +0800 Subject: [PATCH 7/7] =?UTF-8?q?fix:=20iyuu=E8=87=AA=E5=8A=A8=E8=BE=85?= =?UTF-8?q?=E7=A7=8D=E6=8F=92=E4=BB=B6=EF=BC=8Cv2.8=20=E4=B8=BA=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=BB=E8=BE=85=E5=88=86=E7=A6=BB=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E8=B5=B0=E8=BE=85=E7=A7=8D=E4=B8=8B=E8=BD=BD=E5=99=A8?= =?UTF-8?q?=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.v2.json | 3 ++- plugins.v2/iyuuautoseed/__init__.py | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package.v2.json b/package.v2.json index cc8b08e..cd7f33b 100644 --- a/package.v2.json +++ b/package.v2.json @@ -213,11 +213,12 @@ "name": "IYUU自动辅种", "description": "基于IYUU官方Api实现自动辅种。", "labels": "做种,IYUU", - "version": "2.7", + "version": "2.8", "icon": "IYUU.png", "author": "jxxghp,ckun", "level": 2, "history": { + "v2.8": "为配置主辅分离时,不走辅种下载器检查", "v2.7": "增加主辅分离配置,单独指定辅种下载器", "v2.6": "优化执行周期输入,需要MoviePilot v2.2.1+", "v2.5": "修复qb辅种结束后自动开始暂停的种子", diff --git a/plugins.v2/iyuuautoseed/__init__.py b/plugins.v2/iyuuautoseed/__init__.py index f8d54c3..7ee767b 100644 --- a/plugins.v2/iyuuautoseed/__init__.py +++ b/plugins.v2/iyuuautoseed/__init__.py @@ -33,7 +33,7 @@ class IYUUAutoSeed(_PluginBase): # 插件图标 plugin_icon = "IYUU.png" # 插件版本 - plugin_version = "2.7" + plugin_version = "2.8" # 插件作者 plugin_author = "jxxghp,ckun" # 作者主页 @@ -191,7 +191,7 @@ class IYUUAutoSeed(_PluginBase): 服务信息 """ if not self._auto_downloader: - logger.warning("尚未配置主辅分离下载器,请检查配置") + logger.info("尚未配置主辅分离下载器,辅种不分离") return None service = self.downloader_helper.get_service(name=self._auto_downloader) @@ -688,7 +688,7 @@ class IYUUAutoSeed(_PluginBase): else: logger.info(f"没有需要辅种的种子") # 指定主辅分离时只检查辅种下载器 - if not self.auto_service_info: + if self.auto_service_info: self.start_service_torrents(self.auto_service_info) else: # qb 中,辅种结束后,一起开始所有辅种后暂停的种子(排除了出错的种子),及时人工确认也是手动开始这部分种子 @@ -739,7 +739,7 @@ class IYUUAutoSeed(_PluginBase): if self._is_recheck_running: return self._is_recheck_running = True - if not self.auto_service_info: + if self.auto_service_info: # 检查指定下载器 self.check_recheck_service(self.auto_service_info) self._is_recheck_running = False