scope = "user-library-read user-top-read user-read-private user-read-email"
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(scope=scope))
recommendations = sp.recommendations(seed_genres=['pop'], limit=1)
print(recommendations)
This code was working perfectly earlier, but it randomly stopped working. I have SPOTIPY_CLIENT_ID, SPOTIPY_CLIENT_SECRET, and SPOTIPY_REDIRECT_URI all defined as environment variables. When I run functions such as sp.current_user_top_tracks(), sp.artist(), and others, they all work fine.
When I run sp.recommendations(), nothing gets returned or printed; I get no error message, the program just hangs indefinitely. I have to restart visual studio to be able to run anything again. Again, I was having no issues with sp.recommendations() a few hours ago. I genuinely do not know what happened.
Expected a dictionary to be returned. Instead, it hangs indefinitely and nothing is returned.
Thanks in advance
Charles Kensicki is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.