-
-
Save angelabauer/aff0704750052c739fba85dfa55a72c2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sp = spotipy.Spotify( | |
auth_manager=SpotifyOAuth( | |
scope="playlist-modify-private", | |
redirect_uri="http://example.com", | |
client_id=YOUR UNIQUE CLIENT ID, | |
client_secret= YOUR UNIQUE CLIENT SECRET, | |
show_dialog=True, | |
cache_path="token.txt" | |
) | |
) | |
user_id = sp.current_user()["id"] | |
date = input("Which year do you want to travel to? Type the date in this format YYYY-MM-DD: ") | |
song_uris = ["The list of", "song URIs", "you got by", "searching Spotify"] | |
playlist = sp.user_playlist_create(user=user_id, name=f"{date} Billboard 100", public=False) | |
# print(playlist) | |
sp.user_playlist_add_tracks(user=user_id, playlist_id=playlist["id"], tracks=song_uris) |
I got this error please help!
spotipy.exceptions.SpotifyException: http status: 403, code:-1 - You cannot create a playlist for another user., reason: NoneHad the same error, in: playlist = sp.user_playlist_create(user=user_id, name=f"{date} Billboard 100", public=False) I was using the "client_id" instead of the "user_id", make sure you are not mixing the two as well.
Thank you so much, that was issue.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Had the same error,
in:
playlist = sp.user_playlist_create(user=user_id, name=f"{date} Billboard 100", public=False)
I was using the "client_id" instead of the "user_id", make sure you are not mixing the two as well.