pythonmp3metadataid3artwork

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 metadata is not getting updated.

What can be the possible reasons?


Solution

  • 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/