spotify-tui: Exceeded API request limit
I keep getting
Error: Exceeded API request limit - please wait x seconds
when interacting with the tui or through spt pb. Am I doing something wrong?
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 11
- Comments: 28 (10 by maintainers)
I got around to putting up #852 which should resolve this issue 🎉
I’ve been leaving the TUI open 24/7 (usually idle, not playing) in a tmux session. I’m guessing that if you leave a track paused with the TUI open, the playback information keeps being retrieved on some interval.
I’m surprised more people haven’t run into this problem, considering this github issue is a few months old now. Is it more likely something in my configuration/environment?
@Septem151 My PR was just merged so you should be able to switch back the official repo (don’t think it’s part of any release yet so you’ll have pull down the master branch yourself).
Thanks to @alejandro-angulo this is now fixed and released in v0.25!
I will do some testing tomorrow and hopefully cut a new release with @alejandro-angulo 's fix!
If it helps I’m also hitting this and most of the requests seem to be also
/v1/me/player. (up to 63181 times on one day)I’m running into the API limits as well except I have not used
spt pbwhatsoever. I’ve been using the client normally with spotifyd, without any status bar scripts or anything like that. I checked my spotify developer dashboard and the requests tov1/me/playerare causing the problem.Fantastic! I also just started using spt yesterday, and I was using it like normal (have it open to “simple playback” mode to show the song, playing music for roughly 3 hours) and after that time, I started getting the API quota exceeded warning from Spotify. I checked the Spotify dashboard and this was the result:
All those requests to /v1/me/player (28,640 of them) within a matter of roughly 3 hours of normal usage (songs constantly playing in the background, showing information about the currently playing song).
I seriously hope this PR gets merged ASAP. In the meantime, I’ll probably start using your fork.
Ah interesting. I’ve not run into this myself but definitely sounds like a problem - sorry to hear it!
I’m afraid I don’t have to much spare time to work on this at the moment - so any help here would be appreciated.
I’m experiencing this as well. I believe it’s just a limitation that Spotify puts on their API requests. I am not entirely sure what approach I’m going to use to figure out how to fix this. I may wrap my usage of
spt pbin an interval function which only runs if a certain amount of time between the last run has passed? I’m not entirely sure how I will implement this.I know I ran into this issue because I was calling
spt pbin my Tmuxline every second in order to output what song was playing. I am considering usingspotifydand it’s eventon_song_change_hookto unblock thespt pbcall to leverage the API rather than the local file I will generate on the first call ofspt pb.As I stated before, I’m not sure if it’s in scope of this repository. Perhaps the only thing I can think of is that
spt pbchecks for theRetry-Afterheader and makes sure it doesn’t issue any requests until after that time. I believe that hitting the API within your time window Spotify replies with resets how long you have to wait for all over again, but I haven’t done testing of that hypothesis.