after using python mutagen,metatags not displayed

2019-03-03 11:33发布

I wanted to edit the meta data of a bunch of mp3 files,so I used python mutegan.
The details of the mp3 file before running mutagen

I used this simple code to change the details of the mp3 file.

from mutagen.easyid3 import EasyID3
audio = EasyID3("C:/wamp/www/music/songs/showkali.mp3")
audio['genre']='pop'
audio.save()

After running the program the details cannot be seen in the properties.
The details of the mp3 file after running mutagen
I figured out this is due to change in id3 tag version after running the program.The id3 tag version changed from ID3v2.3 to ID3v2.4.So I tried using the code

from mutagen.easyid3 import EasyID3
audio = EasyID3("C:/wamp/www/music/songs/showkali.mp3")
audio['genre']='pop'
audio.save(v2_version=3)

But still the details are not displayed in the details tab of properties.Can anyone suggest me an solution.Thanks in advance.

1条回答
迷人小祖宗
2楼-- · 2019-03-03 12:08

easyid3 does not support v2.3 atm: https://github.com/quodlibet/mutagen/issues/188

You can work around this issue by doing

mutagen.id3.ID3("C:\\...mp3").save(v2_version=3)

after saving with easyid3

查看更多
登录 后发表回答