fixed issue where is_video returns False for byte array/stream videos

This commit is contained in:
Allerter 2020-09-02 17:22:20 +04:30
parent 6baa44b9c8
commit d493ac15b1

View File

@ -815,9 +815,16 @@ def is_audio(file):
def is_video(file):
"""Returns `True` if the file extension looks like a video file."""
file = 'a' + _get_extension(file)
return (mimetypes.guess_type(file)[0] or '').startswith('video/')
"""Returns `True` if the file has a video mime type."""
filename = 'a' + _get_extension(file)
if filename == 'a':
metadata = _get_metadata(file)
if metadata and metadata.has('mime_type'):
return metadata.get('mime_type').startswith('video/')
else:
return False
else:
return (mimetypes.guess_type(filename)[0] or '').startswith('video/')
def is_list_like(obj):