mirror of
https://github.com/cooperhammond/irs.git
synced 2025-01-04 19:25:27 +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:
|
if tracknum:
|
||||||
mp3.add_track_number(tracknum)
|
mp3.add_track_number(tracknum)
|
||||||
|
|
||||||
image_url = mp3.add_album_art(self.get_album_art(artist, mp3.get_attr('album')))
|
try:
|
||||||
exclaim_good("Album art: ", image_url)
|
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)
|
print (color(song, ["BOLD", "UNDERLINE"]) + bc.OKGREEN + ' downloaded successfully!'+ bc.ENDC)
|
||||||
|
|
|
@ -107,19 +107,22 @@ 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])
|
||||||
|
|
||||||
mp3.tags.add(
|
try:
|
||||||
APIC(
|
mp3.tags.add(
|
||||||
encoding = 3,
|
APIC(
|
||||||
mime = 'image/png',
|
encoding = 3,
|
||||||
type = 3,
|
mime = 'image/png',
|
||||||
desc = 'cover',
|
type = 3,
|
||||||
data = urlopen(image_url).read()
|
desc = 'cover',
|
||||||
|
data = urlopen(image_url).read()
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
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=""):
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -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',
|
||||||
|
|
Loading…
Reference in a new issue