spotipy/examples/search.py

15 lines
242 B
Python
Raw Normal View History

2014-05-09 07:34:08 +00:00
# shows artist info for a URN or URL
import spotipy
import sys
import pprint
if len(sys.argv) > 1:
search_str = sys.argv[1]
2014-05-09 07:34:08 +00:00
else:
search_str = 'Radiohead'
2014-05-09 07:34:08 +00:00
sp = spotipy.Spotify()
result = sp.search(search_str)
2014-05-09 07:34:08 +00:00
pprint.pprint(result)