🎨 Use getUserGameRolesByCookie to check whether the cookies have expired

This commit is contained in:
洛水居室 2023-03-27 10:42:59 +08:00
parent 74f18e798e
commit c9d85e774a
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -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)