mirror of
https://github.com/KevinMidboe/spotify-downloader.git
synced 2025-10-29 18:00:15 +00:00
Change back to functions for consistency
This commit is contained in:
@@ -20,22 +20,19 @@ def compare(file, metadata):
|
||||
already_tagged = False
|
||||
return already_tagged
|
||||
|
||||
class embed(object):
|
||||
|
||||
def __init__(self, music_file, meta_tags, output_ext):
|
||||
|
||||
def embed(music_file, meta_tags, output_ext):
|
||||
if meta_tags is None:
|
||||
print('Could not find meta-tags')
|
||||
elif output_ext == '.m4a':
|
||||
print('Fixing meta-tags')
|
||||
self.embed_m4a(music_file, meta_tags, output_ext)
|
||||
embed_m4a(music_file, meta_tags, output_ext)
|
||||
elif output_ext == '.mp3':
|
||||
print('Fixing meta-tags')
|
||||
self.embed_mp3(music_file, meta_tags, output_ext)
|
||||
embed_mp3(music_file, meta_tags, output_ext)
|
||||
else:
|
||||
print('Cannot embed meta-tags into given output extension')
|
||||
|
||||
def embed_mp3(self, music_file, meta_tags, output_ext):
|
||||
def embed_mp3(music_file, meta_tags, output_ext):
|
||||
artists = []
|
||||
for artist in meta_tags['artists']:
|
||||
artists.append(artist['name'])
|
||||
@@ -67,7 +64,7 @@ class embed(object):
|
||||
albumart.close()
|
||||
audiofile.save(v2_version=3)
|
||||
|
||||
def embed_m4a(self, music_file, meta_tags, output_ext):
|
||||
def embed_m4a(music_file, meta_tags, output_ext):
|
||||
# eyed serves only mp3 not aac so using mutagen
|
||||
# Apple has specific tags - see mutagen docs -
|
||||
# http://mutagen.readthedocs.io/en/latest/api/mp4.html
|
||||
|
||||
Reference in New Issue
Block a user