我在带有 mp3 文件的文件夹中有以下 python 脚本:
import os
import eyed3
def track(file):
tag = eyed3.load(file)
tag.tag.comment = u"teststring"
tag.tag.genre = u"Pop"
tag.tag.save()
for fn in os.listdir('.'):
print fn[-3:]
if fn[-3:] == 'mp3':
track(fn)
“流派”已正确设置或更改,但我的评论只是添加了一些垃圾。我在评论中添加了 winamp 中的“测试”,在我运行脚本并从命令行输出 ID3 信息后,我看到了:
ys3(01).mp3 [ 3.86 MB ]
-------------------------------------------------------------------------------
Time: 03:02 MPEG1, Layer III [ ~177 kb/s @ 48000 Hz - Joint stereo ]
-------------------------------------------------------------------------------
ID3 v2.3:
title: WANDERERS FROM YS - ?
artist:
album:
track: genre: Pop (id 13)
Comment: [Description: ] [Lang: eng]
Test
Comment: [Description: ÿþÿ] [Lang: eng]
þ
-------------------------------------------------------------------------------
我是否以错误的方式传递“评论”?