Skip to content
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

I don't know is this a bug or error in the (working_notebook.ipynb) #109

Open
shreesha345 opened this issue Sep 3, 2021 · 1 comment
Open

Comments

@shreesha345
Copy link

shreesha345 commented Sep 3, 2021

when I run the last line this one 👇
playlist_recs =sp.user_playlist_create(username,name='PCA + tf-idf + DT - Recommended Songs for Playlist - {}'.format(sourcePlaylist['name']))

I get the HTTP error in that saying this:-

--------------------------------------------------------------------
HTTPError                          Traceback (most recent call last)
d:\spotify-recommender-systems\packs\lib\site-packages\spotipy\client.py in _internal_call(self, method, url, payload, params)
    244 
--> 245             response.raise_for_status()
    246             results = response.json()

d:\spotify-recommender-systems\packs\lib\site-packages\requests\models.py in raise_for_status(self)
    952         if http_error_msg:
--> 953             raise HTTPError(http_error_msg, response=self)
    954 

HTTPError: 403 Client Error: Forbidden for url: https://api.spotify.com/v1/users/Shreeshaaithal/playlists

During handling of the above exception, another exception occurred:

SpotifyException                   Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_2708/1131807193.py in <module>
----> 1 playlist_recs =sp.user_playlist_create(username,name='PCA + tf-idf + DT - Recommended Songs for Playlist - {}'.format(sourcePlaylist['name']))

d:\spotify-recommender-systems\packs\lib\site-packages\spotipy\client.py in user_playlist_create(self, user, name, public, collaborative, description)
    782         }
    783 
--> 784         return self._post("users/%s/playlists" % (user,), payload=data)
    785 
    786     def user_playlist_change_details(

d:\spotify-recommender-systems\packs\lib\site-packages\spotipy\client.py in _post(self, url, args, payload, **kwargs)
    300         if args:
    301             kwargs.update(args)
--> 302         return self._internal_call("POST", url, payload, kwargs)
    303 
    304     def _delete(self, url, args=None, payload=None, **kwargs):

d:\spotify-recommender-systems\packs\lib\site-packages\spotipy\client.py in _internal_call(self, method, url, payload, params)
    270                 "%s:\n %s" % (response.url, msg),
    271                 reason=reason,
--> 272                 headers=response.headers,
    273             )
    274         except requests.exceptions.RetryError as retry_error:

SpotifyException: http status: 403, code:-1 - https://api.spotify.com/v1/users/Shreeshaaithal/playlists:
 You cannot create a playlist for another user., reason: None

please help 🙏
all the API token is mine but still this is giving me an error please help me.

@github-actions
Copy link

github-actions bot commented Sep 3, 2021

Note : Issue is still open to others. Only a merged PR is evaluated as a contribution, till then it is open to all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant