thesadru / genshinstats

PLEASE USE GENSHIN.PY A python library that can get the stats of Genshin Impact players using Mihoyo's API. PLEASE USE GENSHIN.PY
https://thesadru.github.io/pdoc/genshinstats/
MIT License
265 stars 38 forks source link

Error occured during claim daily reward on Chinese Server #35

Open twfx1207 opened 2 years ago

twfx1207 commented 2 years ago

Hello,

I made an auto_signin bot based on genshinstats, here are related source codes:

import genshinstats as gs

config = util.get_config()
cookies = config.setting.cookies
cookies_os = config.setting.cookies_os

    for cookie_os in cookies_os:
        cookie = SimpleCookie(cookie_os)
        cookie_dict = {i.key:i.value for i in cookie.values()}
        gs.claim_daily_reward(lang='zh-cn', cookie=cookie_dict)

    for cookie_cn in cookies:
        cookie = SimpleCookie(cookie_cn)
        cookie_dict = {i.key:i.value for i in cookie.values()}
        gs.claim_daily_reward(lang='zh-cn', chinese=True, cookie=cookie_dict)

For Asia server it works well, but an NotLoggedIn error raised when ltuid and ltoken is used, while a [-1005 Error (uid不为空)] error occurred on account_id and cookie_token pair for Chinese server. I wonder if there are any extra parameter or token required.

Regards.

thesadru commented 2 years ago

Yes it is possible that Chinese accounts still require a uid, overseas claiming has removed the need for those a few weeks ago but it seems Chinese has not.

I feel the Chinese version of the API has been greatly diverging from the overseas recently so some overhauls may be necessary. I will most likely add an optional UID parameter for this but it's pretty hard to test Chinese endpoints without a Chinese account so I plan on figuring out how to even create one while not living in china. In the meantime it'll have to be guesswork.

twfx1207 commented 2 years ago

Hello,

I found a plugin which could claim daily reward on Chinese server correctly, possibly would help you:

https://github.com/KimigaiiWuyi/GenshinUID/blob/9a5fdd66903fb3c273491c0590b44e3a581b3591/getDB.py#L362

Regards.