mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-27 00:25:54 +03:00
[GH-ISSUE #1085] Spotipy stops extracting API data without giving an error code and renders credentials unusable #645
Labels
No labels
api-bug
bug
dependencies
documentation
duplicate
enhancement
external-ide
headless-mode
implicit-grant-flow
invalid
missing-endpoint
pr-welcome
private-api
pull-request
question
spotipy3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/spotipy#645
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @omendo-galeo on GitHub (Apr 9, 2024).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1085
I am trying to extract information about artists, albums and songs. The problem comes when after one iteration (approximately 1000 songs, 1000 albums and 1200 artists), the API stops working, but without returning a 429 error code or anything, it just waits, so I can't handle exceptions of any kind.
I have tried to make a custom session of requests to prevent it from staying in the retry state indefinitely but it does not react.
This code is only to extract tracks info:
I need to know how to keep getting data from the API without the credentials being unusable, since doing calculations, the ratelimit that Spotify says is not exceeded. Otherwise, I need the API to return an error code to handle the exception and be able to pivot between multiple credentials.
After a complete and successful execution, I re-launch the script and at one point, the API stops at this point and does not return any errors. I re-launch the script with the same credentials, and it does not start, as they have been unusable for at least 24 hours.
Environment:
Additional context
Add any other context about the problem here.
@tedwenn commented on GitHub (Apr 21, 2024):
I'm having the same issue with
sp.album_tracks(). It just stops without returning any error. When I try stepping into function with the debugger, it never actually gets there. It just waits.@dieser-niko commented on GitHub (Apr 22, 2024):
If the script just freezes out of the blue, then it is probably because of Spotify's rate limit.
@tedwenn commented on GitHub (Apr 24, 2024):
Yeah, it's a rate limit issue. When I try just calling the API directly using
requests, I get a 429. Something about how spotipy is wrapping the API is stalling, rather than returning the 429.@dieser-niko commented on GitHub (Apr 24, 2024):
If you want to stop the freezing, you can do something similar to this: https://github.com/spotipy-dev/spotipy/issues/766#issuecomment-1005102900
Edit: I've gotta admit, I don't know how the script will behave. My guess is that it's going to raise some kind of ratelimit error
@dieser-niko commented on GitHub (Jul 10, 2024):
I'm going to close this issue, as there's no activity.
Also just a heads up, we are going to release some changes that include a warning when a request/rate limit is reached. This might help you to optimize your application.
SpotifyClientCredentialsand fixed a bug in refresh tokens methods that raised the wrong exception #982