-
Notifications
You must be signed in to change notification settings - Fork 960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
500
error code in sp.audio_features()
reported as 429
#805
Comments
Btw. those ids also return
(It is an ASMR album with ultrasonic sounds) |
What makes you so sure that Have you used the debugger to determine that spotipy returns a rate-limited error even when the raw network response from the requests module contains a |
Hey. I checked what error code is returned when requesting same url using same token using Spotify’s console and then also using Postman. It returns 500 in both cases. Spotipy returns 429 (same token, same url, before and after I tested in console). It’s super easy to check using code samples and IDs I provided. |
I got the same issue and error (max retries) when feeding a list of songs, and when searching for it (by link in browser and the URI ofc.) it said it was unavailable, however it was not a local song and I got the song info for it when requesting a playlist of songs. My thought is it might just not be available in your market. My solution after trying multiple fixes is to just if you want to also fetch other songs, do a try except, and just ignore the one that doesn't work. It's not rate limiting, at least not in my case, because all songs except some few ones don't work, and the try except allows me to fetch multiple other songs and just skip these that are retrying. |
I was unable to reproduce the rate-limited error with any of the ids although I did get a 500 error with all of these ids. I don't know why this error is returned for certain tracks, but it's clear that this is not due to an issue on spotipy's end because I get the same error when I make the request in Postman. You'll have to ask about this on the Spotify Developer Forums.
Rate limiting is applied on a per-developer application basis, not a per-access token basis, so try creating a new developer application (which means you'll get a new client id and client secret) and then use this application with spotipy only for a single request. Can you still reproduce the rate-limited error? |
Thank you for your answers, I appreciate your time.
Yes. But I don't mind 500s from Spotify for some IDs - it happens, it is ok. But I would like Spotipy to show me it was a 500 on Spotify's end and not 429. This code (assuming you have your env
Results in
Btw. I am working with several applications and CLIENT_IDs, I am sure I am not hitting rate limits (triple checked). |
@Peter-Schorn where you able to reproduce it? I am willing to help. |
Hello @Peter-Schorn, I've just had the same thing happen to me and see it reported here as well: home-assistant/core#88547 spotify.playlist_upload_cover_image(created_playlist_id, base64_image) gives
This was definitely not a rate-limit because it was the first call in several hours. Any ideas why it's being reported as 429? Thanks! |
Describe the bug
500
error code insp.audio_features()
reported as429
Your code
For this particular ID, https://developer.spotify.com/console/get-audio-features-several-tracks/ returns 500.
Spotipy returns:
Expected behavior
I would expect Spotipy to show me that it is a
500
error code. So I could debug and verify which ID is causing the issue on Spotify's side. When I am getting429
I am assuming it is a limit error.Environment:
Additional context
The request exception is caught here: https://github.com/plamere/spotipy/blob/9a627e88f422927822ce39ae9919cc7ab9813dde/spotipy/client.py#L274
And then it is raising
429
here: https://github.com/plamere/spotipy/blob/9a627e88f422927822ce39ae9919cc7ab9813dde/spotipy/client.py#L281The text was updated successfully, but these errors were encountered: