Created
November 15, 2015 17:36
-
-
Save gunyarakun/9a6406c1db4f64a3de1f to your computer and use it in GitHub Desktop.
m4a comment to lyric
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
faac doesn't support lyrics in cli options but supports comment. | |
We can put lyrics in comment and process with this script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pip install mutagen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment