mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-17 18:30:43 +08:00
🐛 修复 aria2 插件 UA 使用问题
This commit is contained in:
parent
a632d36ba2
commit
237a8c23ef
@ -51,7 +51,7 @@ class Aria2:
|
|||||||
{
|
{
|
||||||
"header": [
|
"header": [
|
||||||
f"Cookie: {cookie}",
|
f"Cookie: {cookie}",
|
||||||
f"User-Agent: {account.common_headers().get('user-agent')}",
|
f"User-Agent: {account.USER_AGENT}",
|
||||||
],
|
],
|
||||||
"out": os.path.basename(save_path),
|
"out": os.path.basename(save_path),
|
||||||
"dir": os.path.dirname(save_path),
|
"dir": os.path.dirname(save_path),
|
||||||
|
|||||||
@ -151,6 +151,7 @@ class Config:
|
|||||||
class Quark:
|
class Quark:
|
||||||
BASE_URL = "https://drive-pc.quark.cn"
|
BASE_URL = "https://drive-pc.quark.cn"
|
||||||
BASE_URL_APP = "https://drive-m.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):
|
def __init__(self, cookie, index=None):
|
||||||
self.cookie = cookie.strip()
|
self.cookie = cookie.strip()
|
||||||
@ -177,7 +178,7 @@ class Quark:
|
|||||||
headers = {
|
headers = {
|
||||||
"cookie": self.cookie,
|
"cookie": self.cookie,
|
||||||
"content-type": "application/json",
|
"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:
|
if "headers" in kwargs:
|
||||||
headers = kwargs["headers"]
|
headers = kwargs["headers"]
|
||||||
@ -263,7 +264,6 @@ class Quark:
|
|||||||
response = self._send_request(
|
response = self._send_request(
|
||||||
"POST", url, json=payload, params=querystring
|
"POST", url, json=payload, params=querystring
|
||||||
).json()
|
).json()
|
||||||
print(response)
|
|
||||||
if response.get("status") == 200:
|
if response.get("status") == 200:
|
||||||
return True, response["data"]["stoken"]
|
return True, response["data"]["stoken"]
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user