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()