Created
October 20, 2011 21:04
-
-
Save lesthack/1302376 to your computer and use it in GitHub Desktop.
Extract metatags from multimedia file with python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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