Use hachoir to determine audio and video metadata if possible

Closes #611
This commit is contained in:
Lonami Exo
2018-02-17 13:00:58 +01:00
parent 2bfe86cda1
commit 33fd6895d3
3 changed files with 46 additions and 6 deletions

View File

@@ -326,6 +326,11 @@ def is_image(file):
return (mimetypes.guess_type(file)[0] or '').startswith('image/')
def is_audio(file):
"""Returns True if the file extension looks like an audio file"""
return (mimetypes.guess_type(file)[0] or '').startswith('audio/')
def is_video(file):
"""Returns True if the file extension looks like a video file"""
return (mimetypes.guess_type(file)[0] or '').startswith('video/')