Merge branch 'master' into ratelimiting

This commit is contained in:
20xd6 2024-10-14 11:17:37 -04:00
commit cbde52eb59

View File

@ -32,6 +32,12 @@ def get_image(mb_id, ftv_api_key, artist_path):
if response.status_code == 200:
with open(os.path.join(artist_path, 'artist.jpg'), 'wb') as f:
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):
art_url = ftv_data['hdmusiclogo'][0]['url']
response = requests.get(art_url)