繁体   English   中英

如何停止mutagen自动更新ID3版本?

[英]How can I stop mutagen automatically updating the ID3 version?

当我试图在MP3中嵌入专辑封面时,mutagen将ID3标签更新为2.4版 - 这是我不想要的,因为在ID3v2.4中我的手机(运行Windows Phone 8)并且我的电脑无法识别标签。

显然,只是更改mutagen.id3.version属性不起作用:真实版本不会改变。

标签保存功能中有“v2_version”选项,如下所示。

import mutagen
audio=mutagen.File('1.mp3')
#audio.tags.update_to_v23()
audio.tags.save(v2_version=3)

它也记录在help()中

help(audio.tags.save)

如下:

save(self,filename = None,v1 = 1,v2_version = 4,v23_sep ='/')

现在似乎支持编写ID3v2.3标签。 我在更改日志中看到了这一点:

1.22 - 2013.09.08
 ...
 * ID3:
   * id3v2.3 writing support (#85)
   * Add iTunes podcast frames (TGID, TDES, WFED) (#141)
   * Updated id3v1 genre list
 ...

这在文档中:

update_to_v23()
    Convert older (and newer) tags into an ID3v2.3 tag.    
    This updates incompatible ID3v2 frames to ID3v2.3 ones. If you intend to save tags as ID3v2.3, you must call this function at some point.
    If you want to to go off spec and include some v2.4 frames in v2.3, remove them before calling this and add them back afterwards.

我不得不强迫我的系统下载版本1.22,点击pip install 'mutagen>=1.22' ; 否则它让我的版本1.21。 现在,以下代码似乎对我有用:

>>> audio = mutagen.File("path_to_your.mp3")
>>> type(audio)
<class 'mutagen.mp3.MP3'>
>>> audio.tags.update_to_v23()

可悲的是,你做不到。 来自文档

Mutagen只能编写ID3v2.4标签......

也可以看看:

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM