利用Python工具转换mp3的id3信息的编码

在使用Mac后,经常碰到这样的问题:通过Verycd下载的mp3在iTunes播放的时候显示乱码。

这种情况几本是因为id3信息编码是GBK而非UTF-8引起的,所以只要我们对其编码做一个转换就可以了。

如果你安装了easy_install 那么你可以非常方便的安装找个叫做mutagen的工具

 

 

 

Lukes-MacBook:~ Luke$ sudo easy_install mutagen
Password:
Searching for mutagen
Reading http://pypi.python.org/simple/mutagen/
Reading http://www.sacredchao.net/quodlibet/wiki/Development/Mutagen
Reading http://code.google.com/p/mutagen/
Best match: mutagen 1.18
Downloading http://mutagen.googlecode.com/files/mutagen-1.18.tar.gz
Processing mutagen-1.18.tar.gz
Running mutagen-1.18/setup.py -q bdist_egg --dist-dir /tmp/easy_install-3uPSYT/mutagen-1.18/egg-dist-tmp-bioiaE
zip_safe flag not set; analyzing archive contents...
Adding mutagen 1.18 to easy-install.pth file
Installing moggsplit script to /usr/local/bin
Installing mutagen-inspect script to /usr/local/bin
Installing mutagen-pony script to /usr/local/bin
Installing mid3iconv script to /usr/local/bin
Installing mid3v2 script to /usr/local/bin

Installed /Library/Python/2.6/site-packages/mutagen-1.18-py2.6.egg
Processing dependencies for mutagen
Finished processing dependencies for mutagen

 

安装好了之后你就可以使用了,进入装有mp3文件的目录,然后运行

 

find . -iname "*.mp3" -execdir mid3iconv -e GBK {} \;

 

OK,一切就这么简单。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值