zeropingheroes / lancache-autofill

Automatically fill a Lancache with content
GNU General Public License v3.0
132 stars 24 forks source link

new steamAPI needs ratelimiting detection #32

Closed billthecatt closed 4 years ago

billthecatt commented 4 years ago

I keep running into this when I'm going through user lists and trying to populate the cache:

In Client.php line 180:

Client error: GET http://api.steampowered.com/IPlayerService/GetRecentlyPlayedGames/v0001/?key=6B264EE334F3233E1B5511D63D0C60D1&format=json&input_json=%7B%22steamId%22%3A %2276561197970845665%22%7D resulted in a 429 Too Many Requests response:

429 Too Many Requests

Too Many Requests

In RequestException.php line 113:

Client error: GET http://api.steampowered.com/IPlayerService/GetRecentlyPlayedGames/v0001/?key=6B264EE334F3233E1B5511D63D0C60D1&format=json&input_json=%7B%22steamId%22%3A %2276561197970845665%22%7D resulted in a 429 Too Many Requests response:

429 Too Many Requests

Too Many Requests

Anyway, would it be possible to create an exception on error 429 from the api call? And then have this enable a holdtown timer and have the script wait x seconds before trying again?

Thanks,

billcat

ilumos commented 4 years ago

I've implemented rate limiting to match Steam's 200 requests every 5 minutes, and in testing all seems well.