andreztz / pyradios

Client for the Radio Browser API
https://api.radio-browser.info/
MIT License
62 stars 22 forks source link

Try different server in case of http error 429 #73

Open turnbeutelvergesser opened 1 month ago

turnbeutelvergesser commented 1 month ago

I had some 429 return codes when trying to search for a number (not so big, around 10) of stations by UUID. Instead of waiting for "Retry-After" seconds, could you just switch to a different server from the list and retry the request? Maybe randomize the list and advance one position it it when it happens (cyclically)? Then the chance of hitting the overloaded server would be minimized.