From 46ff493d112d9e29429c77bc4025fa1823160f73 Mon Sep 17 00:00:00 2001 From: Kepoor Hampond Date: Sat, 25 Mar 2017 20:23:54 -0700 Subject: [PATCH] Fixed Issue #16 --- irs/metadata.py | 2 +- irs/ripper.py | 12 ++++++++---- setup.py | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/irs/metadata.py b/irs/metadata.py index 24ffe21..5455b26 100644 --- a/irs/metadata.py +++ b/irs/metadata.py @@ -42,7 +42,7 @@ class Metadata: def read_tag(self, tag): try: return self.mp3[tag] - except EasyID3KeyError: + except Exception: return [] def add_album_art(self, image_url): diff --git a/irs/ripper.py b/irs/ripper.py index 7e3fd1a..e84795c 100644 --- a/irs/ripper.py +++ b/irs/ripper.py @@ -332,16 +332,20 @@ class Ripper: m = Metadata(file_name) - m.add_tag( "title", data["name"]) - m.add_tag( "artist", data["artist"]) - m.add_tag( "comment", 'URL: "%s"\nVideo Title: "%s"' % (video_url, video_title)) - if data != {}: + m.add_tag("comment", 'URL: "%s"\nVideo Title: "%s"' % (video_url, video_title)) + if len(data.keys()) > 1: + m.add_tag("title", data["name"]) + m.add_tag("artist", data["artist"]) m.add_tag("album", data["album"]) m.add_tag("genre", data["genre"]) m.add_tag("tracknumber", str(data["track_number"])) m.add_tag("discnumber", str(data["disc_number"])) m.add_tag("compilation", data["compilation"]) 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": return self.post_processing([file_name]) diff --git a/setup.py b/setup.py index 0f465c9..49e7230 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup setup( name='irs', - version='6.3.1', + version='6.3.2', description='A music downloader that just gets metadata.', url='https://github.com/kepoorhampond/irs', author='Kepoor Hampond',