Changing the type of inline image in the APIC ID3 tag via Mutagen

I have a large music library that I just spent about 30 hours. For some MP3 files, I entered the cover image as type 0 (other), and I would like to change it to type 3 (front cover). Is there a way to do this in Python, especially in Mutagen?

+4
source share
1 answer

This is how I was able to take it off.

First access the file in Mutagen:

audio = MP3("filename.mp3") 

Then get a link to the tag you are looking for:

 picturetag = audio.tags['APIC:Folder.jpg'] 

Then change the type attribute:

 picturetag.type = 3 

Then return it to the audio file to be sure

 audio.tags['APIC:Folder.jpg'] = picturetag 

Finally save it!

 audio.save() 

And you are there! The APIC tag comes with its own class, which has everything you need to modify images and tag information. Happy music organization!

+8
source

Source: https://habr.com/ru/post/1311805/


All Articles