thesadru / genshin.py

API wrapper for HoYoLAB/Miyoushe API built on asyncio and pydantic.
https://thesadru.github.io/genshin.py
MIT License
395 stars 72 forks source link

Code Redemption Broken #35

Closed EffortlessFury closed 2 years ago

EffortlessFury commented 2 years ago

I'm getting this error when trying to redeem a code. genshin.errors.GenshinException: [-502] fail to get RPC client

Seems that the CODE_URL has changed, and replacing it with https://sg-hk4e-api.hoyoverse.com/common/apicdkey/api/webExchangeCdkey fixes the issue.

re1von commented 2 years ago

I get a similar output using version 1.2.1 when I try to activate the redeem code:

genshin.errors.GenshinException: Recieved a response with an invalid content type:
404 page not found

I manually downloaded the latest version files from pypi and saw:

CODE_URL = Route("https://hk4e-api-os.mihoyo.com/common/apicdkey/api/webExchangeCdkey")

If I replace the url with https://sg-hk4e-api.hoyoverse.com/common/apicdkey/api/webExchangeCdkey, then this function works fine. Why hasn't it been fixed yet?

thesadru commented 2 years ago

No release has been made since then. Meanwhile you'll have to download directly from git rather than pypi.