-
-
Save TheMuellenator/c84616c21f0f9ce68c12c357d3e1c794 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.playlist_add_items(playlist_id=playlist["id"], items=song_uris) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of October 2025, this code is working as attended for everyone reference
I believe struggling to understand the API document is a benefit, Learning happen best when struggling lol.