Skip to content

Instantly share code, notes, and snippets.

@lesthack
Created October 20, 2011 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lesthack/1302376 to your computer and use it in GitHub Desktop.
Save lesthack/1302376 to your computer and use it in GitHub Desktop.
Extract metatags from multimedia file with python
from mutagen import File
file = File('some.mp3') # mutagen can automatically detect format and type of tags
artwork = file.tags['APIC:'].data # access APIC frame and grab the image
with open('image.jpg', 'wb') as img:
img.write(artwork) # write artwork to new image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment