Python Mutagen ID3库显示No AttributeError(Python 3.5)

时间:2016-05-24 13:01:56

标签: python id3 mutagen

我想用自己的音频元数据更新 .mp3 歌曲ID3标签。我想使用ID3 v2.3。当我执行代码时,它显示错误

  

AttributeError:'ID3'对象没有属性'COMM'

请检查我的代码,让我知道如何解决这个问题,还有一件事,这是否可以完全删除旧的id3元数据标签?和我的拥有者一起更新?

from mutagen.id3 import ID3, TIT2, TALB, TPE1, TPE2, COMM, USLT, TCOM, TCON, TDRC

filename = "Sanam Re.mp3"

audio = ID3(filename, translate=False)

keep_these = audio.getall("TSOP")
audio.update_to_v23()
audio.setall("TSOP", keep_these)

audio.add(TALB(encoding=3, text=u"Sanam Re"))  # Album Name
audio.add(TIT2(encoding=3, text=u"Dhoop Mein Na Chal - SongsBlig")) # Songs Title
audio.add(TPE1(encoding=3, text=u"Arjit Singh"))  # Singer Name
audio.add(TDRC(encoding=3, text=u"2015")) # Album Year
audio.add(TCON(encoding=3, text=u"Bollywood Music"))  # GENRE
audio.COMM(encoding=3, lang=u'eng', desc='desc', text=u'Downloaded') # Comment

audio.save(v2_version=3)

0 个答案:

没有答案