通过 Mutagen 更改 APIC ID3 标签中的嵌入图像类型

发布于 2024-09-03 23:58:53 字数 118 浏览 4 评论 0原文

我有一个很大的音乐库,我刚刚花了大约 30 个小时来整理。对于某些 MP3 文件,我将封面图像嵌入为类型 0(其他),我想将其更改为类型 3(封面)。有没有办法在 Python 中做到这一点,特别是在 Mutagen 中?

I have a large music library which I have just spent around 30 hours organizing. For some of the MP3 files, I embedded the cover art image as type 0 (Other) and I'd like to change it to type 3 (Front Cover). Is there a way to do this in Python, specifically in Mutagen?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怀念你的温柔 2024-09-10 23:58:53

这就是我如何成功的。

首先,在 Mutagen 中访问该文件:

audio = MP3("filename.mp3")

然后,获取对您要查找的标签的引用:

picturetag = audio.tags['APIC:Folder.jpg']

然后,修改 type 属性:

picturetag.type = 3

然后,将其分配回音频文件,只是为了 最后一定要

audio.tags['APIC:Folder.jpg'] = picturetag

保存!

audio.save()

你就在那里! APIC 标签附带了自己的类,其中包含修改图片和图片标记信息所需的一切。快乐的音乐组织!

Here's how I was able to pull it off.

First, get access to the file in Mutagen:

audio = MP3("filename.mp3")

Then, get a reference to the tag you're looking for:

picturetag = audio.tags['APIC:Folder.jpg']

Then, modify the type attribute:

picturetag.type = 3

Then, assign it back into the audio file, just to be sure

audio.tags['APIC:Folder.jpg'] = picturetag

Finally, save it!

audio.save()

And you're there! The APIC tag comes with its own class that sports everything you'd need to modify pictures and picture tagging info. Happy music organizing!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文