mimetypes.guess_type is not recognising video/x-m4v on python3.7.3

443 Views Asked by At

Following code:

import mimetypes
file_name = 'ipho2001.m4v'
mimetypes.guess_type(file_name)

On python 2.7.13 it returns ('video/x-m4v', None)

On python 3.6.2 it returns ('video/x-m4v', None)

On python 3.7.3 it returns (None, None)

On python 3.8.2 it returns (None, None)

Why? and how to recognise mimetype in python3.7.3?

1

There are 1 best solutions below

0
On

Not sure why (I will accept a detailed answer if someone will post it). But this is how I have solved it:

mimetypes.add_type('video/x-m4v', '.m4v')