mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 01:03:53 +00:00
17 lines
390 B
Python
17 lines
390 B
Python
# shows artist info for a URN or URL
|
|
|
|
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'])
|