spotipy-dev / spotipy

A light weight Python library for the Spotify Web API
http://spotipy.readthedocs.org
MIT License
5.04k stars 958 forks source link

spotify package doesn't work #799

Open ZoeLeung2021 opened 2 years ago

ZoeLeung2021 commented 2 years ago

Describe the bug In the morning I can get the output from the below code, but at night when I clear all the output and start again, it keeps running and last for more than 3 hours but did not appear any output. I have tried using my local environment, faculty as well as google colab, all come across the same problem. The thing is I cannot even import spotify package now.

Your code !pip install spotipy import spotipy from spotipy.oauth2 import SpotifyClientCredentials

client_credentials_manager = SpotifyClientCredentials(client_id=CLIENT_ID, client_secret=CLIENT_SECRET) sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)

artist_id=[] for i in spotify_id_list: artist_id.append(sp.track(i)["artists"][0]["id"])

audio_features=[] for i in spotify_id_list: audio_features.append(sp.audio_features(i)[0])

Peter-Schorn commented 2 years ago

You need to find the function in which the code freezes. Can you do that?

ZoeLeung2021 commented 2 years ago

Yes. It’s the sp.track(i) and sp.audio_features(i) that freeze. I am thinking if rate limit also apply for the Spotify package?

Peter-Schorn commented 2 years ago

Yes the rate limit applies when using spotipy because it's merely a wrapper around the Spotify web API. But if your requests are rate-limited, then the code won't freeze; instead, you'll get an error response.

You need to find the method within track and audio_features that freezes.

Do you not know how to step through code in the debugger?

The information you've provided thus far is hopelessly inadequate for solving your issue.

williamxnguyen commented 2 years ago

Wow Peter