dvx / lofi

🎵🔉 A mini Spotify player with WebGL visualizations.
http://lofi.rocks
MIT License
1.18k stars 67 forks source link

Use Web Playback SDK instead of polling to prevent 429 #190

Open stamoun opened 2 years ago

stamoun commented 2 years ago

https://developer.spotify.com/documentation/web-playback-sdk/quick-start/

This most likely would allow Lofi to not trigger any 429, which would be a GREAT improvement.

Would fix the following: #107, #134, #166, #171, #177, #183

stamoun commented 2 years ago

Seems like the web player sdk requires a premium sub. If that is the case, non-premium users won't have anything showing (cover art, volume, seek position, etc.), I need to investigate it properly.

One solution for non-premium users would be to use the current way of retrieving playback info (maybe slow down the polling to 2 seconds). TBD

stamoun commented 1 year ago

This could be another option worth investigating

level42ca commented 6 months ago

Just checking in to see if there's any progress around this change, and or the 429 rate limit?

My LoFi is harassed by rate limits...

Possibly allowing a user defined rate limit instead of 1s, maybe 2s, 5s, or even 10s?

I for one would not be opposed to creating my own API keys to avoid any global rate limits...

Fruit for thought....

image

stamoun commented 6 months ago

We could, in theory allow uses to provide their own API key, not sure it'll help much with the 429 throttling though. The Web SDK replacement is also a major change, but it would allow Lofi to get rid of throttling once and for all (only for premium users though, free accounts will still have to use the REST API and live with the throttling, sadly).