mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-15 17:00:43 +08:00
修复超50任务fid超限
This commit is contained in:
parent
ef48a6eeca
commit
8c3603bcad
@ -182,14 +182,24 @@ def get_detail(pwd_id, stoken, pdir_fid):
|
|||||||
|
|
||||||
|
|
||||||
def get_fids(file_paths):
|
def get_fids(file_paths):
|
||||||
url = "https://drive.quark.cn/1/clouddrive/file/info/path_list"
|
fids = []
|
||||||
querystring = {"pr": "ucpro", "fr": "pc"}
|
while True:
|
||||||
payload = {"file_path": file_paths, "namespace": "0"}
|
url = "https://drive.quark.cn/1/clouddrive/file/info/path_list"
|
||||||
headers = common_headers()
|
querystring = {"pr": "ucpro", "fr": "pc"}
|
||||||
response = requests.request(
|
payload = {"file_path": file_paths[:50], "namespace": "0"}
|
||||||
"POST", url, json=payload, headers=headers, params=querystring
|
headers = common_headers()
|
||||||
).json()
|
response = requests.request(
|
||||||
return response
|
"POST", url, json=payload, headers=headers, params=querystring
|
||||||
|
).json()
|
||||||
|
if(response["code"] == 0):
|
||||||
|
fids += response["data"]
|
||||||
|
file_paths = file_paths[50:]
|
||||||
|
else:
|
||||||
|
print(f"获取目录ID:失败, {response["message"]}")
|
||||||
|
break
|
||||||
|
if(len(file_paths) == 0):
|
||||||
|
break
|
||||||
|
return fids
|
||||||
|
|
||||||
|
|
||||||
def ls_dir(pdir_fid):
|
def ls_dir(pdir_fid):
|
||||||
@ -286,11 +296,7 @@ def update_savepath_fid(tasklist):
|
|||||||
]
|
]
|
||||||
if not dir_paths:
|
if not dir_paths:
|
||||||
return False
|
return False
|
||||||
get_fids_return = get_fids(dir_paths)
|
dir_paths_exist_arr = get_fids(dir_paths)
|
||||||
if(get_fids_return["code"] != 0):
|
|
||||||
print(f"获取目录ID:失败, {get_fids_return["message"]}")
|
|
||||||
return False
|
|
||||||
dir_paths_exist_arr = get_fids_return["data"]
|
|
||||||
dir_paths_exist = [item["file_path"] for item in dir_paths_exist_arr]
|
dir_paths_exist = [item["file_path"] for item in dir_paths_exist_arr]
|
||||||
# 比较创建不存在的
|
# 比较创建不存在的
|
||||||
dir_paths_unexist = list(set(dir_paths) - set(dir_paths_exist))
|
dir_paths_unexist = list(set(dir_paths) - set(dir_paths_exist))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user