mirror of
https://github.com/cooperhammond/irs.git
synced 2024-12-31 18:55:28 +00:00
Added a catch for album art.
This commit is contained in:
parent
9c171efb12
commit
afac16a0bf
|
@ -317,8 +317,11 @@ class Manager:
|
|||
if tracknum:
|
||||
mp3.add_track_number(tracknum)
|
||||
|
||||
image_url = mp3.add_album_art(self.get_album_art(artist, mp3.get_attr('album')))
|
||||
exclaim_good("Album art: ", image_url)
|
||||
try:
|
||||
image_url = mp3.add_album_art(self.get_album_art(artist, mp3.get_attr('album')))
|
||||
exclaim_good("Album art: ", image_url)
|
||||
except Exception:
|
||||
print (bc.FAIL + "Album art not added." + bc.ENDC)
|
||||
|
||||
|
||||
print (color(song, ["BOLD", "UNDERLINE"]) + bc.OKGREEN + ' downloaded successfully!'+ bc.ENDC)
|
||||
|
|
|
@ -107,19 +107,22 @@ class Metadata:
|
|||
pass
|
||||
|
||||
if not image_url:
|
||||
image_url = self.get_album_art(self.args.artist, self.mp3["album"][0])
|
||||
image_url = self.get_album_art(self.artist, self.mp3["album"][0])
|
||||
|
||||
mp3.tags.add(
|
||||
APIC(
|
||||
encoding = 3,
|
||||
mime = 'image/png',
|
||||
type = 3,
|
||||
desc = 'cover',
|
||||
data = urlopen(image_url).read()
|
||||
try:
|
||||
mp3.tags.add(
|
||||
APIC(
|
||||
encoding = 3,
|
||||
mime = 'image/png',
|
||||
type = 3,
|
||||
desc = 'cover',
|
||||
data = urlopen(image_url).read()
|
||||
)
|
||||
)
|
||||
)
|
||||
mp3.save()
|
||||
return image_url
|
||||
mp3.save()
|
||||
return image_url
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
def search_google(self, search_terms=""):
|
||||
|
|
Loading…
Reference in a new issue