-
Notifications
You must be signed in to change notification settings - Fork 957
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
recommendations timeout #946
Comments
It works when you limit number of provided seed tracks to 5 or less though? spotipy.recommendations function specifies that If i understand correctly this is intended behaviour that you can't provide more then 5 tracks/artists/genres |
I will provide a list of one seed and still get a time out. This was working before without a code change or updating spotipy so I imagine there is some issue on Spotify's side (is it rate limiting just this call (the others are fine)? Is it having an issue finding a recommendation?) I even lowered the limit from 20 (where it used to work) to 3 and it still times out. An even bigger problem is I can not get the requests_timeout to be honored so my application freezes a long time waiting for the timeout. scope = "user-read-playback-state,user-modify-playback-state,user-library-modify,user-follow-modify"#
sp = spotipy.Spotify(client_credentials_manager=SpotifyOAuth(username='XXXXXXXXX', scope=scope),requests_timeout=15)
# and one of my recommendation calls:
try:
recommendations = sp.recommendations(seed_artists=[artist_id], limit=10)
for track in recommendations['tracks']:
if not filter_results or track['uri'] not in list(songs_df):
songs.append(track['uri'])
except:
print('could not get song recommendations') |
You could try out the same request on the Web API Documentation, just to make sure that this is not caused by the library. |
Describe the bug
Whenever I try to use the recommendations function I get this error:
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='api.spotify.com', port=443): Read timed out. (read timeout=5)
I've tried at different times because I thought the Spotify servers might be messed up rn but it keeps happening with new code and different parameters.
Your code
only one of many examples:
Expected behavior
doesn't Time out
Output
Environment:
The text was updated successfully, but these errors were encountered: