Merge pull request #379 from ritiek/comment-metadata

Embed comment metadata in .m4a
This commit is contained in:
Linus Groh
2018-10-09 11:28:58 +02:00
committed by GitHub
2 changed files with 2 additions and 0 deletions

View File

@@ -31,6 +31,7 @@ M4A_TAG_PRESET = {
"copyright": "cprt", "copyright": "cprt",
"tempo": "tmpo", "tempo": "tmpo",
"lyrics": "\xa9lyr", "lyrics": "\xa9lyr",
"comment": "\xa9cmt",
} }
TAG_PRESET = {} TAG_PRESET = {}

View File

@@ -105,6 +105,7 @@ class EmbedMetadata:
audiofile = MP4(music_file) audiofile = MP4(music_file)
self._embed_basic_metadata(audiofile, preset=M4A_TAG_PRESET) self._embed_basic_metadata(audiofile, preset=M4A_TAG_PRESET)
audiofile[M4A_TAG_PRESET["year"]] = meta_tags["year"] audiofile[M4A_TAG_PRESET["year"]] = meta_tags["year"]
audiofile[M4A_TAG_PRESET["comment"]] = meta_tags["external_urls"]["spotify"]
if meta_tags["lyrics"]: if meta_tags["lyrics"]:
audiofile[M4A_TAG_PRESET["lyrics"]] = meta_tags["lyrics"] audiofile[M4A_TAG_PRESET["lyrics"]] = meta_tags["lyrics"]
try: try: