From 5cc955f590ab9abc5ea43164378b66b5e0e821d5 Mon Sep 17 00:00:00 2001 From: Cp0204 Date: Fri, 5 Sep 2025 16:18:30 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E9=80=82=E9=85=8D=E5=AE=98?= =?UTF-8?q?=E6=96=B9=E6=96=B0=E7=9A=84=E5=88=86=E4=BA=AB=E5=AD=90=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E9=93=BE=E6=8E=A5=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/run.py | 9 +++++++-- app/templates/index.html | 4 ++-- quark_auto_save.py | 9 +++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/app/run.py b/app/run.py index 7333f2e..ef2690a 100644 --- a/app/run.py +++ b/app/run.py @@ -323,7 +323,9 @@ def get_share_detail(): return jsonify( {"success": False, "data": {"error": get_stoken.get("message")}} ) - share_detail = account.get_detail(pwd_id, stoken, pdir_fid, _fetch_share=1) + share_detail = account.get_detail( + pwd_id, stoken, pdir_fid, _fetch_share=1, fetch_share_full_path=1 + ) if share_detail.get("code") != 0: return jsonify( @@ -331,7 +333,10 @@ def get_share_detail(): ) data = share_detail["data"] - data["paths"] = paths + data["paths"] = [ + {"fid": i["fid"], "name": i["file_name"]} + for i in share_detail["data"].get("full_path", []) + ] or paths data["stoken"] = stoken # 正则处理预览 diff --git a/app/templates/index.html b/app/templates/index.html index 77b93cc..8a0d458 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -1220,9 +1220,9 @@ } else if (shareurl.includes(dir.fid)) { shareurl = shareurl.match(`.*/${dir.fid}[^/]*`)[0] } else if (shareurl.includes('#/list/share')) { - shareurl = `${shareurl}/${dir.fid}-${dir.name?.replace('-', '*101')}` + shareurl = `${shareurl.split('#')[0]}#/list/share/${dir.fid}` } else { - shareurl = `${shareurl}#/list/share/${dir.fid}-${dir.name?.replace('-', '*101')}` + shareurl = `${shareurl.split('#')[0]}#/list/share/${dir.fid}` } return shareurl; }, diff --git a/quark_auto_save.py b/quark_auto_save.py index 0d5ea20..6f22c94 100644 --- a/quark_auto_save.py +++ b/quark_auto_save.py @@ -1,6 +1,6 @@ # !/usr/bin/env python3 # -*- coding: utf-8 -*- -# Modify: 2024-11-13 +# Modify: 2025-09-05 # Repo: https://github.com/Cp0204/quark_auto_save # ConfigFile: quark_config.json """ @@ -497,7 +497,9 @@ class Quark: ).json() return response - def get_detail(self, pwd_id, stoken, pdir_fid, _fetch_share=0): + def get_detail( + self, pwd_id, stoken, pdir_fid, _fetch_share=0, fetch_share_full_path=0 + ): list_merge = [] page = 1 while True: @@ -515,6 +517,8 @@ class Quark: "_fetch_share": _fetch_share, "_fetch_total": "1", "_sort": "file_type:asc,updated_at:desc", + "ver": "2", + "fetch_share_full_path": fetch_share_full_path, } response = self._send_request("GET", url, params=querystring).json() if response["code"] != 0: @@ -709,6 +713,7 @@ class Quark: match_pwd = re.search(r"pwd=(\w+)", url) passcode = match_pwd.group(1) if match_pwd else "" # path: fid-name + # Legacy 20250905 paths = [] matches = re.findall(r"/(\w{32})-?([^/]+)?", url) for match in matches: