Ennea / warp-journal

Honkai: Star Rail gacha tracker and analysis.
MIT License
8 stars 4 forks source link

HSR 2.4 Uses a new API endpoint for getGachaLog #15

Closed technizor closed 1 month ago

technizor commented 2 months ago

Previous: https://api-os-takumi.mihoyo.com/common/gacha_record/api/getGachaLog New: https://public-operation-hkrpg-sg.hoyoverse.com/common/gacha_record/api/getGachaLog

The query parameters look exactly the same as the previous API endpoint, but the old endpoint was most likely disabled or removed since this application currently doesn't work (500 Error in the web UI of Warp Journal, display message "Something went wrong...please retry later.")

FichteFoll commented 2 months ago

Current master should already be compatible with the URL change because I made it look at the path rather than the host. The host has been changing a few times in the past already, so I figured using just the path for identification would be more reliable, and it appears that still holds true.

https://github.com/Ennea/warp-journal/blob/49d1aabb7d9a57cff3247f46924f43f2631d060a/warp_journal/url_util.py#L24

Unfortunately, I'm not in a position currently to create a release for Windows since I restructured the code. Would need to spent a bit of time on that that I currently do not have or want to spend.

technizor commented 2 months ago

I checked out the master branch commit and this is not the case. It is still using the hardcoded API base URL.

https://github.com/Ennea/warp-journal/blob/49d1aabb7d9a57cff3247f46924f43f2631d060a/warp_journal/client.py#L40

Retrieving the token works correctly, but applying it does not work anymore because the previous endpoint was deprecated since HSR 2.4 came out.

technizor commented 2 months ago

Unfortunately, I'm not in a position currently to create a release for Windows since I restructured the code. Would need to spent a bit of time on that that I currently do not have or want to spend.

I just set up a Python 3 dev environment on Windows (not fun TBH), and with some changes, it works when run through poetry run warp-journal, but when I run it thorugh the generated installer made by MakeNSIS, it silently fails.

FichteFoll commented 2 months ago

You're right, I didn't consider that we might be using a hard-coded URL to make the actual requests. Switching to the parsed one is definitely a better idea. I'll take a look at your PR some time later.