genshin.py
genshin.py copied to clipboard
Cannot get CharacterRanks data from client.get_spiral_abyss() if I don't browse the Hoyolab app first
How to reproduce:
- Finish any floor of abyss
- Wait and don't open Hoyolab app or website
- Use
client.get_spiral_abyss()
function - The CharacterRanks is empty. Everything else works.
- After you browse Hoyolab app or website, the CharacterRanks will show normally when using
client.get_spiral_abyss()
Example
data = await client.get_spiral_abyss(826263929)
print(data)
SpiralAbyss(unlocked=False, season=48,
start_time=datetime.datetime(2022, 6, 15, 20, 0, tzinfo=datetime.timezone.utc),
end_time=datetime.datetime(2022, 6, 30, 19, 59, 59, tzinfo=datetime.timezone.utc),
total_battles=6, total_wins='6', max_floor='10-3', total_stars=18,
ranks=CharacterRanks(most_played=[], most_kills=[], strongest_strike=[], most_damage_taken=[], most_bursts_used=[], most_skills_used=[]),
floors=[Floor(floor=9, unlocked=True, stars=9, max_stars=9, chambers=[
Chamber(chamber=1, stars=3, max_stars=3, battles=[Battle(half=1, timestamp=datetime.date(2022, 6, 16), characters=[AbyssCharacter(id=10000046, name='Hu Tao', element='Pyro', rarity=5,
.....
Do they show up immediately after doing the floor and checking the hoyolab app? There used to be a 1-hour delay.
yeah, CharacterRanks show up immediately after I open the hoyolab website.
the time between my bot commands is about 1 minute
This sounds very annoying to debug but I'll see what I can do.
I found the requests are after getGameRecordCard.
I use another UID and the CharacterRanks is empty.
await client.get_record_cards()
data = await client.get_spiral_abyss(client.uid)
print(data.ranks)
After client.get_record_cards()
, the result can show CharacterRanks correctly now.
Guess this should be documented. I don't want to force users to make an extra request arbitrarily.