From 2fcff50a6a88766c9c8f76d0b9e0be90a8c5213c Mon Sep 17 00:00:00 2001 From: Night-stars-1 <99261160+Night-stars-1@users.noreply.github.com> Date: Mon, 20 Nov 2023 18:53:27 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=AC=AC=E4=B8=80=E6=AC=A1=E4=BA=BA?= =?UTF-8?q?=E6=9C=BA=E9=AA=8C=E8=AF=81=E5=A4=B1=E8=B4=A5=E5=90=8E=EF=BC=8C?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E9=93=BE=E6=8E=A5=E6=97=A0=E6=B3=95=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=9B=B4=E6=96=B0=20(#180)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 第一次人机验证失败后,验证链接无法支持更新 * Update utils.py --- utils/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/utils.py b/utils/utils.py index 157378b..3bdf696 100644 --- a/utils/utils.py +++ b/utils/utils.py @@ -216,10 +216,10 @@ async def get_token(uid: str) -> str: elif api_data.need_verify: log.error("遇到人机验证码, 尝试调用解决方案") url = api_data.data.get("url") - for _ in range(3): - if toekn := await get_token_by_captcha(url): - return toekn - return False + if toekn := await get_token_by_captcha(url): + return toekn + else: + raise ValueError("人机验证失败") else: log.error("遇到未知错误,无法获取TOKEN") return False