From 95f687a903e049ea0c41992ed1adeb9d2363e7a2 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Mon, 1 Jan 2024 20:03:44 +0800 Subject: [PATCH] fix BrushFlow --- package.json | 2 +- plugins/brushflow/__init__.py | 54 +++++++++++++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index db0363b..8a243b6 100644 --- a/package.json +++ b/package.json @@ -210,7 +210,7 @@ "BrushFlow": { "name": "站点刷流", "description": "自动托管刷流,将会提高对应站点的访问频率。", - "version": "1.0", + "version": "1.1", "icon": "brush.jpg", "author": "jxxghp", "level": 2 diff --git a/plugins/brushflow/__init__.py b/plugins/brushflow/__init__.py index 8859ee7..44a0c51 100644 --- a/plugins/brushflow/__init__.py +++ b/plugins/brushflow/__init__.py @@ -31,7 +31,7 @@ class BrushFlow(_PluginBase): # 插件图标 plugin_icon = "brush.jpg" # 插件版本 - plugin_version = "1.0" + plugin_version = "1.1" # 插件作者 plugin_author = "jxxghp" # 作者主页 @@ -64,6 +64,7 @@ class BrushFlow(_PluginBase): _downloader = "qbittorrent" _disksize = 0 _freeleech = "free" + _hr = "no" _maxupspeed = 0 _maxdlspeed = 0 _maxdlcount = 0 @@ -96,6 +97,7 @@ class BrushFlow(_PluginBase): self._downloader = config.get("downloader") self._disksize = config.get("disksize") self._freeleech = config.get("freeleech") + self._hr = config.get("hr") self._maxupspeed = config.get("maxupspeed") self._maxdlspeed = config.get("maxdlspeed") self._maxdlcount = config.get("maxdlcount") @@ -411,6 +413,26 @@ class BrushFlow(_PluginBase): } ] }, + { + 'component': 'VCol', + 'props': { + "cols": 12, + "md": 4 + }, + 'content': [ + { + 'component': 'VSelect', + 'props': { + 'model': 'hr', + 'label': '排除H&R', + 'items': [ + {'title': '是', 'value': 'yes'}, + {'title': '否', 'value': 'no'}, + ] + } + } + ] + }, { 'component': 'VCol', 'props': { @@ -732,7 +754,28 @@ class BrushFlow(_PluginBase): ] } ] - } + }, + { + 'component': 'VRow', + 'content': [ + { + 'component': 'VCol', + 'props': { + 'cols': 12, + }, + 'content': [ + { + 'component': 'VAlert', + 'props': { + 'type': 'info', + 'variant': 'tonal', + 'text': '注意:排除H&R并不保证能完全适配所有站点(部分站点在列表页不显示H&R标志,但实际上是有H&R的),请注意核对使用!' + } + } + ] + } + ] + } ] } ], { @@ -740,7 +783,8 @@ class BrushFlow(_PluginBase): "notify": True, "onlyonce": False, "clear_task": False, - "freeleech": "free" + "freeleech": "free", + "hr": "yes", } def get_page(self) -> List[dict]: @@ -1215,6 +1259,7 @@ class BrushFlow(_PluginBase): "downloader": self._downloader, "disksize": self._disksize, "freeleech": self._freeleech, + "hr": self._hr, "maxupspeed": self._maxupspeed, "maxdlspeed": self._maxdlspeed, "maxdlcount": self._maxdlcount, @@ -1284,6 +1329,9 @@ class BrushFlow(_PluginBase): continue if self._freeleech == "2xfree" and torrent.uploadvolumefactor != 2: continue + # H&R + if self._hr == "yes" and torrent.hit_and_run: + continue # 包含规则 if self._include and not re.search(r"%s" % self._include, torrent.title, re.I): continue