mirror of
https://github.com/c0de-archive/spotipy-experiments.git
synced 2024-12-22 01:32:40 +00:00
update to use new authorize method
This commit is contained in:
parent
a469ce59e9
commit
2c394bc45a
@ -10,13 +10,9 @@ else:
|
||||
print "Usage: %s username" % (sys.argv[0],)
|
||||
sys.exit()
|
||||
|
||||
token = util.prompt_for_user_token(username, scope)
|
||||
sp = util.authorize_api(username, scope, 'server')
|
||||
|
||||
if token:
|
||||
sp = spotipy.Spotify(auth=token)
|
||||
results = sp.current_user_saved_tracks()
|
||||
for item in results['items']:
|
||||
track = item['track']
|
||||
print track['name'] + ' - ' + track['artists'][0]['name']
|
||||
else:
|
||||
print "Can't get token for", username
|
||||
results = sp.current_user_saved_tracks()
|
||||
for item in results['items']:
|
||||
track = item['track']
|
||||
print track['name'] + ' - ' + track['artists'][0]['name']
|
Loading…
Reference in New Issue
Block a user