mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2025-02-07 18:58:54 +00:00
🐛 Fix gen gt
This commit is contained in:
parent
cd2a426365
commit
08f2e636ef
@ -171,7 +171,7 @@ class Sign(Plugin, BasePlugin):
|
||||
@staticmethod
|
||||
async def gen_challenge_header(uid: int, validate: str) -> Optional[Dict]:
|
||||
challenge = await SignRedis.get(uid)
|
||||
if not challenge:
|
||||
if not challenge or not validate:
|
||||
return
|
||||
return {
|
||||
"x-rpc-challenge": challenge.decode("utf-8"),
|
||||
@ -213,14 +213,6 @@ class Sign(Plugin, BasePlugin):
|
||||
request_daily_reward.get("gt", ""),
|
||||
request_daily_reward.get("challenge", ""),
|
||||
)
|
||||
if not headers:
|
||||
button = await Sign.gen_challenge_button(
|
||||
client.uid,
|
||||
request_daily_reward.get("gt", ""),
|
||||
request_daily_reward.get("challenge", ""),
|
||||
)
|
||||
logger.warning(f"UID {client.uid} 签到失败,触发验证码风控")
|
||||
return f"UID {client.uid} 签到失败,触发验证码风控,请尝试重新签到。", button
|
||||
request_daily_reward = await client.request_daily_reward(
|
||||
"sign",
|
||||
method="POST",
|
||||
|
@ -48,7 +48,7 @@ class StartPlugin(Plugin):
|
||||
with contextlib.suppress(UserNotFoundError, CookiesNotFoundError):
|
||||
client = await get_genshin_client(update.effective_user.id)
|
||||
await update.effective_message.reply_chat_action(ChatAction.TYPING)
|
||||
headers = await Sign.gen_challenge_header(update.effective_user.id, validate)
|
||||
headers = await Sign.gen_challenge_header(client.uid, validate)
|
||||
if not headers:
|
||||
await update.effective_message.reply_text("验证请求已过期。", allow_sending_without_reply=True)
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user