增加重试消息

This commit is contained in:
Womsxd 2022-08-19 08:54:30 +08:00
parent 5299918ed9
commit 05db8967b9
No known key found for this signature in database
GPG Key ID: 0FE76418EE689B68

View File

@ -45,11 +45,12 @@ class Genshin:
return data["data"] return data["data"]
def check_in(self, account): def check_in(self, account):
for i in range(3): for i in range(4):
req = http.post(url=setting.genshin_Signurl, headers=self.headers, req = http.post(url=setting.genshin_Signurl, headers=self.headers,
json={'act_id': setting.genshin_Act_id, 'region': account[2], 'uid': account[1]}) json={'act_id': setting.genshin_Act_id, 'region': account[2], 'uid': account[1]})
data = req.json() data = req.json()
if data["retcode"] == 0 and data["data"]["success"] == 1: if data["retcode"] == 0 and data["data"]["success"] == 1:
log.info(f'触发验证码,即将进行第{i+1}次重试最多3次')
time.sleep(random.randint(4, 10)) time.sleep(random.randint(4, 10))
else: else:
break break