mirror of
https://github.com/c0de-archive/spotipy.git
synced 2024-11-05 07:27:47 +00:00
17 lines
333 B
Python
17 lines
333 B
Python
|
import spotipy
|
||
|
import sys
|
||
|
|
||
|
spotify = spotipy.Spotify()
|
||
|
|
||
|
if len(sys.argv) > 1:
|
||
|
name = ' '.join(sys.argv[1:])
|
||
|
else:
|
||
|
name = 'Radiohead'
|
||
|
|
||
|
results = spotify.search(q='artist:' + name, type='artist')
|
||
|
items = results['artists']['items']
|
||
|
if len(items) > 0:
|
||
|
artist = items[0]
|
||
|
print artist['name'], artist['images'][0]['url']
|
||
|
|