I am trying to edit mp3 tags with mutagen. Now I have been working on setting tags like title. But APIC is still not working.
My code is:
from mutagen.mp3 import MP3 from mutagen.id3 import ID3, APIC, TT2, TPE1, TRCK, TALB, USLT, error
How can I make it work?
Thanks:)
Edit: Got it working:
imagedata = open(pic_file, 'rb').read() id3 = ID3('song.mp3') id3.add(APIC(3, 'image/jpeg', 3, 'Front cover', imagedata)) id3.add(TIT2(encoding=3, text='title')) id3.save(v2_version=3)
source share