eyed3和eyeD3有什么区别,以及如何使用python编辑mp3标签 [英] what's the difference between eyed3 and eyeD3, and how can i edit mp3 tags with python

查看:337
本文介绍了eyed3和eyeD3有什么区别,以及如何使用python编辑mp3标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过python更新mp3标签. 我已经下载了eyed3,但是我只能导入eyed3,而不能导入eyeD3. 我看到了eyeD3的一些代码选项,这些选项可以满足我的需求.例如:

I'm trying to update my mp3 tags through python. I've downloaded eyed3, but i can only import eyed3 and not eyeD3. I saw some options for code with eyeD3 that do what i need. for example something like:

tag = eyeD3.Tag()
tag.link(mp3_file_name)
tag.setVersion([2,3,0])
tag.setArtist(u'\u897f\u306f\u3058\u3081')
tag.update()

但是我不能用eyed3做到这一点. 有人知道eyed3和eyeD3有什么区别,我如何下载eyeD3? 还是有人知道以其他方式编辑mp3文件的标签吗?

But i can't do that with eyed3. Does someone knows what's the difference between eyed3 and eyeD3 and how can i download eyeD3? Or does anyone knows a different way to edit tags for mp3 file?

非常感谢.

推荐答案

在最新版本(即eyeD3 0.8)中,导入模块已更改为

In the latest version i.e eyeD3 0.8 the import module has been changed from

导入eyeD3 导入eyed3 用法是:

import eyed3

audio = eyed3.load(PATH_TO_YOUR_MP3)
#To retrieve Data
print audio.tag.artist
print audio.tag.album
print audio.tag.title

#To set Data
audio.tag.artist = u"ARTIST"
audio.tag.album= u"ALBUM"
audio.tag.title= u"TITLE"
audio.tag.save()

这篇关于eyed3和eyeD3有什么区别,以及如何使用python编辑mp3标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆