Fulfilled #12 feature request

This commit is contained in:
Kepoor Hampond 2017-03-17 23:46:38 -07:00
parent e4d97753b3
commit 54e23c4f35
2 changed files with 3 additions and 2 deletions

View file

@ -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()`

View file

@ -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"])