y1ndan / genshinhelper2

A Python library for miHoYo bbs and HoYoLAB Community. genshin 原神签到小助手 树脂提醒 微博超话 米游社米游币 崩坏3
https://www.yindan.me
GNU General Public License v3.0
521 stars 243 forks source link

CLOUD_GENSHIN变量。 #56

Open y785201595 opened 1 year ago

y785201595 commented 1 year ago

CLOUD_GENSHIN变量。应该取https://api-cloudgame.mihoyo.com/hk4e_cg_cn/wallet/wallet/get包里的哪个字段呀或者格式是什么 填默认的cookie和cookie token都报错

2022-08-25 21:12:06 INFO You have 1 「云原神签到姬」 account configured. 2022-08-25 21:12:06 INFO Preparing to perform task for account 1... 2022-08-25 21:12:06 ERROR Request failed: 'str' object has no attribute 'items' 2022-08-25 21:12:06 INFO Trying to reconnect in 5 seconds (1/3)... 2022-08-25 21:12:11 ERROR Request failed: 'str' object has no attribute 'items' 2022-08-25 21:12:11 INFO Trying to reconnect in 5 seconds (2/3)... 2022-08-25 21:12:16 ERROR Request failed: 'str' object has no attribute 'items' 2022-08-25 21:12:16 INFO Trying to reconnect in 5 seconds (3/3)... 2022-08-25 21:12:21 ERROR TRACEBACK Traceback (most recent call last): File "/app/./genshincheckinhelper/main.py", line 245, in run_task raw_result = func(cookie) File "/app/./genshincheckinhelper/main.py", line 120, in task5 r = gh.get_cloudgenshin_free_time(cookie) File "/usr/local/lib/python3.10/site-packages/genshinhelper/cloudgenshin.py", line 13, in get_cloudgenshin_free_time return request('get', url, headers=headers).json() File "/usr/local/lib/python3.10/site-packages/genshinhelper/utils.py", line 217, in request raise e File "/usr/local/lib/python3.10/site-packages/genshinhelper/utils.py", line 213, in request response = s.request(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 573, in request prep = self.prepare_request(req) File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 484, in prepare_request p.prepare( File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 369, in prepare self.prepare_headers(headers) File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 489, in prepare_headers for header in headers.items(): AttributeError: 'str' object has no attribute 'items'

y1ndan commented 1 year ago

照着配置文件填

y785201595 commented 1 year ago

Fixes

修复 微博超话检测失效 云原神签到也已支持,需要自己抓包填写CLOUD_GENSHIN变量。

注意:

下列参数如果required字段包含 'title' 或 'content',ONEPUSH变量中都不需要设置。例如serverchan不需要设置 'title'。 custom方式暂时不支持推送签到结果。 OnePush配置讲解

在配置文件中,设置ONEPUSH变量开启推送

y785201595 commented 1 year ago

说明里没有相关配置的说明

y1ndan commented 1 year ago

https://gitlab.com/y1ndan/genshin-checkin-helper/-/blob/main/genshincheckinhelper/config/config.example.json

{
  "LANGUAGE": "en",
  "RANDOM_SLEEP_SECS_RANGE": "0-300",
  "CHECK_IN_TIME": "06:00",
  "CHECK_RESIN_SECS": 900,
  "RESIN_THRESHOLD": 150,
  "RESIN_TIMER_DO_NOT_DISTURB": "23:00-07:00",
  "COOKIE_MIHOYOBBS": "",
  "COOKIE_RESIN_TIMER": "",
  "COOKIE_BH3": "",
  "COOKIE_MIYOUBI": "",
  "CLOUD_GENSHIN": [
    {
      "x-rpc-combo_token": "ai=x;ci=x;oi=xxxxxx;ct=xxxxxx;si=xxxxxx;bi=xxxxxx",
      "x-rpc-client_type": "",
      "x-rpc-app_version": "",
      "x-rpc-sys_version": "",
      "x-rpc-channel": "mihoyo",
      "x-rpc-device_id": "",
      "x-rpc-device_name": "",
      "x-rpc-device_model": "",
      "x-rpc-app_id": "",
      "Referer": "https://app.mihoyo.com",
      "Host": "api-cloudgame.mihoyo.com",
      "Connection": "Keep-Alive",
      "Accept-Encoding": "gzip",
      "User-Agent": "okhttp/3.14.9"
    }
  ],
  "COOKIE_HOYOLAB": "",
  "COOKIE_WEIBO": "",
  "COOKIE_KA": "",
  "SHOPTOKEN": "",
  "ONEPUSH": {
    "notifier": "",
    "params": {
      "markdown": false
    }
  }
}
y785201595 commented 1 year ago

收到谢谢