mirror of
https://github.com/c0de-archive/spotipy-experiments.git
synced 2024-12-22 09:42:39 +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],)
|
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()
|
track = item['track']
|
||||||
for item in results['items']:
|
print track['name'] + ' - ' + track['artists'][0]['name']
|
||||||
track = item['track']
|
|
||||||
print track['name'] + ' - ' + track['artists'][0]['name']
|
|
||||||
else:
|
|
||||||
print "Can't get token for", username
|
|
Loading…
Reference in New Issue
Block a user