mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 18:04:10 +00:00
🎨 Use simnet.Cookies
to parse cookies
This commit is contained in:
parent
e9992969fa
commit
aa9ddfc267
@ -1,6 +1,7 @@
|
|||||||
from typing import Tuple, Optional
|
from typing import Tuple, Optional
|
||||||
|
|
||||||
from simnet import Region
|
from simnet import Region
|
||||||
|
from simnet.client.cookies import Cookies
|
||||||
from simnet.errors import BadRequest as SIMNetBadRequest
|
from simnet.errors import BadRequest as SIMNetBadRequest
|
||||||
|
|
||||||
from core.basemodel import RegionEnum
|
from core.basemodel import RegionEnum
|
||||||
@ -102,7 +103,7 @@ class ChallengeSystem(Plugin):
|
|||||||
_, challenge = await self.get_challenge(player.player_id)
|
_, challenge = await self.get_challenge(player.player_id)
|
||||||
if challenge is None:
|
if challenge is None:
|
||||||
raise ChallengeSystemException("验证失效 请求已经过期")
|
raise ChallengeSystemException("验证失效 请求已经过期")
|
||||||
verify = Verify(cookies=cookie_model.data)
|
verify = Verify(cookies=Cookies(cookie_model.data))
|
||||||
try:
|
try:
|
||||||
await verify.verify(challenge=challenge, validate=validate)
|
await verify.verify(challenge=challenge, validate=validate)
|
||||||
except ResponseException as exc:
|
except ResponseException as exc:
|
||||||
|
Loading…
Reference in New Issue
Block a user