🎨 Update sign-in log

This commit is contained in:
洛水居室 2022-11-19 16:15:30 +08:00
parent 304eb5e740
commit a3f3091702
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -170,7 +170,7 @@ class SignSystem:
# 尝试通过 ajax 请求绕过签到 # 尝试通过 ajax 请求绕过签到
gt = request_daily_reward.get("gt", "") gt = request_daily_reward.get("gt", "")
challenge = request_daily_reward.get("challenge", "") challenge = request_daily_reward.get("challenge", "")
logger.warning("UID[%s] 触发验证码\ngt[%s]\nchallenge[%s]", client.uid, challenge, gt) logger.warning("UID[%s] 触发验证码\ngt[%s]\nchallenge[%s]", client.uid, gt, challenge)
validate = await self.verification.ajax( validate = await self.verification.ajax(
referer=self.REFERER, referer=self.REFERER,
gt=gt, gt=gt,
@ -206,9 +206,9 @@ class SignSystem:
) )
logger.debug("request_daily_reward 返回\n%s", _request_daily_reward) logger.debug("request_daily_reward 返回\n%s", _request_daily_reward)
if _request_daily_reward and _request_daily_reward.get("success", 0) == 1: if _request_daily_reward and _request_daily_reward.get("success", 0) == 1:
logger.info("UID[%s] 创建验证码\ngt[%s]\nchallenge[%s]", client.uid, challenge, gt)
_gt = _request_daily_reward.get("gt", "") _gt = _request_daily_reward.get("gt", "")
_challenge = _request_daily_reward.get("challenge", "") _challenge = _request_daily_reward.get("challenge", "")
logger.info("UID[%s] 创建验证码\ngt[%s]\nchallenge[%s]", client.uid, _gt, _challenge)
_validate = await self.recognize(_gt, _challenge) _validate = await self.recognize(_gt, _challenge)
if _validate: if _validate:
logger.success("recognize 通过验证成功\nchallenge[%s]\nvalidate[%s]", _challenge, _validate) logger.success("recognize 通过验证成功\nchallenge[%s]\nvalidate[%s]", _challenge, _validate)
@ -221,35 +221,32 @@ class SignSystem:
validate=_validate, validate=_validate,
) )
if request_daily_reward and request_daily_reward.get("success", 0) == 1: if request_daily_reward and request_daily_reward.get("success", 0) == 1:
logger.warning("UID[%s] 触发验证码\nchallenge[%s]", client.uid, challenge) logger.warning("UID[%s] 触发验证码\nchallenge[%s]", client.uid, _challenge)
gt = request_daily_reward.get("gt", "")
challenge = request_daily_reward.get("challenge", "")
logger.success("UID[%s] 创建验证成功\ngt[%s]\nchallenge[%s]", client.uid, gt, challenge)
raise NeedChallenge( raise NeedChallenge(
uid=client.uid, uid=client.uid,
gt=request_daily_reward.get("gt", ""), gt=gt,
challenge=request_daily_reward.get("challenge", ""), challenge=challenge,
) )
else: else:
logger.success("UID[%s] 通过 recognize 签到成功", client.uid) logger.success("UID[%s] 通过 recognize 签到成功", client.uid)
else: else:
request_daily_reward = await client.request_daily_reward( request_daily_reward = await client.request_daily_reward(
"sign", "sign", method="POST", game=Game.GENSHIN, lang="zh-cn"
method="POST",
game=Game.GENSHIN,
lang="zh-cn"
) )
gt = request_daily_reward.get("gt", "") gt = request_daily_reward.get("gt", "")
challenge = request_daily_reward.get("challenge", "") challenge = request_daily_reward.get("challenge", "")
logger.success("UID[%s] 创建验证成功\ngt[%s]\nchallenge[%s]", client.uid, challenge, gt) logger.success("UID[%s] 创建验证成功\ngt[%s]\nchallenge[%s]", client.uid, gt, challenge)
raise NeedChallenge(uid=client.uid, gt=gt, challenge=challenge) raise NeedChallenge(uid=client.uid, gt=gt, challenge=challenge)
else: else:
request_daily_reward = await client.request_daily_reward( request_daily_reward = await client.request_daily_reward(
"sign", "sign", method="POST", game=Game.GENSHIN, lang="zh-cn"
method="POST",
game=Game.GENSHIN,
lang="zh-cn"
) )
gt = request_daily_reward.get("gt", "") gt = request_daily_reward.get("gt", "")
challenge = request_daily_reward.get("challenge", "") challenge = request_daily_reward.get("challenge", "")
logger.success("UID[%s] 创建验证成功\ngt[%s]\nchallenge[%s]", client.uid, challenge, gt) logger.success("UID[%s] 创建验证成功\ngt[%s]\nchallenge[%s]", client.uid, gt, challenge)
raise NeedChallenge(uid=client.uid, gt=gt, challenge=challenge) raise NeedChallenge(uid=client.uid, gt=gt, challenge=challenge)
else: else:
logger.success("UID[%s] 签到成功", client.uid) logger.success("UID[%s] 签到成功", client.uid)