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
268 stars 38 forks source link

Error redeem codes #9

Closed opabravo closed 3 years ago

opabravo commented 3 years ago

I am a Taiwanese player I find out it will throw -1071 Error (Please log in to your account first) If i dont manually set 'account_id' and ''cookie_token'' in my cookie from https://genshin.mihoyo.com/en/gift While redeeming codes

genshinstats.errors.GenshinStatsException: -1071 Error (Please log in to your account first)

Is that only me?

thesadru commented 3 years ago

Yeah, I'm trying to figure that one out on the dev branch. Around a month ago Mihoyo has started using ltuid and ltoken for their API but they are still using account_id and cookie_token on their official site. Since code redeems are on the official site they require the old authentication. I have made it possible to automatically turn the old authentication into the new one, so I can just change the api so both options are available. This will however make it pretty complicated for new users to understand what they need to do since having unique authentication for a single endpoint will just cause confusion.

I'm open to any ideas on how to solve the issue or any workarounds I could implement.