From 82437582fe8f37c32a5d7fc884edecf4f213f1b6 Mon Sep 17 00:00:00 2001 From: xiaoQQya Date: Sun, 31 Aug 2025 19:43:32 +0800 Subject: [PATCH 1/6] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E5=8F=91=E5=B8=83=E6=97=B6=E9=97=B4=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/sdk/common.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/sdk/common.py b/app/sdk/common.py index 068890c..46d0150 100644 --- a/app/sdk/common.py +++ b/app/sdk/common.py @@ -11,5 +11,6 @@ def iso_to_cst(iso_time_str: str) -> str: str: CST(China Standard Time) 时间字符串 """ dt = datetime.fromisoformat(iso_time_str) - dt_cst = dt.astimezone(timezone(timedelta(hours=8))) + tz = timezone(timedelta(hours=8)) + dt_cst = dt if dt.astimezone(tz) > datetime.now(tz) else dt.astimezone(tz) return dt_cst.strftime("%Y-%m-%d %H:%M:%S") if dt_cst.year >= 1970 else "" From 1162a5fdebb67005f44da7560067d8eaaa0ccbf5 Mon Sep 17 00:00:00 2001 From: xiaoQQya Date: Sun, 31 Aug 2025 20:25:45 +0800 Subject: [PATCH 2/6] =?UTF-8?q?perf:=20PanSou=20=E6=BA=90=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=89=8D=E7=AB=AF=E6=B7=B1=E5=BA=A6=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/run.py | 2 +- app/sdk/pansou.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/run.py b/app/run.py index 2c4a3d3..c1fa4c8 100644 --- a/app/run.py +++ b/app/run.py @@ -268,7 +268,7 @@ def get_task_suggestions(): def ps_search(): if (ps_data.get("server")): ps = PanSou(ps_data.get("server")) - return ps.search(query) + return ps.search(query, deep == "1") return [] try: diff --git a/app/sdk/pansou.py b/app/sdk/pansou.py index 5c30893..12d865d 100644 --- a/app/sdk/pansou.py +++ b/app/sdk/pansou.py @@ -14,7 +14,7 @@ class PanSou: self.server = server self.session = requests.Session() - def search(self, keyword: str) -> list: + def search(self, keyword: str, refresh: bool = False) -> list: """搜索资源 Args: @@ -25,7 +25,7 @@ class PanSou: """ try: url = f"{self.server.rstrip('/')}/api/search" - params = {"kw": keyword, "cloud_types": ["quark"], "res": "merge", "refresh": True} + params = {"kw": keyword, "cloud_types": ["quark"], "res": "merge", "refresh": refresh} response = self.session.get(url, params=params) result = response.json() if result.get("code") == 0: From 4f448e44b0b40de0ac9a145ee47c271774a33d97 Mon Sep 17 00:00:00 2001 From: xiaoQQya Date: Sun, 31 Aug 2025 20:44:16 +0800 Subject: [PATCH 3/6] =?UTF-8?q?feat:=20=E7=BD=91=E7=BB=9C=E5=85=AC?= =?UTF-8?q?=E5=BC=80=E6=90=9C=E7=B4=A2=E6=BA=90=E6=94=AF=E6=8C=81=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E6=88=96=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/run.py | 11 +++++++---- app/templates/index.html | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/app/run.py b/app/run.py index c1fa4c8..2518a21 100644 --- a/app/run.py +++ b/app/run.py @@ -235,14 +235,17 @@ def get_task_suggestions(): return jsonify({"success": False, "message": "未登录"}) query = request.args.get("q", "").lower() deep = request.args.get("d", "").lower() + net_data = config_data.get("source", {}).get("net", {}) cs_data = config_data.get("source", {}).get("cloudsaver", {}) ps_data = config_data.get("source", {}).get("pansou", {}) def net_search(): - base_url = base64.b64decode("aHR0cHM6Ly9zLjkxNzc4OC54eXo=").decode() - url = f"{base_url}/task_suggestions?q={query}&d={deep}" - response = requests.get(url) - return response.json() + if net_data.get("enable").lower() != "false": + base_url = base64.b64decode("aHR0cHM6Ly9zLjkxNzc4OC54eXo=").decode() + url = f"{base_url}/task_suggestions?q={query}&d={deep}" + response = requests.get(url) + return response.json() + return [] def cs_search(): if ( diff --git a/app/templates/index.html b/app/templates/index.html index a735fcd..498a555 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -196,6 +196,18 @@ +
+
+

网络公开

+
+
+
+ +
+ +
+
+

CloudSaver

@@ -555,6 +567,9 @@ tasklist: [], magic_regex: {}, source: { + net: { + enable: "" + }, cloudsaver: { server: "", username: "", @@ -702,6 +717,11 @@ server: "" }; } + if (!config_data.source.net) { + config_data.source.net = { + enable: "" + }; + } this.formData = config_data; setTimeout(() => { this.configModified = false; From 2c3363c38d6f1f2f5c086bd400da46ec20243735 Mon Sep 17 00:00:00 2001 From: xiaoQQya Date: Sun, 31 Aug 2025 22:06:25 +0800 Subject: [PATCH 4/6] =?UTF-8?q?feat:=20=E6=96=87=E4=BB=B6=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E7=AA=97=E5=8F=A3=E6=94=AF=E6=8C=81=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/templates/index.html | 48 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/app/templates/index.html b/app/templates/index.html index 498a555..dede19a 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -337,7 +337,7 @@
- +
@@ -362,7 +362,7 @@
- +
@@ -383,7 +383,7 @@
- +
@@ -480,6 +480,25 @@