Get Spotify images for the artists that are similar to weezer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyen | |
import spotipy | |
import sys | |
''' | |
get a set of images for artists that are similar to | |
the given seed artist | |
''' | |
en = pyen.Pyen() | |
sp = spotipy.Spotify() | |
spids = [] | |
response = en.get('artist/similar', name='weezer', bucket='id:spotify', limit=True) | |
for artist in response['artists']: | |
spids.append(artist['foreign_ids'][0]['foreign_id']) | |
for artist in sp.artists(spids)['artists']: | |
print artist['images'][0]['url'], artist['name'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment