Compare commits
5 Commits
impliment_
...
cbde52eb59
| Author | SHA1 | Date | |
|---|---|---|---|
| cbde52eb59 | |||
| 883f594f4f | |||
| c5ffadd1f0 | |||
| 485b565a3f | |||
| 386f17779b |
@@ -32,6 +32,12 @@ def get_image(mb_id, ftv_api_key, artist_path):
|
|||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
with open(os.path.join(artist_path, 'artist.jpg'), 'wb') as f:
|
with open(os.path.join(artist_path, 'artist.jpg'), 'wb') as f:
|
||||||
f.write(response.content)
|
f.write(response.content)
|
||||||
|
elif ('artistbackground' in ftv_data):
|
||||||
|
art_url = ftv_data['artistbackground'][0]['url']
|
||||||
|
response = requests.get(art_url)
|
||||||
|
if (response.status_code == 200):
|
||||||
|
with open(os.path.join(artist_path, 'artist.jpg'),'wb') as f:
|
||||||
|
f.write(response.content)
|
||||||
elif ('hdmusiclogo' in ftv_data):
|
elif ('hdmusiclogo' in ftv_data):
|
||||||
art_url = ftv_data['hdmusiclogo'][0]['url']
|
art_url = ftv_data['hdmusiclogo'][0]['url']
|
||||||
response = requests.get(art_url)
|
response = requests.get(art_url)
|
||||||
|
|||||||
@@ -39,4 +39,4 @@ for artist in dir_list:
|
|||||||
print(e)
|
print(e)
|
||||||
|
|
||||||
count += 1
|
count += 1
|
||||||
sleep(1)
|
#sleep(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user