-
-
Save angelabauer/aff0704750052c739fba85dfa55a72c2 to your computer and use it in GitHub Desktop.
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: None
I got this error please help!
spotipy.exceptions.SpotifyException: http status: 403, code:-1 - You cannot create a playlist for another user., reason: None
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.
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.
I really enjoyed this challenge, Angela, thank you.
I came up with a version that is slightly different by giving the user the option to choose between two playlists: one that covers the tracks with its original performers (- less tracks covered) and another one that does not (+ more tracks covered). My version is here.