它的eyed3能够访问所有mp3的“标准”标签,除了更常见的“标题”标签之外?

2024-05-17 08:10:20 发布

您现在位置:Python中文网/ 问答频道 /正文

我成功地在mp3文件和用户格式化的文件中标记了更“常见”的标签。 但其他的标准如“版权”、“工程师”、“作曲家”、“编码者”、“语言”。不显示(例如在EasyTag或其他音频节目中) 我的台词是:

     t =Tag()
                t.artist = TAGS['AUTEUR']
                t.title = TAGS['TITLE']
                t.album = TAGS['ALBUM']
                t.genre = TAGS['GENRE']
                t.recording_date = TAGS['YEAR']
                t.track_num = TAGS['TRACK']
                t.publisher = TAGS['PUBLISHER']
                t.disc_num = (1, 1)
                t.user_text_frames.set(TAGS['CDID'], u"CD_ID")

 #These stick OK


                t.engineer = TAGS['ENG']
                t.copyright = TAGS['C']
                t.composer = TAGS['COMPOSER']
#no showing
                t.save(AUDIO, version=ID3_V2_3)
#I also test with version=ID3_V2_4 but no cigar.

它的eyed3能够访问这些标签吗?在


Tags: 文件no用户标记标准versiontags版权
1条回答
网友
1楼 · 发布于 2024-05-17 08:10:20

好吧,真的需要“版权”标签,我切换到“诱变剂”模块

我需要的所有标签都在那里,不需要添加额外的元数据,创建“用户文本框架”来存储其他重要信息。在

在这里使用Metagen的一些完整配方代码: http://code.activestate.com/recipes/577138-embed-lyrics-into-mp3-files-using-mutagen-uslt-tag/

对于版权,只需: ........... 在

from mutagen.id3 import ID3, TCOP #... more imported tags here

try:
    tags = ID3(mp3file)
except ID3NoHeaderError:
    print "Adding ID3 header;",
    tags = ID3()
#... more tags        
tags["TCOP"] = TCOP(encoding=3, text=u"""All rights reserved. No part of this publication may be reproduced, distributed, or transmitted in any form or by any means, including photocopying, recording, or other electronic or mechanical methods, without the prior written permission of the publisher, except in the case of brief quotations embodied in critical reviews and certain other noncommercial uses permitted by copyright law. For permission requests, write to the publisher, addressed \“Attention: Permissions Coordinator,\” at the address below.""")
tags.save(mp3file)

相关问题 更多 >