From 57dc3200ec9ebd7588d2cabe7ff9e06f19f249f3 Mon Sep 17 00:00:00 2001 From: CMHopeSunshine <277073121@qq.com> Date: Tue, 19 Jul 2022 18:30:00 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8Dstoken=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Paimon_Info/get_data.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/Paimon_Info/get_data.py b/Paimon_Info/get_data.py index db69caf..10e55b7 100644 --- a/Paimon_Info/get_data.py +++ b/Paimon_Info/get_data.py @@ -169,26 +169,21 @@ async def addStoken(stoken, uid): login_ticket = login_ticket.group(0).split('=')[1] else: return None, None, None, '你的cookie中没有login_ticket字段哦,请重新获取' - # logger.info(login_ticket) - # mys_id = re.search(r'login_uid=([0-9]+)', mes).group(0).split('=')[1] ck = await get_private_cookie(uid, key='uid') - # logger.info(ck) if not ck: return None, None, None, '你还没绑定私人cookie哦,请先用ysb绑定吧' ck = ck[0][1] - mys_id = re.search(r'account_id=(\d*)', ck).group(0).split('=')[1] - # logger.info("run1") - # logger.info(mys_id) + mys_id = re.search(r'account_id=(\d*)', ck) + if mys_id: + mys_id = mys_id.group(0).split('=')[1] + else: + return None, None, None, '你的cookie中没有account_id字段哦,请重新获取' raw_data = await get_stoken_by_login_ticket(login_ticket, mys_id) - # logger.info(raw_data) - # logger.info("run2") try: stoken = raw_data['data']['list'][0]['token'] except TypeError: return None, None, None, '该stoken无效获取过期了,请重新获取' - # logger.info("run3") s_cookies = 'stuid={};stoken={}'.format(mys_id, stoken) - # logger.info(s_cookies) return s_cookies, mys_id, raw_data, 'OK'