fix: 第一次人机验证失败后,验证链接无法支持更新 (#180)

* fix: 第一次人机验证失败后,验证链接无法支持更新

* Update utils.py
This commit is contained in:
Night-stars-1 2023-11-20 18:53:27 +08:00 committed by GitHub
parent 61f7ca9ae5
commit 2fcff50a6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -216,10 +216,10 @@ async def get_token(uid: str) -> str:
elif api_data.need_verify: elif api_data.need_verify:
log.error("遇到人机验证码, 尝试调用解决方案") log.error("遇到人机验证码, 尝试调用解决方案")
url = api_data.data.get("url") url = api_data.data.get("url")
for _ in range(3): if toekn := await get_token_by_captcha(url):
if toekn := await get_token_by_captcha(url): return toekn
return toekn else:
return False raise ValueError("人机验证失败")
else: else:
log.error("遇到未知错误无法获取TOKEN") log.error("遇到未知错误无法获取TOKEN")
return False return False