Last active
March 6, 2020 11:00
-
-
Save makispl/55ae62156f4f9e4afad033f7fe7b7796 to your computer and use it in GitHub Desktop.
Authorization Flow
This file contains 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
# 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