我正在尝试将 MP3 标签保存到文件夹中的文件中。我已将电子表格中的新值分配给 temp_track
,如下所示,但无法找到一种方法来完成最后一步以使用新数据保存文件。
我的代码:
tlt = sheet2.cell(row=a+1, column=14)
temp_track.title = tlt.value
print('Title of Song: ' + temp_track.title)
运行窗口显示的数据:
Title of Song: (66 REV 022) - Revelation 22
我尝试了 TinyTag.tag.save()
但收到了错误消息
AttributeError: type object 'TinyTag' has no attribute 'tag'
什么属性可以用来将新的 MP3 标签保存到文件中?
最佳答案
如果您使用来自 pypi 的 TinyTag https://pypi.org/project/tinytag/或 https://github.com/devsnd/tinytag该库仅供读取。它不能用于修改现有文件。
如果你想编辑 mp3 文件的 ID3 标签,试试 mp3-tagger https://pypi.org/project/mp3-tagger/或 https://github.com/artcom-net/mp3-tagger
关于python - MP3 标签不保存在 Python 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66272752/