genshin-wishes-api
genshin-wishes-api copied to clipboard
Problem in fetching/saving wishes (2.3+)
The usual link copy from feedback does not work on fetching/saving wishes.
/api/wishes/importState/ does provide factual information from Mihoyo's server (pulled 1 pull and 11 pulls on standard banner and weapon banner, respectively), shown in the JSON below:
{
"PERMANENT":{"bannerType":"PERMANENT","count":1,"finished":false,"saved":false,"error":"ERROR"},
"CHARACTER_EVENT":{"bannerType":"CHARACTER_EVENT","count":0,"finished":false,"saved":false,"error":"ERROR"},
"NOVICE":{"bannerType":"NOVICE","count":0,"finished":true,"saved":false,"error":"ERROR"},
"WEAPON_EVENT":{"bannerType":"WEAPON_EVENT","count":11,"finished":true,"saved":false,"error":"ERROR"}
}
Is there anything we can do to help? I know nothing about how Mihoyo's APIs work, but if you could explain the issue a little I could try investigating a bit.
So, I investigated a bit, and the only issue I could find is that sometimes the call to /event/gacha_info/api/getGachaLog
returns -110: visit too frequently
.
I added a Thread.sleep
and it seems to be working, something along this inside MihoyoRestClient.getWishes
:
if (ret.getRetcode() == -110) {
Thread.sleep(4000);
return getWishes(authkey, gameBiz, banner, lastWishId, page);
}
I'm not creating a PR as my local code is a mess right now (I'm not a Java dev, and I've never used Spring, so I had to be "creative" to make it run); moreover, I'm not sure this is a proper fix, as the solution seems too simple to me 😅 the only thing I can say is that, after this change, I can see all my wishes in the database.
Hi, sorry for my lack of availability lately, the thing is that this would work for one user but not many We need to add a queue system to avoid having too many imports at the same time
It depends on whether they rate limit on the IP or on the user, but yeah, a queue would for be the safest route...
Thank you for looking into it!