Update simple1.py

Import oath
This commit is contained in:
Ryan K. Lee authored and Stephane Bruckert committed 2020-01-11 19:54:21 +00:00
1 parent a677267bca
commit 0c453c9945
1 file changed
+5 -4
+5 -4
View File
@@ -1,14 +1,15 @@
import spotipy import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
birdy_uri = 'spotify:artist:2WX2uTcsvV5OnS0inACecP' birdy_uri = 'spotify:artist:2WX2uTcsvV5OnS0inACecP'
spotify = spotipy.Spotify() client_credentials_manager = SpotifyClientCredentials()
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
results = spotify.artist_albums(birdy_uri, album_type='album') results = sp.artist_albums(birdy_uri, album_type='album')
albums = results['items'] albums = results['items']
while results['next']: while results['next']:
results = spotify.next(results) results = sp.next(results)
albums.extend(results['items']) albums.extend(results['items'])
for album in albums: for album in albums: