Potentially useful code snippets
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

18 lines
457 B

import sys
from mutagen.mp4 import MP4
#print(sys.argv[1:])
# https://mutagen.readthedocs.io/en/latest/api/mp4.html#id1
conv=sys.argv[1:]
for item in conv:
if item.endswith('m4a'):
names=item.split('-')
# File names have the metadata in this case:
# 00-Song Title-Artist-Album-otherinfo.m4a
audio=MP4(item)
audio['\xa9nam']=[names[1]]
audio['\xa9ART']=[names[2]]
audio['\xa9alb']=[names[3]]
audio['\xa9gen']=['Electronic']
audio.save()