I already check the content type, size and extension ( Django (audio) File Check ), but I need a library to read the file and confirm that this is actually what I hope for (mp3 and mp4 mostly).
I was here: http://wiki.python.org/moin/Audio/ but no luck. Some time ago, I got a little lost in the forest. Building on SO is a great time for all this end ...
Thanks in advance.
EDIT: I already (in Django) using UploadedFile.content_type ():
“The title of the content downloaded with the file (for example, text / plain or application / pdf). Like any data provided by the user, you should not trust that the downloaded file is actually a type. You’ll still need to check that the file contains content that the title of the content header requires - "trust but verify."
So, I am already reading the headline. But how can I check the actual contents of a file?
source share