From 54e23c4f35811d3665bf4bfaf0fe950f9fb2f916 Mon Sep 17 00:00:00 2001 From: Kepoor Hampond Date: Fri, 17 Mar 2017 23:46:38 -0700 Subject: [PATCH] Fulfilled #12 feature request --- irs/metadata.py | 4 ++-- irs/ripper.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/irs/metadata.py b/irs/metadata.py index 3232d69..24ffe21 100644 --- a/irs/metadata.py +++ b/irs/metadata.py @@ -2,7 +2,7 @@ from mutagen.mp3 import MP3, EasyMP3 from mutagen.easyid3 import EasyID3, EasyID3KeyError from mutagen.id3 import * # There's A LOT of stuff to import, forgive me. -from mutagen.id3 import APIC +from mutagen.id3 import APIC, ID3, COMM # System import sys @@ -31,8 +31,8 @@ class Metadata: def __init__(self, location): self.spotify = spotipy.Spotify() self.location = location - #self.mp3 = MP3(self.location, ID3=EasyID3) self.mp3 = EasyID3(self.location) + EasyID3.RegisterTextKey("comment", "COMM") def add_tag(self, tag, data): # For valid tags: `EasyID3.valid_keys.keys()` diff --git a/irs/ripper.py b/irs/ripper.py index b2f26a9..7e3fd1a 100644 --- a/irs/ripper.py +++ b/irs/ripper.py @@ -334,6 +334,7 @@ class Ripper: 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("album", data["album"]) m.add_tag("genre", data["genre"])