문제

What library is presently the most thorough and capable ID3 tag reading library available? Preferably something I can compile as a shared library and wrap with Python's ctypes library, or even a Python package.

도움이 되었습니까?

해결책

I've had a good time using mutagen (tutorial: http://code.google.com/p/mutagen/wiki/Tutorial) - it's quite simple to get the info. Note that you should use the Easy ID3 option.

>>> 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"])]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top