Compare commits

..

No commits in common. "f1cf1f0eb834d4aad9d0000000dda36126e949ec" and "47d05dc37bd3e880bb2449960da0482b1359bca4" have entirely different histories.

2 changed files with 7 additions and 13 deletions

View File

@ -524,16 +524,11 @@
changeShareurl(task) {
if (!task.shareurl)
return;
this.$set(task, "shareurl_ban", undefined);
// 从URL中提取任务名
try {
const matches = decodeURIComponent(task.shareurl).match(/\/(\w{32})-([^\/]+)$/);
if (matches) {
task.taskname = task.taskname == "" ? matches[2] : task.taskname;
task.savepath = task.savepath.replace(/TASKNAME/g, matches[2]);
}
} catch (e) {
console.error("Error decodeURIComponent:", e);
const matches = decodeURIComponent(task.shareurl).match(/\/(\w{32})-([^\/]+)$/);
if (matches) {
task.taskname = task.taskname == "" ? matches[2] : task.taskname;
task.savepath = task.savepath.replace(/TASKNAME/g, matches[2]);
}
// 从分享中提取任务名
axios.get('/get_share_detail', { params: { shareurl: task.shareurl } })

View File

@ -185,13 +185,13 @@ class Quark:
try:
response = requests.request(method, url, headers=headers, **kwargs)
# print(f"{response.text}")
# response.raise_for_status() # 检查请求是否成功但返回非200也会抛出异常
response.raise_for_status() # 检查请求是否成功
return response
except Exception as e:
print(f"_send_request error:\n{e}")
fake_response = requests.Response()
fake_response.status_code = 500
fake_response._content = b'{"status": 500, "message": "request error"}'
fake_response._content = b'{"error": 1}'
return fake_response
def init(self):
@ -263,7 +263,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:
@ -382,7 +381,7 @@ class Quark:
"__dt": int(random.uniform(1, 5) * 60 * 1000),
"__t": datetime.now().timestamp(),
}
response = self._send_request("GET", url, params=querystring).json()
response = requests.request("GET", url, params=querystring).json()
if response["data"]["status"] != 0:
if retry_index > 0:
print()