Fixed Issue #16

This commit is contained in:
Kepoor Hampond 2017-03-25 20:23:54 -07:00
parent 7cf80b548f
commit 46ff493d11
3 changed files with 10 additions and 6 deletions

View file

@ -42,7 +42,7 @@ class Metadata:
def read_tag(self, tag): def read_tag(self, tag):
try: try:
return self.mp3[tag] return self.mp3[tag]
except EasyID3KeyError: except Exception:
return [] return []
def add_album_art(self, image_url): def add_album_art(self, image_url):

View file

@ -332,16 +332,20 @@ class Ripper:
m = Metadata(file_name) m = Metadata(file_name)
m.add_tag( "title", data["name"]) m.add_tag("comment", 'URL: "%s"\nVideo Title: "%s"' % (video_url, video_title))
m.add_tag( "artist", data["artist"]) if len(data.keys()) > 1:
m.add_tag( "comment", 'URL: "%s"\nVideo Title: "%s"' % (video_url, video_title)) m.add_tag("title", data["name"])
if data != {}: m.add_tag("artist", data["artist"])
m.add_tag("album", data["album"]) m.add_tag("album", data["album"])
m.add_tag("genre", data["genre"]) m.add_tag("genre", data["genre"])
m.add_tag("tracknumber", str(data["track_number"])) m.add_tag("tracknumber", str(data["track_number"]))
m.add_tag("discnumber", str(data["disc_number"])) m.add_tag("discnumber", str(data["disc_number"]))
m.add_tag("compilation", data["compilation"]) m.add_tag("compilation", data["compilation"])
m.add_album_art( str(data["album_art"])) m.add_album_art( str(data["album_art"]))
else:
print ("Could not find metadata.")
m.add_tag("title", song)
m.add_tag("artist", artist)
if self.type == "song": if self.type == "song":
return self.post_processing([file_name]) return self.post_processing([file_name])

View file

@ -2,7 +2,7 @@ from setuptools import setup
setup( setup(
name='irs', name='irs',
version='6.3.1', version='6.3.2',
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',