Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

抢原石报错 #114

Closed
Aellyt opened this issue May 31, 2023 · 29 comments · Fixed by #152
Closed

抢原石报错 #114

Aellyt opened this issue May 31, 2023 · 29 comments · Fixed by #152
Labels
mihoyo API Issues about mihoyo API

Comments

@Aellyt
Copy link
Contributor

Aellyt commented May 31, 2023

截图2046

@Ljzd-PRO
Copy link
Owner

Ljzd-PRO commented Jun 2, 2023

已经是完整的报错内容了吗

@Aellyt
Copy link
Contributor Author

Aellyt commented Jun 2, 2023

已经是完整的报错内容了吗

这是请求下面打印的,有点类似请求被ban了一样

@Ljzd-PRO
Copy link
Owner

Ljzd-PRO commented Jun 2, 2023

日志文件看看有没有更完整的报错内容

@Ljzd-PRO
Copy link
Owner

Ljzd-PRO commented Jun 2, 2023

应该是返回的数据处理失败了,说明服务器返回的数据可能不符合预期,有可能是出错了的返回

@Aellyt
Copy link
Contributor Author

Aellyt commented Jun 2, 2023

应该是返回的数据处理失败了,说明服务器返回的数据可能不符合预期,有可能是出错了的返回

我在那天也用了旧版本的抢实物,发现返回的是{"data":null,"message":"","retcode":1028}会不会是这个的问题嘛。那个报错日志在我个人电脑上,得后天才能发出来

@Ljzd-PRO
Copy link
Owner

Ljzd-PRO commented Jun 2, 2023

应该是返回的数据处理失败了,说明服务器返回的数据可能不符合预期,有可能是出错了的返回

我在那天也用了旧版本的抢实物,发现返回的是{"data":null,"message":"","retcode":1028}会不会是这个的问题嘛。那个报错日志在我个人电脑上,得后天才能发出来

应该是这个原因

@Ljzd-PRO Ljzd-PRO added the mihoyo API Issues about mihoyo API label Jun 2, 2023
@Aellyt
Copy link
Contributor Author

Aellyt commented Jun 4, 2023

05-31 19:00:04 [ERROR] mys_goods_tool.api | 米游币商品兑换 - 执行兑换: 用户 7*******2 商品 2023051912577 请求失败
Traceback (most recent call last):

File "threading.py", line 995, in _bootstrap

File "threading.py", line 1038, in _bootstrap_inner

File "threading.py", line 975, in run

File "concurrent\futures\thread.py", line 83, in _worker

File "concurrent\futures\thread.py", line 58, in run

File "apscheduler\executors\base.py", line 125, in run_job

File "mys_goods_tool\exchange_mode.py", line 101, in exchange_begin

File "mys_goods_tool\api.py", line 1266, in good_exchange_sync

File "httpx_models.py", line 756, in json

File "json_init_.py", line 346, in loads

File "json\decoder.py", line 337, in decode

File "json\decoder.py", line 355, in raw_decode

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
05-31 19:00:04 [ERROR] mys_goods_tool.api | 米游币商品兑换 - 执行兑换: 用户 7******2 商品 2023051912577 请求失败
Traceback (most recent call last):

File "threading.py", line 995, in _bootstrap

File "threading.py", line 1038, in _bootstrap_inner

File "threading.py", line 975, in run

File "concurrent\futures\thread.py", line 83, in _worker

File "concurrent\futures\thread.py", line 58, in run

File "apscheduler\executors\base.py", line 125, in run_job

File "mys_goods_tool\exchange_mode.py", line 101, in exchange_begin

File "mys_goods_tool\api.py", line 1266, in good_exchange_sync

File "httpx_models.py", line 756, in json

File "json_init_.py", line 346, in loads

File "json\decoder.py", line 337, in decode

File "json\decoder.py", line 355, in raw_decode

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
05-31 19:00:04 [ERROR] mys_goods_tool.exchange_mode | 接收兑换结果失败
Traceback (most recent call last):

File "threading.py", line 995, in _bootstrap

File "threading.py", line 1038, in _bootstrap_inner

File "threading.py", line 975, in run

File "concurrent\futures\thread.py", line 83, in _worker

File "concurrent\futures\thread.py", line 64, in run

File "concurrent\futures_base.py", line 550, in set_result

File "concurrent\futures_base.py", line 340, in _invoke_callbacks

File "apscheduler\executors\pool.py", line 25, in callback

File "apscheduler\executors\base.py", line 90, in _run_job_success

File "apscheduler\schedulers\base.py", line 835, in _dispatch_event

File "mys_goods_tool\exchange_mode.py", line 304, in on_executed

StopIteration

@Aellyt
Copy link
Contributor Author

Aellyt commented Jun 4, 2023

这是那天抢原石的完整报错了

@Ljzd-PRO
Copy link
Owner

Ljzd-PRO commented Jun 4, 2023

点击测试兑换,日志里是正常的返回吗

@Aellyt
Copy link
Contributor Author

Aellyt commented Jun 7, 2023

日志是正常返回的,显示库存不足

@Aellyt
Copy link
Contributor Author

Aellyt commented Jun 7, 2023

大佬旧版本是可以改配置文件来关闭ping的,新版本能关闭吗

@Ljzd-PRO
Copy link
Owner

Ljzd-PRO commented Jun 8, 2023

大佬旧版本是可以改配置文件来关闭ping的,新版本能关闭吗

修改 user_data.json 配置文件中的 preference.enable_connection_testfalse 就可以关闭

@Aellyt
Copy link
Contributor Author

Aellyt commented Jun 10, 2023

大佬旧版本是可以改配置文件来关闭ping的,新版本能关闭吗

修改 user_data.json 配置文件中的 preference.enable_connection_testfalse 就可以关闭

多谢大佬解答,我重写了返回,把兑换按键点亮了,抓包了星琼和原石的请求,对比了下没啥区别,大佬你可以对比下你的请求看下是不是多了什么东西
64151

@Ljzd-PRO
Copy link
Owner

大佬旧版本是可以改配置文件来关闭ping的,新版本能关闭吗

修改 user_data.json 配置文件中的 preference.enable_connection_testfalse 就可以关闭

多谢大佬解答,我重写了返回,把兑换按键点亮了,抓包了星琼和原石的请求,对比了下没啥区别,大佬你可以对比下你的请求看下是不是多了什么东西 64151

可能额外有什么请求?有空我也试试

@Ljzd-PRO
Copy link
Owner

可能是 x-rpc-app_version 需要更新

@Aellyt
Copy link
Contributor Author

Aellyt commented Jun 12, 2023

可能是 x-rpc-app_version 需要更新

应该不是这个,这是ios的系统版本

@Ljzd-PRO
Copy link
Owner

可能是 x-rpc-app_version 需要更新

应该不是这个,这是ios的系统版本

x-rpc-sys_version 才是

@Ljzd-PRO
Copy link
Owner

使用最新的修改需要注意用户数据文件中 DeviceConfig 会覆盖新修改的内容,可以尝试删除 DeviceConfig 部分

@Ljzd-PRO
Copy link
Owner

Ljzd-PRO commented Jun 19, 2023

https://github.com/Ljzd-PRO/Mys_Goods_Tool/actions/runs/5316402975
兑换请求的URL、Headers、Headers里的 x-rpc-app_version 更新了
暂未测试。

@Ljzd-PRO Ljzd-PRO moved this from Todo to In Progress in Mys_Goods_Tool with TUI Jun 19, 2023
@Aellyt
Copy link
Contributor Author

Aellyt commented Jun 21, 2023

大佬,我今天自己设备抓包请求的都返回
1028,人麻了

@Aellyt
Copy link
Contributor Author

Aellyt commented Jun 21, 2023

14084A91-2AC7-43C5-B41A-FF34EF1C3C52

@Ljzd-PRO
Copy link
Owner

Ljzd-PRO commented Jul 6, 2023

又尝试修复了一下,可以试一下:https://github.com/Ljzd-PRO/Mys_Goods_Tool/actions/runs/5479310149

解决了几个可能的问题:

  • device_config, salt_config 如果程序默认值更新了但是用户数据文件用的还是旧的,旧的配置还是会覆盖掉默认值的问题
  • 兑换请求的Headers里增加Referer,修改Origin, Content-Type
  • Headers的User-Agent里的App版本号部分和x-rpc-app_version不一致的问题

除了Headers里没有x-rpc-verify_key, x-rpc-device_fp,其他应该都和米游社App里实际发出的请求一致了。

@Aellyt
Copy link
Contributor Author

Aellyt commented Jul 7, 2023

又尝试修复了一下,可以试一下:https://github.com/Ljzd-PRO/Mys_Goods_Tool/actions/runs/5479310149

解决了几个可能的问题:

  • device_config, salt_config 如果程序默认值更新了但是用户数据文件用的还是旧的,旧的配置还是会覆盖掉默认值的问题
  • 兑换请求的Headers里增加Referer,修改Origin, Content-Type
  • Headers的User-Agent里的App版本号部分和x-rpc-app_version不一致的问题

除了Headers里没有x-rpc-verify_key, x-rpc-device_fp,其他应该都和米游社App里实际发出的请求一致了。
今日18时测试依旧是返回1028

@ayakasuki
Copy link

image
我也是兑换了三次 也都是失败

@Ljzd-PRO
Copy link
Owner

Ljzd-PRO commented Jul 7, 2023

我再补一个x-rpc-verify_key,一般情况这个是固定值

@Ljzd-PRO
Copy link
Owner

发布了一个pre-release:https://github.com/Ljzd-PRO/Mys_Goods_Tool/releases/tag/v2.1.0-beta.1
感觉这次兑换成功的概率会高一些。

@Tsuk1ko
Copy link

Tsuk1ko commented Jul 12, 2023

发布了一个pre-release:v2.1.0-beta.1 (release) 感觉这次兑换成功的概率会高一些。

试了一下,还是 1028 了😭

@Ljzd-PRO
Copy link
Owner

发布了一个pre-release:v2.1.0-beta.1 (release) 感觉这次兑换成功的概率会高一些。

试了一下,还是 1028 了😭

增加了人机验证。App里抢也会遇到人机验证

@github-project-automation github-project-automation bot moved this from In Progress to Done in Mys_Goods_Tool with TUI Jul 20, 2023
@Ljzd-PRO Ljzd-PRO reopened this Jul 21, 2023
@Ljzd-PRO Ljzd-PRO moved this from Done to Todo in Mys_Goods_Tool with TUI Jul 21, 2023
@Ljzd-PRO Ljzd-PRO moved this from Todo to In Progress in Mys_Goods_Tool with TUI Jul 21, 2023
@Ljzd-PRO Ljzd-PRO moved this from In Progress to Done in Mys_Goods_Tool with TUI Jul 22, 2023
@Ljzd-PRO
Copy link
Owner

最新版本已经可以成功兑换(需要人机验证的情况除外)

@Ljzd-PRO Ljzd-PRO linked a pull request Jul 31, 2023 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
mihoyo API Issues about mihoyo API
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

4 participants