哪个是读取ID3标签最好的库?

3

目前最全面、最强大的ID3标签读取库是哪个?最好是我可以编译为共享库并使用Python的ctypes库进行封装,甚至是一个Python包。


你肯定想使用 mutagen。它是 the Python ID3 标签库,不需要任何外部依赖。然而,如果你需要/想要 编写 ID3 标签,请注意它只能编写 ID3 v2.4,而不像 ID3 v2.3 那样被广泛支持(咳咳 Windows Explorer 咳咳)。如果你需要编写支持,请参考他们的 bugtracker 上的相关功能请求:http://code.google.com/p/mutagen/issues/detail?id=85。 - ThiefMaster
1个回答

17
我使用mutagen(教程:http://code.google.com/p/mutagen/wiki/Tutorial)度过了美好的时光——获取信息非常简单。请注意,应使用Easy ID3选项。
>>> from glob import glob
>>> from mutagen.easyid3 import EasyID3
>>> for filename in glob('/home/jon/Downloads/*.mp3'):
    mp3info = EasyID3(filename)
    print mp3info.items()


[('artist', [u"James O'Brien's Mystery Hour"]), ('title', [u"James O'Brien's Mystery Hour - 7 Dec 12"])]

1
由于Google Code已关闭,这里是新的源代码链接:https://github.com/quodlibet/mutagen。文档可以在此处阅读:https://mutagen.readthedocs.io/en/latest/index.html。 - Derek W

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接