mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-16 03:55:26 +00:00
🐛 Fix refresh cookies when user request
This commit is contained in:
parent
3aa104c073
commit
a45e6023fa
@ -255,11 +255,6 @@ class GenshinHelper(Plugin):
|
||||
) as client:
|
||||
try:
|
||||
yield client
|
||||
except SimnetBadRequest as exc:
|
||||
if exc.ret_code == 1034 and devices is not None:
|
||||
devices.is_valid = False
|
||||
await self.devices_service.update(devices)
|
||||
raise exc
|
||||
except InvalidCookies as exc:
|
||||
refresh = False
|
||||
cookie_model.status = CookiesStatusEnum.INVALID_COOKIES
|
||||
@ -299,6 +294,11 @@ class GenshinHelper(Plugin):
|
||||
if refresh:
|
||||
raise CookieException(message="The cookie has been refreshed.") from exc
|
||||
raise exc
|
||||
except SimnetBadRequest as exc:
|
||||
if exc.ret_code == 1034 and devices is not None:
|
||||
devices.is_valid = False
|
||||
await self.devices_service.update(devices)
|
||||
raise exc
|
||||
|
||||
async def get_genshin_client(self, user_id: int, region: Optional[RegionEnum] = None) -> StarRailClient:
|
||||
player = await self.players_service.get_player(user_id, region)
|
||||
|
Loading…
Reference in New Issue
Block a user