update to use new authorize method

This commit is contained in:
David Todd 2018-04-24 23:37:46 -05:00
parent a469ce59e9
commit 2c394bc45a

View File

@ -10,13 +10,9 @@ else:
print "Usage: %s username" % (sys.argv[0],) print "Usage: %s username" % (sys.argv[0],)
sys.exit() sys.exit()
token = util.prompt_for_user_token(username, scope) sp = util.authorize_api(username, scope, 'server')
if token: results = sp.current_user_saved_tracks()
sp = spotipy.Spotify(auth=token) for item in results['items']:
results = sp.current_user_saved_tracks()
for item in results['items']:
track = item['track'] track = item['track']
print track['name'] + ' - ' + track['artists'][0]['name'] print track['name'] + ' - ' + track['artists'][0]['name']
else:
print "Can't get token for", username