开发者

Adding Album Art using python in mp3 metadata

The code below doesnt seem to update the artwork of the mp3 file.

Code:-

#Editing the MetaData
tag = eyeD3.Tag()
print tag.link('location') //Returns 1
tag.setVersion([2,3,0])
print tag.addImage(0x08,'artwork.jpg') //Return None (Its sure that file is present)
print tag.update()  //Returns 1

The values returned by the function are correct but then also the me开发者_运维百科tadata is not getting updated.

What can be the possible reasons?


It looks like you're specifically referring to adding images to an MP3 using the eyeD3 module. I've only used the CLI version of eyeD3 so I may be wrong, but you don't seem to be passing a type parameter to the addImage method. I don't remember being able to get it to work without passing a type.

--add-image=IMG_PATH:TYPE[:DESCRIPTION]
Add an image to the tag. The description and type optional, but when used, both ':' delimiters must be present. The type MUST be an string that corresponds to one given with --list-image-types. If the IMG_PATH value is empty the APIC frame with TYPE is removed.

http://eyed3.nicfit.net/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜