reko-beep / hsr-data

Honkai star rail data from starrailstation.com
MIT License
59 stars 13 forks source link

removed sleep() from fetch data loop #8

Closed rfdzan closed 1 year ago

rfdzan commented 1 year ago

is this to prevent rate-limiting? i realized the program sends a get request to an api of some sort with changing id number

I only ran this once if its of concern.

cuts down raw_data.py runtime to 1 minute, from 25 minutes (on a desktop 5600G)

reko-beep commented 1 year ago

It was to prevent rate limit. And, yes, SRS uses some hashed routes for api requests. Client creates hashed path for item data.

Example, material id is 2000. It will create a hashed path for en/materials/2000.json. make a request to https://starrailstation.com/O_VALUE/{HASHED_PATH}

see constants.py for O_VALUE

Should not be problem in removing sleep(2)eitherway, as its cached.