Open phantom2152 opened 3 years ago
Read the documentation: https://spotipy.readthedocs.io/en/2.18.0/#client-credentials-flow
The .get_access_token()
method returns a JSON object, to get the acess_token
inside the object, you have to do this:
spo = Spotify(auth=re['access_token'])
spo = Spotify(auth=re['access_token'])
While this works, it is not recommended because the access token will not be automatically refreshed when it expires after an hour. As shown in the README, this is how you should initialize Spotify
:
sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id="YOUR_APP_CLIENT_ID",
client_secret="YOUR_APP_CLIENT_SECRET",
redirect_uri="YOUR_APP_REDIRECT_URI",
scope="user-library-read"))
Elements of answer provided here https://github.com/plamere/spotipy/issues/828#issuecomment-1156641256
Hey I was getting info about a single track while I got this error
my code is
And I am getting following error