This question already has answers here:
Accessing MP3 metadata with Python
                                
                                    (17个答案)
                                
                        
                                7年前关闭。
            
                    
假设我想查看艺术家姓名?或添加BPM信息?我可以使用哪些Python工具执行此操作?

最佳答案

有一个叫做Python-ID3的模块可以做到这一点。如果您在Debian / Ubuntu盒子上,则其软件包名称为python-id3,并且其网站​​上有示例代码:

from ID3 import *
try:
    id3info = ID3('/some/file/moxy.mp3')
    print id3info
    id3info['TITLE'] = "Green Eggs and Ham"
    id3info['ARTIST'] = "Moxy Früvous"
    for k, v in id3info.items():
        print k, ":", v
except InvalidTagError, message:
    print "Invalid ID3 tag:", message

09-27 19:46