Closed dozen6 closed 2 years ago
应该是这两部分的细节没处理好
1.模板写入文件,而不是使用注释提醒或者提示用户修改
hoshino/modules/Genshin_Paimon/util.py
变量user_cookies_example
user_cookies_example = {
"通用": [
{
"cookie": "",
"no": 1
},
{
"cookie": "",
"no": 2
}
],
"私人":{}
}
2.ck校验未对必要值和空字符进行验证
hoshino/modules/Genshin_Paimon/util.py
函数check_cookie
async def check_cookie(cookie):
url = 'https://bbs-api.mihoyo.com/user/wapi/getUserFullInfo?gids=2'
headers ={
'DS': get_ds(),
'Origin': 'https://webstatic.mihoyo.com',
'Cookie': cookie,
'x-rpc-app_version': "2.11.1",
'x-rpc-client_type': '5',
'Referer': 'https://webstatic.mihoyo.com/'
}
res = await aiorequests.get(url=url,headers=headers)
res = await res.json()
if res['retcode'] != 0:
return False
else:
return True
已知晓,打算过会重做一下cookie方案
重做了cookie存储方案,改用sqlite
存储,之前的有效cookie会自动迁移到数据库,不过注意备份一下,不确保没有BUG...
机器人默认从第三个ck开始添加一号和二号都是空的 导致前面两个一直调用失败然后延长返回时间