From c9d85e774a7b1312bdcb81b7c29c75390c42e66a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Mon, 27 Mar 2023 10:42:59 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Use=20`getUserGameRolesByCookie`?= =?UTF-8?q?=20to=20check=20whether=20the=20cookies=20have=20expired?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/services/cookies/services.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/services/cookies/services.py b/core/services/cookies/services.py index 237b039b..ff0fc230 100644 --- a/core/services/cookies/services.py +++ b/core/services/cookies/services.py @@ -96,9 +96,7 @@ class PublicCookiesService(BaseService): try: if client.cookie_manager.user_id is None: raise RuntimeError("account_id not found") - record_card = (await client.get_record_cards())[0] - if record_card.game == Game.GENSHIN and region == RegionEnum.HYPERION: - await client.get_partial_genshin_user(record_card.uid) + await client.genshin_accounts() except InvalidCookies as exc: if exc.retcode in (10001, -100): logger.warning("用户 [%s] Cookies无效", public_id)