Skip to content

Instantly share code, notes, and snippets.

@gunyarakun
Created November 15, 2015 17:36
Show Gist options
  • Save gunyarakun/9a6406c1db4f64a3de1f to your computer and use it in GitHub Desktop.
Save gunyarakun/9a6406c1db4f64a3de1f to your computer and use it in GitHub Desktop.
m4a comment to lyric
#!/usr/bin/env python
import os
import sys
from mutagen.mp4 import MP4
def find_all_files(directory, ext):
for root, dirs, files in os.walk(directory):
for file in files:
if file.lower().endswith('.' + ext):
yield os.path.join(root, file)
def comment_to_lyric(path):
m = MP4(path)
m['\xa9lyr'] = m['\xa9cmt']
del m['\xa9cmt']
m.save()
for path in find_all_files(sys.argv[1], 'm4a'):
print path
comment_to_lyric(path)
faac doesn't support lyrics in cli options but supports comment.
We can put lyrics in comment and process with this script.
pip install mutagen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment