mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 07:07:46 +00:00
🐛 Fix refresh cookies when user request
This commit is contained in:
parent
e146ca5c16
commit
e356549419
@ -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) -> GenshinClient:
|
||||
player = await self.players_service.get_player(user_id, region)
|
||||
|
Loading…
Reference in New Issue
Block a user