Closed anuj-scanova closed 2 years ago
python-magic delegates the actual identification logic to libmagic. You might be able to upgrade libmagic to get a more accurate identification. In this case I suspect the .m4a file is really an mp4 container that just happens to contain only an audio track vs audio+video. So libmagic would need to know more about the details of the format to accurately identify it.
Using this library in the Django project and using Django REST Framework. In the serializer's validate method, using the following code snippet to validate for the valid file extension using
python-magic
On uploading the
m4a
file (attached) it is detecting asvideo/mp4
file.