mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-04-26 16:15:51 +03:00
[GH-ISSUE #1028] ReadTimeout error when using recommendations functions #614
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#614
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 @ftrichardson on GitHub (Sep 30, 2023).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/1028
Describe the bug
Over the past week, I've frequently encountered the following timeout error when using the functions
sp.recommendations_genre_seeds()orsp.recommendations()in my code:HTTPSConnectionPool(host='api.spotify.com', port=443): Read timed out. (read timeout=5)I have tried increasing requests_timeout and retries and using different API keys, but more often than not my code still times out when its get to these functions. And no other spotipy functions are yielding this problem when used.
Your code
This is how my code uses those functions:
genres = sp.recommendation_genre_seeds()tracklist = sp.recommendations(seed_genres = disliked_genres, limit=100)['tracks']For the latter, the length of disliked_genres is never greater than 5
Expected behavior
I know I'm using the functions correctly because occasionally I won't receive a timeout error and they'll output what I am looking for. And my program works as expected every time I don't get this timeout error.
Output
Environment:
OS: Mac
Python version: 3.10.9
spotipy version: 2.23.0
@kinkyninja commented on GitHub (Oct 1, 2023):
Same bug on my VPS.
No bug on my local computer with different internet provider.
@ftrichardson commented on GitHub (Oct 1, 2023):
Thank you! The issue was with my internet provider. I tried on my mobile hotspot and it's working perfectly.