Skip to content

Instantly share code, notes, and snippets.

@makispl
Last active March 6, 2020 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makispl/55ae62156f4f9e4afad033f7fe7b7796 to your computer and use it in GitHub Desktop.
Save makispl/55ae62156f4f9e4afad033f7fe7b7796 to your computer and use it in GitHub Desktop.
Authorization Flow
# Declare the credentials
cid = 'XXXX'
secret = 'XXXX'
redirect_uri='http://localhost:7777/callback'
username = 'XXXX'
# Authorization flow
scope = 'user-top-read'
token = util.prompt_for_user_token(username, scope, client_id=cid, client_secret=secret, redirect_uri=redirect_uri)
if token:
sp = spotipy.Spotify(auth=token)
else:
print("Can't get token for", username)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment