From 06195cca5ff55fd08a3fa218a384450bad5d47ae Mon Sep 17 00:00:00 2001 From: omg-xtao <100690902+omg-xtao@users.noreply.github.com> Date: Sun, 17 Dec 2023 23:44:41 +0800 Subject: [PATCH] :bug: Avoid refresh cookies when LabAccountNotFound --- plugins/tools/genshin.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/tools/genshin.py b/plugins/tools/genshin.py index 9575fdbc..767e7de1 100644 --- a/plugins/tools/genshin.py +++ b/plugins/tools/genshin.py @@ -256,6 +256,8 @@ class GenshinHelper(Plugin): try: yield client except InvalidCookies as exc: + if exc.retcode == 10103: + raise exc refresh = False cookie_model.status = CookiesStatusEnum.INVALID_COOKIES stoken = client.cookies.get("stoken") @@ -268,6 +270,8 @@ class GenshinHelper(Plugin): logger.success("用户 %s 刷新 ltoken 成功", user_id) cookie_model.data = new_cookies 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: logger.info("用户 user_id[%s] Cookies 已经过期", cookie_model.user_id) except SimnetBadRequest as _exc: