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

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

网络请求返回: {"data":null,"message":"","retcode":1028} #116

Closed
ytgo opened this issue Jun 7, 2023 · 11 comments · Fixed by #144 or #152
Closed

网络请求返回: {"data":null,"message":"","retcode":1028} #116

ytgo opened this issue Jun 7, 2023 · 11 comments · Fixed by #144 or #152
Labels
duplicate This issue or pull request already exists mihoyo API Issues about mihoyo API

Comments

@ytgo
Copy link

ytgo commented Jun 7, 2023

这个是什么问题啊

@Aellyt
Copy link
Contributor

Aellyt commented Jun 7, 2023

我也是,原神分类的都这样了,米哈游可能改参数了

@wsmbsbbz
Copy link

wsmbsbbz commented Jun 7, 2023

我也是同样的问题和retcode,应该是和 #114 是一样的。

我开了5个线程:

  • 其中3个是在good_exchange_sync函数中api_result = ApiResultHandler(res.json())这里报错json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0),请求失败
  • 另外2个线程则是{"data":null,"message":"","retcode":1028},兑换失败。

日志输出:

06-07 19:00:00 [ERROR] mys_goods_tool.api | 米游币商品兑换 - 执行兑换: 用户 3*******3 商品 2023051912299 请求失败
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)
06-07 19:00:00 [ERROR] mys_goods_tool.api | 米游币商品兑换 - 执行兑换: 用户 3*******3 商品 2023051912299 请求失败
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)
06-07 19:00:00 [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
06-07 19:00:00 [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
06-07 19:00:00 [INFO] mys_goods_tool.api | 米游币商品兑换 - 执行兑换: 用户 3*******3 商品 2023051912299 兑换失败,可以自行确认。
06-07 19:00:00 [DEBUG] mys_goods_tool.api | 网络请求返回: {"data":null,"message":"","retcode":1028}
06-07 19:00:00 [ERROR] mys_goods_tool.exchange_mode | 用户 3*******3 - 【原神】原石*150 - 线程 2 - 兑换失败
06-07 19:00:00 [ERROR] mys_goods_tool.api | 米游币商品兑换 - 执行兑换: 用户 3*******3 商品 2023051912299 请求失败
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)
06-07 19:00:00 [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
06-07 19:00:00 [INFO] mys_goods_tool.api | 米游币商品兑换 - 执行兑换: 用户 3*******3 商品 2023051912299 兑换失败,可以自行确认。
06-07 19:00:00 [DEBUG] mys_goods_tool.api | 网络请求返回: {"data":null,"message":"","retcode":1028}
06-07 19:00:00 [ERROR] mys_goods_tool.exchange_mode | 用户 3*******3 - 【原神】原石*150 - 线程 4 - 兑换失败

环境如下:

  • MacOS
  • 软件版本v2.0.4
  • 用的GUI模式
  • 网络延迟50~60ms(我这个网络环境很可能就抢不到东西)
  • 测试兑换返回“商品库存不足”,retcode-2102
"preference": {
    "github_proxy": "https://ghproxy.com/",
    "enable_connection_test": true,
    "connection_test_interval": 30.0,
    "timeout": 10.0,
    "max_retry_times": 5,
    "retry_interval": 2.0,
    "enable_ntp_sync": true,
    "ntp_server": "ntp.aliyun.com",
    "timezone": "Asia/Shanghai",
    "geetest_statics_path": null,
    "geetest_listen_address": [
        "localhost",
        0
    ],
    "exchange_thread_count": 5,
    "exchange_latency": [
        0.0,
        0.02
    ],
    "enable_log_output": true,
    "log_path": "logs/mys_goods_tool.log"
},

@Yoimiya-993
Copy link

一样的返回结果,自从用了图形化版本就没换成功过

@Ljzd-PRO
Copy link
Owner

Ljzd-PRO commented Jun 7, 2023

Ljzd-PRO/nonebot-plugin-mystool#110

也是一样

@Ljzd-PRO
Copy link
Owner

Ljzd-PRO commented Jun 7, 2023

等下次兑换我手动抓包检查一下

@Ljzd-PRO Ljzd-PRO added mihoyo API Issues about mihoyo API duplicate This issue or pull request already exists labels Jun 7, 2023
@TianXiaSky
Copy link

还真是原神兑换才有问题,我连续两个星期抢原神的东西都是
网络请求返回: {"data":null,"message":"","retcode":1028}
这个代码,抢不到,今天换成崩铁的商品一下就成功了

@pbxs666
Copy link

pbxs666 commented Jun 16, 2023

还真是原神兑换才有问题,我连续两个星期抢原神的东西都是 网络请求返回: {"data":null,"message":"","retcode":1028} 这个代码,抢不到,今天换成崩铁的商品一下就成功了

今天试崩铁的东西,也失败了😣
06-16 18:00:00 [INFO] mys_goods_tool.api | 米游币商品兑换 - 执行兑换: 用户 136508784 商品 2023052611696 兑换失败,可以自行确认。
06-16 18:00:00 [DEBUG] mys_goods_tool.api | 网络请求返回: {"data":null,"message":"","retcode":1028}
06-16 18:00:00 [ERROR] mys_goods_tool.exchange_mode | 用户 136508784 - 【崩坏:星穹铁道】鼠标垫-星旅一瞬 - 线程 1 - 兑换失败
06-16 18:00:00 [INFO] mys_goods_tool.api | 米游币商品兑换 - 执行兑换: 用户 136508784 商品 2023052611696 兑换失败,可以自行确认。
06-16 18:00:00 [DEBUG] mys_goods_tool.api | 网络请求返回: {"data":null,"message":"","retcode":1028}
06-16 18:00:00 [ERROR] mys_goods_tool.exchange_mode | 用户 136508784 - 【崩坏:星穹铁道】鼠标垫-星旅一瞬 - 线程 2 - 兑换失败
06-16 18:00:00 [INFO] mys_goods_tool.api | 米游币商品兑换 - 执行兑换: 用户 136508784 商品 2023052611696 兑换失败,可以自行确认。
06-16 18:00:00 [DEBUG] mys_goods_tool.api | 网络请求返回: {"data":null,"message":"","retcode":1028}
06-16 18:00:00 [ERROR] mys_goods_tool.exchange_mode | 用户 136508784 - 【崩坏:星穹铁道】鼠标垫-星旅一瞬 - 线程 3 - 兑换失败

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

fanlu commented Jun 21, 2023

用了最新的代码,抢原神的依然是返回1028

2023-06-21 19:00:00  INFO  开始发送商品 2023051912299 的兑换请求...
2023-06-21 19:00:00  INFO  开始发送商品 2023051912299 的兑换请求...
2023-06-21 19:00:00  INFO  开始发送商品 2023051912299 的兑换请求...
2023-06-21 19:00:00  INFO  兑换商品:2023051912299 返回结果:
{"data":null,"message":"","retcode":1028}

2023-06-21 19:00:00  INFO  兑换商品:2023051912299 返回结果:
{"data":null,"message":"","retcode":1028}

2023-06-21 19:00:00  INFO  商品 2023051912299 兑换失败,可以自行确认。
2023-06-21 19:00:00  INFO  商品 2023051912299 兑换失败,可以自行确认。
2023-06-21 19:00:00  INFO  兑换商品:2023051912299 返回结果:
{"data":null,"message":"","retcode":1028}

2023-06-21 19:00:01  INFO  商品 2023051912299 兑换失败,可以自行确认。

@Ljzd-PRO
Copy link
Owner

用了最新的代码,抢原神的依然是返回1028

2023-06-21 19:00:00  INFO  开始发送商品 2023051912299 的兑换请求...
2023-06-21 19:00:00  INFO  开始发送商品 2023051912299 的兑换请求...
2023-06-21 19:00:00  INFO  开始发送商品 2023051912299 的兑换请求...
2023-06-21 19:00:00  INFO  兑换商品:2023051912299 返回结果:
{"data":null,"message":"","retcode":1028}

2023-06-21 19:00:00  INFO  兑换商品:2023051912299 返回结果:
{"data":null,"message":"","retcode":1028}

2023-06-21 19:00:00  INFO  商品 2023051912299 兑换失败,可以自行确认。
2023-06-21 19:00:00  INFO  商品 2023051912299 兑换失败,可以自行确认。
2023-06-21 19:00:00  INFO  兑换商品:2023051912299 返回结果:
{"data":null,"message":"","retcode":1028}

2023-06-21 19:00:01  INFO  商品 2023051912299 兑换失败,可以自行确认。

是release的v2.0.4还是这两天改后的

@fanlu
Copy link

fanlu commented Jun 21, 2023

用了最新的代码,抢原神的依然是返回1028

2023-06-21 19:00:00  INFO  开始发送商品 2023051912299 的兑换请求...
2023-06-21 19:00:00  INFO  开始发送商品 2023051912299 的兑换请求...
2023-06-21 19:00:00  INFO  开始发送商品 2023051912299 的兑换请求...
2023-06-21 19:00:00  INFO  兑换商品:2023051912299 返回结果:
{"data":null,"message":"","retcode":1028}

2023-06-21 19:00:00  INFO  兑换商品:2023051912299 返回结果:
{"data":null,"message":"","retcode":1028}

2023-06-21 19:00:00  INFO  商品 2023051912299 兑换失败,可以自行确认。
2023-06-21 19:00:00  INFO  商品 2023051912299 兑换失败,可以自行确认。
2023-06-21 19:00:00  INFO  兑换商品:2023051912299 返回结果:
{"data":null,"message":"","retcode":1028}

2023-06-21 19:00:01  INFO  商品 2023051912299 兑换失败,可以自行确认。

是release的v2.0.4还是这两天改后的

用的1.4.5加上了这两天改的代码

@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里实际发出的请求一致了。

Repository owner locked and limited conversation to collaborators Jul 12, 2023
@Ljzd-PRO Ljzd-PRO converted this issue into discussion #138 Jul 12, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Mys_Goods_Tool with TUI Jul 12, 2023
@Ljzd-PRO Ljzd-PRO linked a pull request Jul 20, 2023 that will close this issue
@Ljzd-PRO Ljzd-PRO linked a pull request Jul 31, 2023 that will close this issue

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
duplicate This issue or pull request already exists mihoyo API Issues about mihoyo API
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

8 participants