Added a catch for album art.

This commit is contained in:
Kepoor Hampond 2017-01-17 19:57:48 -08:00
parent 9c171efb12
commit afac16a0bf
3 changed files with 20 additions and 14 deletions

View file

@ -317,8 +317,11 @@ class Manager:
if tracknum: if tracknum:
mp3.add_track_number(tracknum) mp3.add_track_number(tracknum)
try:
image_url = mp3.add_album_art(self.get_album_art(artist, mp3.get_attr('album'))) image_url = mp3.add_album_art(self.get_album_art(artist, mp3.get_attr('album')))
exclaim_good("Album art: ", image_url) 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) print (color(song, ["BOLD", "UNDERLINE"]) + bc.OKGREEN + ' downloaded successfully!'+ bc.ENDC)

View file

@ -107,8 +107,9 @@ class Metadata:
pass pass
if not image_url: 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])
try:
mp3.tags.add( mp3.tags.add(
APIC( APIC(
encoding = 3, encoding = 3,
@ -120,6 +121,8 @@ class Metadata:
) )
mp3.save() mp3.save()
return image_url return image_url
except Exception:
return False
def search_google(self, search_terms=""): def search_google(self, search_terms=""):

View file

@ -2,7 +2,7 @@ from setuptools import setup
setup( setup(
name='irs', name='irs',
version='2.7.18', version='2.7.19',
description='A music downloader that just gets metadata.', description='A music downloader that just gets metadata.',
url='https://github.com/kepoorhampond/irs', url='https://github.com/kepoorhampond/irs',
author='Kepoor Hampond', author='Kepoor Hampond',