Fix Mapping Table Download FAILED

This commit is contained in:
yoshiko2
2022-05-26 23:43:11 +08:00
parent 529aeaddd2
commit bb6ff56ce5
2 changed files with 5 additions and 1 deletions

View File

@@ -523,7 +523,10 @@ def download_one_file(args) -> str:
""" """
(url, save_path, json_data) = args (url, save_path, json_data) = args
filebytes = get_html(url, return_type='content', json_headers=json_data['headers']) if json_data != None:
filebytes = get_html(url, return_type='content', json_headers=json_data['headers'])
else:
filebytes = get_html(url, return_type='content')
if isinstance(filebytes, bytes) and len(filebytes): if isinstance(filebytes, bytes) and len(filebytes):
with save_path.open('wb') as fpbyte: with save_path.open('wb') as fpbyte:
if len(filebytes) == fpbyte.write(filebytes): if len(filebytes) == fpbyte.write(filebytes):

View File

@@ -591,6 +591,7 @@ def main(args: tuple) -> Path:
print("[!] " + "Mapping Table Download FAILED".center(47)) print("[!] " + "Mapping Table Download FAILED".center(47))
print("[!] " + "无法连接github".center(47)) print("[!] " + "无法连接github".center(47))
print("[!] " + "请过几小时再试试".center(47)) print("[!] " + "请过几小时再试试".center(47))
print("[!]", e)
print("[-] " + "------ AUTO EXIT AFTER 30s !!! ------ ".center(47)) print("[-] " + "------ AUTO EXIT AFTER 30s !!! ------ ".center(47))
time.sleep(30) time.sleep(30)
os._exit(-1) os._exit(-1)