🐛 Avoid refresh cookies when LabAccountNotFound

This commit is contained in:
omg-xtao 2023-12-17 23:44:41 +08:00 committed by GitHub
parent b36e515076
commit 06195cca5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -256,6 +256,8 @@ class GenshinHelper(Plugin):
try: try:
yield client yield client
except InvalidCookies as exc: except InvalidCookies as exc:
if exc.retcode == 10103:
raise exc
refresh = False refresh = False
cookie_model.status = CookiesStatusEnum.INVALID_COOKIES cookie_model.status = CookiesStatusEnum.INVALID_COOKIES
stoken = client.cookies.get("stoken") stoken = client.cookies.get("stoken")
@ -268,6 +270,8 @@ class GenshinHelper(Plugin):
logger.success("用户 %s 刷新 ltoken 成功", user_id) logger.success("用户 %s 刷新 ltoken 成功", user_id)
cookie_model.data = new_cookies cookie_model.data = new_cookies
cookie_model.status = CookiesStatusEnum.STATUS_SUCCESS cookie_model.status = CookiesStatusEnum.STATUS_SUCCESS
except ValueError as _exc:
logger.info("用户 user_id[%s] Cookies 不完整 [%s]", cookie_model.user_id, str(_exc))
except InvalidCookies: except InvalidCookies:
logger.info("用户 user_id[%s] Cookies 已经过期", cookie_model.user_id) logger.info("用户 user_id[%s] Cookies 已经过期", cookie_model.user_id)
except SimnetBadRequest as _exc: except SimnetBadRequest as _exc: