【问题标题】:How can I stop mutagen automatically updating the ID3 version?如何停止诱变剂自动更新 ID3 版本?
【发布时间】:2013-08-15 07:36:57
【问题描述】:

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

显然,简单地更改mutagen.id3.version 属性是行不通的:真实版本不会改变。

【问题讨论】:

    标签: python mp3 id3 id3v2 mutagen


    【解决方案1】:

    标签保存功能中有一个“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='/')

    【讨论】:

    • 这是让我的标签在 Windows 7 中正确更新的救命稻草。这应该是公认的答案。谢谢!
    【解决方案2】:

    现在似乎支持编写 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.
    

    我不得不强制我的系统使用pip install 'mutagen>=1.22' 下载 1.22 版;否则它给了我1.21版。现在下面的代码似乎对我有用:

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

    【讨论】:

      【解决方案3】:

      很遗憾,你不能。来自the docs

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

      另见:

      【讨论】:

      • 哦!这是对诱变剂还是对我的手机的遗憾?我应该更仔细地检查文档。无论如何,谢谢你的回答。
      猜你喜欢
      • 2017-08-24
      • 1970-01-01
      • 2020-08-27
      • 2023-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-06
      相关资源
      最近更新 更多