pythonid3id3-tag

How can I change music cover photo using APIC frame in ID3 tag?


I want to change my music's cover image. I've tried:

from mutagen.easyid3 import EasyID3
from mutagen.id3 import ID3, APIC

audio = EasyID3('11.mp3')
audio['artist'] = "Artist"
audio['title'] = "11"
audio.save()

audio = ID3('11.mp3')
with open('img.jpg', 'rb') as albumart:
    audio['APIC'] = APIC(
        encoding=3,
        mime='image/jpeg',
        type=3, desc=u'Cover',
        data=albumart.read()
    )            
audio.save()

MP3 file with default icon

But the cover has not changed. My project folder:

project
--- main.py
--- 11.mp3
--- img.jpg

Solution

  • You need to restart your file explorer