From 0c453c9945e4412574492f0e8330a701e01184b8 Mon Sep 17 00:00:00 2001 From: "Ryan K. Lee" Date: Mon, 15 Jul 2019 15:36:31 -0700 Subject: [PATCH] Update simple1.py Import oath --- examples/simple1.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/simple1.py b/examples/simple1.py index 1748b24..e9c0fb7 100644 --- a/examples/simple1.py +++ b/examples/simple1.py @@ -1,14 +1,15 @@ import spotipy - +from spotipy.oauth2 import SpotifyClientCredentials 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'] while results['next']: - results = spotify.next(results) + results = sp.next(results) albums.extend(results['items']) for album in albums: