mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
Update simple2.py
Add import statements for oath
This commit is contained in:
parent
faa5785a29
commit
a677267bca
@ -1,12 +1,14 @@
|
|||||||
|
|
||||||
import spotipy
|
import spotipy
|
||||||
|
from spotipy.oauth2 import SpotifyClientCredentials
|
||||||
|
|
||||||
|
|
||||||
lz_uri = 'spotify:artist:36QJpDe2go2KgaRleHCDTp'
|
lz_uri = 'spotify:artist:36QJpDe2go2KgaRleHCDTp'
|
||||||
|
|
||||||
spotify = spotipy.Spotify()
|
client_credentials_manager = SpotifyClientCredentials()
|
||||||
|
sp = spotipy.Spotify(client_credentials_manager=client_credentials_manager)
|
||||||
|
|
||||||
results = spotify.artist_top_tracks(lz_uri)
|
results = sp.artist_top_tracks(lz_uri)
|
||||||
|
|
||||||
for track in results['tracks'][:10]:
|
for track in results['tracks'][:10]:
|
||||||
print('track : ' + track['name'])
|
print('track : ' + track['name'])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user