Closed beiji-O-o closed 1 week ago
好像要调下日志级别,debug日志一个没看到
好像要调下日志级别,debug日志一个没看到
去data那看下日志文件
好像要调下日志级别,debug日志一个没看到
去data那看下日志文件
data在哪里
跟配置文件一个文件夹的那个日志文件
跟配置文件一个文件夹的那个日志文件
这个吗
是
是
是
![]()
跟控制台里的一样的。。 需要整个日志文件吗,需要的话给我个邮箱。
知道什么原因了 参考 #195 resultid是查询凭证,还要过一次请求才能得到验证结果
知道什么原因了 参考 #195 resultid是查询凭证,还要过一次请求才能得到验证结果
那咋弄。。
再套一次请求咯,大概是这样
try:
async for attempt in get_async_retry(retry):
with attempt:
async with httpx.AsyncClient() as client:
res = await client.post(
geetest_url,
params=params,
json=content,
timeout=60
)
geetest_data = res.json()
content_v2 = {'appkey': content['appkey']}
content_v2.update(geetest_data['resultid'])
async with httpx.AsyncClient() as client:
res = await client.post(
'http://api.ttocr.com/api/results',
json=content_v2,
timeout=60
)
geetest_data_v2 = res.json()
logger.debug(f"{plugin_config.preference.log_head}人机验证结果:{geetest_data_v2}")
validate = geetest_data_v2['data']['validate']
seccode = geetest_data_v2['data'].get('seccode') or f"{validate}|jordan"
return GeetestResult(validate=validate, seccode=seccode)
except tenacity.RetryError:
logger.exception(f"{plugin_config.preference.log_head}获取人机验证validate失败")
再套一次请求咯,大概是这样
try: async for attempt in get_async_retry(retry): with attempt: async with httpx.AsyncClient() as client: res = await client.post( geetest_url, params=params, json=content, timeout=60 ) geetest_data = res.json() content_v2 = {'appkey': content['appkey']} content_v2.update(geetest_data['resultid']) async with httpx.AsyncClient() as client: res = await client.post( 'http://api.ttocr.com/api/results', json=content_v2, timeout=60 ) geetest_data_v2 = res.json() logger.debug(f"{plugin_config.preference.log_head}人机验证结果:{geetest_data_v2}") validate = geetest_data_v2['data']['validate'] seccode = geetest_data_v2['data'].get('seccode') or f"{validate}|jordan" return GeetestResult(validate=validate, seccode=seccode) except tenacity.RetryError: logger.exception(f"{plugin_config.preference.log_head}获取人机验证validate失败")
content_v2.update(geetest_data['resultid'])
改
content_v2['resultid'] = (geetest_data['resultid'])
content_v2['resultid'] = (geetest_data['resultid'])
打印出来看看返回什么
打印出来看看返回什么
try:
async for attempt in get_async_retry(retry):
with attempt:
async with httpx.AsyncClient() as client:
res = await client.post(
geetest_url,
params=params,
json=content,
timeout=60
)
geetest_data = res.json()
logger.debug(f"{plugin_config.preference.log_head}验证初步提交:{geetest_data}")
content_v2 = {'appkey': content['appkey']}
content_v2['resultid'] = (geetest_data['resultid'])
logger.info('等待识别时间中')
time.sleep(6)
async with httpx.AsyncClient() as client:
res = await client.post(
'http://api.ttocr.com/api/results',
json=content_v2,
timeout=60
)
geetest_data_v2 = res.json()
logger.debug(f"{plugin_config.preference.log_head}人机验证结果:{geetest_data_v2}")
validate = geetest_data_v2['data']['validate']
seccode = geetest_data_v2['data'].get('seccode') or f"{validate}|jordan"
return GeetestResult(validate=validate, seccode=seccode)
except tenacity.RetryError:
logger.exception(f"{plugin_config.preference.log_head}获取人机验证validate失败")
我自己试了,这个可用
try: async for attempt in get_async_retry(retry): with attempt: async with httpx.AsyncClient() as client: res = await client.post( geetest_url, params=params, json=content, timeout=60 ) geetest_data = res.json() logger.debug(f"{plugin_config.preference.log_head}验证初步提交:{geetest_data}") content_v2 = {'appkey': content['appkey']} content_v2['resultid'] = (geetest_data['resultid']) logger.info('等待识别时间中') time.sleep(6) async with httpx.AsyncClient() as client: res = await client.post( 'http://api.ttocr.com/api/results', json=content_v2, timeout=60 ) geetest_data_v2 = res.json() logger.debug(f"{plugin_config.preference.log_head}人机验证结果:{geetest_data_v2}") validate = geetest_data_v2['data']['validate'] seccode = geetest_data_v2['data'].get('seccode') or f"{validate}|jordan" return GeetestResult(validate=validate, seccode=seccode) except tenacity.RetryError: logger.exception(f"{plugin_config.preference.log_head}获取人机验证validate失败")
我自己试了,这个可用
还是第一次可以(部分完成不了)后面全部报错
截图log文件里的,这图看不到debug级别日志
截图log文件里的,这图看不到debug级别日志
logger.debug(f"检查点赞返回:{api_result}")
点赞成功的返回是这样的检查点赞返回:content={'retcode': 0, 'message': 'OK', 'data': {}} data={} message='OK' retcode=0
logger.debug(f"检查点赞返回:{api_result}")
突然又能用了不会报错了。。
在这下面添加这个,查看返回内容
logger.debug(f"检查点赞返回:{api_result}")
点赞成功的返回是这样的
检查点赞返回:content={'retcode': 0, 'message': 'OK', 'data': {}} data={} message='OK' retcode=0
这个早上使用/任务*的时候报错,我刚才再试又不会报错了,昨天也是这样
现在又出现了 /任务* 卡在某一个账号不能继续的bug了...
没遇到过这种情况,有可能是账号的问题
接口可能返回1034错误 不清楚是不是这个原因 可以去试下根据米游币签到验证的代码也给点赞套上一层验证 或者试试换个ua?
不清楚是不是这个原因
可以去试下根据米游币签到验证的代码也给点赞套上一层验证
或者试试换个ua?
ua是什么
User-Agent
User-Agent
这个要咋换 随便改几个字吗
User-Agent
这个要咋换 随便改几个字吗
有个方法是把那种查看当前客户端UA的网站链接转换为二维码,然后米游社App扫描
我发现每次当我重新安装nonebot-plugin-mystool,并重新登陆账号,就一定不会弹验证码
User-Agent
ua改哪里啊
User-Agent
这个要咋换 随便改几个字吗
有个方法是把那种查看当前客户端UA的网站链接转换为二维码,然后米游社App扫描
怎么米游币用的是USER_AGENT_ANDROID_OTHER
而不是USER_AGENT_ANDROID
06-15 11:30:00 [INFO] nonebot_plugin_mystool | 开始执行每日自动任务 06-15 11:30:28 [WARNING] nonebot_plugin_mystool | 游戏签到 - 用户 7xxxxxx1 可能被人机验证阻拦 06-15 11:30:28 [DEBUG] nonebot_plugin_mystool | 网络请求返回: {"retcode":0,"message":"OK","data":{"code":"","risk_code":5001,"gt":"afa69b855e321950b027ebab65f86ce8","challenge":"cf7202b0cbc1f94a278c5e2d032fb926","success":1,"is_risk":true}} 06-15 11:30:28 [DEBUG] nonebot_plugin_mystool | get_validate: {'geetest_url': 'http://api.ttocr.com/api/recognize', 'params': {'gt': 'afa69b855e321950b027ebab65f86ce8', 'challenge': 'cf7202b0cbc1f94a278c5e2d032fb926'}, 'content': {'gt': 'afa69b855e321950b027ebab65f86ce8', 'challenge': 'cf7202b0cbc1f94a278c5e2d032fb926', 'appkey': '6xxxxxxxxxxxxxxxxxx3', 'itemid': 488, 'referer': 'https://act.mihoyo.com/'}} 06-15 11:30:34 [DEBUG] nonebot_plugin_mystool | 验证初步提交:{'status': 4005, 'msg': 'appkey不存在1'} 06-15 11:30:42 [DEBUG] nonebot_plugin_mystool | 验证初步提交:{'status': 4005, 'msg': 'appkey不存在1'} 06-15 11:30:50 [DEBUG] nonebot_plugin_mystool | 验证初步提交:{'status': 4005, 'msg': 'appkey不存在1'} 06-15 11:30:58 [DEBUG] nonebot_plugin_mystool | 验证初步提交:{'status': 4005, 'msg': 'appkey不存在1'} 06-15 11:30:58 [ERROR] nonebot_plugin_mystool | 获取人机验证validate失败 Traceback (most recent call last): File "/root/mikl/.venv/lib/python3.9/site-packages/nonebot_plugin_mystool/utils/common.py", line 276, in get_validate content_v2['resultid'] = (geetest_data['resultid']) KeyError: 'resultid'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "
File "/root/mikl/.venv/lib/python3.9/site-packages/nonebot_plugin_mystool/utils/common.py", line 264, in get_validate async for attempt in get_async_retry(retry): File "/root/mikl/.venv/lib/python3.9/site-packages/tenacity/_asyncio.py", line 123, in anext do = await self.iter(retry_state=self._retry_state) File "/root/mikl/.venv/lib/python3.9/site-packages/tenacity/_asyncio.py", line 110, in iter result = await action(retry_state) File "/root/mikl/.venv/lib/python3.9/site-packages/tenacity/_asyncio.py", line 78, in inner return fn(*args, **kwargs) File "/root/mikl/.venv/lib/python3.9/site-packages/tenacity/init.py", line 411, in exc_check raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0xffff81e4e3a0 state=finished raised KeyError>] 06-15 11:31:00 [DEBUG] nonebot_plugin_mystool | 检查点赞返回:content={'retcode': 0, 'message': 'OK', 'data': {}} data={} message='OK' retcode=0 06-15 11:31:07 [DEBUG] nonebot_plugin_mystool | 检查点赞返回:content={'retcode': 0, 'message': 'OK', 'data': {}} data={} message='OK' retcode=0 06-15 11:31:15 [WARNING] nonebot_plugin_mystool | 游戏签到 - 用户 7xxxxxx1 可能被人机验证阻拦 06-15 11:31:15 [DEBUG] nonebot_plugin_mystool | 网络请求返回: {"retcode":0,"message":"OK","data":{"code":"","risk_code":5001,"gt":"afa69b855e321950b027ebab65f86ce8","challenge":"130202d7a3549722ee963e745aeae462","success":1,"is_risk":true}} 06-15 11:31:15 [INFO] nonebot_plugin_mystool | 向用户 57xxxxxx19 发送 QQ 频道私信 recipient_id: 57xxxxxx19, source_guild_id: 67xxxxxx19 06-15 11:31:15 [DEBUG] nonebot_plugin_mystool | 检查点赞返回:content={'retcode': 0, 'message': 'OK', 'data': {}} data={} message='OK' retcode=0 06-15 11:31:23 [DEBUG] nonebot_plugin_mystool | 检查点赞返回:content={'retcode': 0, 'message': 'OK', 'data': {}} data={} message='OK' retcode=0 06-15 11:31:36 [DEBUG] nonebot_plugin_mystool | 检查点赞返回:content={'retcode': 0, 'message': 'OK', 'data': {}} data={} message='OK' retcode=0 06-15 11:31:44 [DEBUG] nonebot_plugin_mystool | 检查点赞返回:content={'retcode': 0, 'message': 'OK', 'data': {}} data={} message='OK' retcode=0 06-15 11:31:45 [WARNING] nonebot_plugin_mystool | 游戏签到 - 用户 7xxxxxx1 可能被人机验证阻拦 06-15 11:31:45 [DEBUG] nonebot_plugin_mystool | 网络请求返回: {"retcode":0,"message":"OK","data":{"code":"","risk_code":5001,"gt":"ccc71324fd054bb75dc80f0467319a4f","challenge":"b94e22bd03001c0a2e743b6c30f26580","success":1,"is_risk":true}} 06-15 11:31:45 [DEBUG] nonebot_plugin_mystool | get_validate: {'geetest_url': 'http://api.ttocr.com/api/recognize', 'params': {'gt': 'ccc71324fd054bb75dc80f0467319a4f', 'challenge': 'b94e22bd03001c0a2e743b6c30f26580'}, 'content': {'gt': 'ccc71324fd054bb75dc80f0467319a4f', 'challenge': 'b94e22bd03001c0a2e743b6c30f26580', 'appkey': '6xxxxxxxxxxxxxxxxxx3', 'itemid': 488, 'referer': 'https://act.mihoyo.com/'}} 06-15 11:31:51 [DEBUG] nonebot_plugin_mystool | 验证初步提交:{'status': 4005, 'msg': 'appkey不存在1'} 06-15 11:31:51 [DEBUG] nonebot_plugin_mystool | 检查点赞返回:content={'retcode': 0, 'message': 'OK', 'data': {}} data={} message='OK' retcode=0 06-15 11:31:59 [DEBUG] nonebot_plugin_mystool | 检查点赞返回:content={'retcode': 0, 'message': 'OK', 'data': {}} data={} message='OK' retcode=0 06-15 11:31:59 [DEBUG] nonebot_plugin_mystool | 验证初步提交:{'status': 4005, 'msg': 'appkey不存在1'} 06-15 11:32:07 [DEBUG] nonebot_plugin_mystool | 验证初步提交:{'status': 4005, 'msg': 'appkey不存在1'} 06-15 11:32:12 [DEBUG] nonebot_plugin_mystool | 检查点赞返回:content={'retcode': 0, 'message': 'OK', 'data': {}} data={} message='OK' retcode=0 06-15 11:32:16 [DEBUG] nonebot_plugin_mystool | 验证初步提交:{'status': 4005, 'msg': 'appkey不存在1'} 06-15 11:32:16 [ERROR] nonebot_plugin_mystool | 获取人机验证validate失败 Traceback (most recent call last): File "/root/mikl/.venv/lib/python3.9/site-packages/nonebot_plugin_mystool/utils/common.py", line 276, in get_validate content_v2['resultid'] = (geetest_data['resultid']) KeyError: 'resultid'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "
File "/root/mikl/.venv/lib/python3.9/site-packages/nonebot_plugin_mystool/utils/common.py", line 264, in get_validate async for attempt in get_async_retry(retry): File "/root/mikl/.venv/lib/python3.9/site-packages/tenacity/_asyncio.py", line 123, in anext do = await self.iter(retry_state=self._retry_state) File "/root/mikl/.venv/lib/python3.9/site-packages/tenacity/_asyncio.py", line 110, in iter result = await action(retry_state) File "/root/mikl/.venv/lib/python3.9/site-packages/tenacity/_asyncio.py", line 78, in inner return fn(*args, **kwargs) File "/root/mikl/.venv/lib/python3.9/site-packages/tenacity/init.py", line 411, in exc_check raise retry_exc from fut.exception() tenacity.RetryError: RetryError[<Future at 0xffff81ddbe20 state=finished raised KeyError>] 06-15 11:32:20 [DEBUG] nonebot_plugin_mystool | 检查点赞返回:content={'retcode': 0, 'message': 'OK', 'data': {}} data={} message='OK' retcode=0
报错来了 @Joseandluue
appkey不存在,确认没错吗,贴一下你现在用的这个函数的代码块截图出来https://github.com/Ljzd-PRO/nonebot-plugin-mystool/blob/505b184af0a52c765abb73a14811a520eaf2e0e2/src/nonebot_plugin_mystool/utils/common.py#L235
appkey不存在,确认没错吗,贴一下你现在用的这个函数的代码块截图出来
不知道为什么是appkey不存在,同一个appkey在其他项目就可以过
这样我真不知道哪有问题,appkey不能为空还好说,appkey不存在有可能不是代码的问题
6444f5d753c64a2cbb44bd32554a6893
你key露出来了。。 还有就是appkey返回为空,在文档里面写了重置一次就可以了
哪里重置? @beiji-O-o
哪里重置? @beiji-O-o
打码平台面板有个重置key
User-Agent
这个要咋换 随便改几个字吗
有个方法是把那种查看当前客户端UA的网站链接转换为二维码,然后米游社App扫描
怎么米游币用的是
USER_AGENT_ANDROID_OTHER
而不是USER_AGENT_ANDROID
咋弄啊,现在/任务*就卡住报错,/任务就没问题
我想知道/签到*有报错吗
我想知道/签到*有报错吗
我试试,我都不知道有这个功能。
我想知道/签到*有报错吗
/签到 没问题 我让全部人手动/任务后我现在/任务也可以正常过了。。
我想知道/签到*有报错吗
/签到 没问题 我让全部人手动/任务后我现在/任务也可以正常过了。。
你每天/任务*的时候,报错前谈论区的签到显示成功没?
我想知道/签到*有报错吗
/签到 没问题 我让全部人手动/任务后我现在/任务也可以正常过了。。
你每天/任务*的时候,报错前谈论区的签到显示成功没?
我明天看看 我现在已经/任务*了
我明天看看 我现在已经/任务*了
今天/任务*没有报错吗,有的话可以去日志里看到
我明天看看 我现在已经/任务*了
今天/任务*没有报错吗,有的话可以去日志里看到
评论区的打卡都打了,没问题
唉,我试不出来这个报错 https://github.com/Ljzd-PRO/nonebot-plugin-mystool/blob/505b184af0a52c765abb73a14811a520eaf2e0e2/src/nonebot_plugin_mystool/api/myb_missions_api.py#L288 你试试在这行下面加上这个吧,看看改成这个ua有没有效果
headers["User-Agent"] = plugin_env.device_config.USER_AGENT_ANDROID
唉,我试不出来这个报错
你试试在这行下面加上这个吧,看看改成这个ua有没有效果
headers["User-Agent"] = plugin_env.device_config.USER_AGENT_ANDROID