From 7472a962829e99312f483760fc9f8aaaf2e76d75 Mon Sep 17 00:00:00 2001 From: Cp0204 Date: Fri, 6 Dec 2024 09:55:46 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=20aria2=20?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=20UA=20=E4=BD=BF=E7=94=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/aria2.py | 2 +- quark_auto_save.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/aria2.py b/plugins/aria2.py index 6dbfae0..5910cb7 100644 --- a/plugins/aria2.py +++ b/plugins/aria2.py @@ -51,7 +51,7 @@ class Aria2: { "header": [ f"Cookie: {cookie}", - f"User-Agent: {account.common_headers().get('user-agent')}", + f"User-Agent: {account.USER_AGENT}", ], "out": os.path.basename(save_path), "dir": os.path.dirname(save_path), diff --git a/quark_auto_save.py b/quark_auto_save.py index 3167452..ff13120 100644 --- a/quark_auto_save.py +++ b/quark_auto_save.py @@ -151,6 +151,7 @@ class Config: class Quark: BASE_URL = "https://drive-pc.quark.cn" BASE_URL_APP = "https://drive-m.quark.cn" + USER_AGENT = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) quark-cloud-drive/3.14.2 Chrome/112.0.5615.165 Electron/24.1.3.8 Safari/537.36 Channel/pckk_other_ch" def __init__(self, cookie, index=None): self.cookie = cookie.strip() @@ -177,7 +178,7 @@ class Quark: headers = { "cookie": self.cookie, "content-type": "application/json", - "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) quark-cloud-drive/3.14.2 Chrome/112.0.5615.165 Electron/24.1.3.8 Safari/537.36 Channel/pckk_other_ch", + "user-agent": self.USER_AGENT, } if "headers" in kwargs: headers = kwargs["headers"] @@ -263,7 +264,6 @@ class Quark: response = self._send_request( "POST", url, json=payload, params=querystring ).json() - print(response) if response.get("status") == 200: return True, response["data"]["stoken"] else: