1 2 3 4 5 6 7 8 9 10 11 12
| from mutagen.mp4 import MP4, MP4Cover def addCover(filename, cover): audio = MP4(filename) data = open(cover, 'rb').read() covr = [] if cover.endswith('png'): covr.append(MP4Cover(data, MP4Cover.FORMAT_PNG)) else: covr.append(MP4Cover(data, MP4Cover.FORMAT_JPEG)) audio['covr'] = covr audio.save() print(filename + " 内嵌图片:" + cover + "。")
|