How to set: “artist”, “album artist”, “year”, “album”, “song number” and “title” fields of the tag, with mutagen

别说谁变了你拦得住时间么 提交于 2019-12-01 12:51:10

i have the same question as you. And i tried

from mutagen.id3 import ID3, TIT2, TIT3, TALB, TPE1, TRCK, TYER`
tags = ID3()
tags['TIT2'] = TIT2(encoding=3, text=u'just a title') #title
tags['TYER'] = TYER(encoding=3, text=u'2000')  #year
tags['TRCK'] = TRCK(encoding=3, text=u'9')  #trackno
tags.save('111.mp3')

in this way, it seems to be able to change the tags without ensuring the previous tags are empty, but when i check those tags in python way i found the TYER frame had changed into TDRC, and i don't know why

Try saving as follows

audio.save(v2_version=3)

it fixed the issue in my case.

Edit: it's because TYER TDAT TORY are v2.3 tags and got changed in v2.4 Source: https://en.wikipedia.org/wiki/ID3#ID3v2_frame_specification

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!