[GH-ISSUE #880] Error #539

Closed
opened 2026-02-27 23:23:13 +03:00 by kerem · 2 comments
Owner

Originally created by @ameliameyer on GitHub (Nov 8, 2022).
Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/880

When running:

# create an empty dictionary for the audio features
audio_features = {}
# for the ids in our dataset, find the audio feature values
for idd in liked_songs['id'].tolist():
audio_features[idd] = spotipy_obj.audio_features(idd)[0]

I get the error

ReadTimeout: HTTPSConnectionPool(host='api.spotify.com', port=443): Read timed out. (read timeout=5)

My code was working before but now it's not.

Originally created by @ameliameyer on GitHub (Nov 8, 2022). Original GitHub issue: https://github.com/spotipy-dev/spotipy/issues/880 <!--- Please make sure you've: - read the FAQ https://github.com/plamere/spotipy/blob/master/FAQ.md - read the documentation https://spotipy.readthedocs.io/en/latest/ - searched older issues If your question is about code, please share the code you are using ---> When running: `# create an empty dictionary for the audio features ` `audio_features = {}` `# for the ids in our dataset, find the audio feature values` `for idd in liked_songs['id'].tolist():` ` audio_features[idd] = spotipy_obj.audio_features(idd)[0]` I get the error `ReadTimeout: HTTPSConnectionPool(host='api.spotify.com', port=443): Read timed out. (read timeout=5)` My code was working before but now it's not.
kerem 2026-02-27 23:23:13 +03:00
  • closed this issue
  • added the
    question
    label
Author
Owner

@dieser-niko commented on GitHub (Nov 14, 2022):

Apparently this can happen from time to time. As a workaround, you could use a try except to fetch the ReadTimeout error and then call the function again (either with a while True loop or as mentioned here).

Since this has never happened to me, I can't really test this, so good luck.

<!-- gh-comment-id:1313509915 --> @dieser-niko commented on GitHub (Nov 14, 2022): Apparently this can happen from time to time. As a workaround, you could use a try except to fetch the `ReadTimeout` error and then call the function again (either with a while True loop or as mentioned [here](https://stackoverflow.com/a/66770782)). Since this has never happened to me, I can't really test this, so good luck.
Author
Owner

@dieser-niko commented on GitHub (May 21, 2024):

Closing as there's no activity.

<!-- gh-comment-id:2123466407 --> @dieser-niko commented on GitHub (May 21, 2024): Closing as there's no activity.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotipy#539
No description provided.