Skip to content

Instantly share code, notes, and snippets.

@forslund
Last active October 30, 2020 13:21
Show Gist options
  • Save forslund/8a2045aaf7c1244d35920c67b3e22930 to your computer and use it in GitHub Desktop.
Save forslund/8a2045aaf7c1244d35920c67b3e22930 to your computer and use it in GitHub Desktop.
import spotipy
from spotipy.util import prompt_for_user_token
CLIENT_ID = 'YOUR CLIENT ID'
CLIENT_SECRET = 'YOUR_SECRET'
USERNAME = 'YOUR USERNAME'
REDIRECT_URI = 'https://localhost:8888'
SCOPE = 'user-library-read streaming playlist-read-private user-top-read user-read-playback-state'
am = prompt_for_user_token(client_id=CLIENT_ID, client_secret=CLIENT_SECRET,
redirect_uri=REDIRECT_URI, scope=SCOPE, username=USERNAME)
sp = spotipy.Spotify(auth_manager=am)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment