mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 01:03:53 +00:00
* added URI link to README getting started * revised comment * added alternate module installation instruction * installation troubleshooting comment * scope clarification comment * added playlist_add_items.py to examples folder * reformatted changelog edits * Relocated added contributions to added section in Changelog * removed unnecessary library installation instruction * Clarified alternative installation instruction
18 lines
432 B
Python
18 lines
432 B
Python
# shows artist info for a URN or URL
|
|
# scope is not required for this function
|
|
|
|
from spotipy.oauth2 import SpotifyClientCredentials
|
|
import spotipy
|
|
import sys
|
|
|
|
if len(sys.argv) > 1:
|
|
urn = sys.argv[1]
|
|
else:
|
|
urn = 'spotify:artist:3jOstUTkEu2JkjvRdBA5Gu'
|
|
|
|
sp = spotipy.Spotify(client_credentials_manager=SpotifyClientCredentials())
|
|
response = sp.artist_top_tracks(urn)
|
|
|
|
for track in response['tracks']:
|
|
print(track['name'])
|