This commit is contained in:
caiwx86 2022-12-17 17:03:49 +08:00
parent a350d640ec
commit 9ad8a5f9cd

View File

@ -36,7 +36,7 @@ class htmlUtils:
else: else:
url_text = html.fromstring(res.text) url_text = html.fromstring(res.text)
except: except:
ntfy.sendMsg(f'Retry! 第{count}') print(f'Retry! 第{count}')
time.sleep(3) time.sleep(3)
traceback.print_exc() traceback.print_exc()
count += 1 count += 1
@ -64,11 +64,12 @@ class htmlUtils:
data_json = res.json() data_json = res.json()
return data_json return data_json
except: except:
ntfy.sendMsg(f"请求失败,重试中... {curl}") print(f"请求失败,重试中... {curl}")
count += 1 count += 1
time.sleep(1) time.sleep(1)
cls.getJSON(curl) cls.getJSON(curl)
else: else:
ntfy.sendMsg(f"重试请求失败... {curl}, 已退出")
exit() exit()
@classmethod @classmethod