From bf655e3f9600770d926181213194b0e5a86d9314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D1=80=D0=BE=D0=B4=D0=B8=D0=BD=20=D0=A0=D0=BE?= =?UTF-8?q?=D0=BC=D0=B0=D0=BD?= Date: Fri, 25 Mar 2022 01:31:20 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B5=D1=81=D0=BB=D0=B8=20=D0=BD=D0=B5=20?= =?UTF-8?q?=D1=81=D0=BC=D0=BE=D0=B3=D0=BB=D0=B8=20=D0=BE=D0=BF=D1=80=D0=B5?= =?UTF-8?q?=D0=B4=D0=B5=D0=BB=D0=B8=D1=82=D1=8C=20=D1=82=D0=B8=D0=BF=20?= =?UTF-8?q?=D0=B2=D0=B8=D0=B4=D0=B5=D0=BE,=20=D0=BF=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=8F=D0=B5=D0=BC=20=D1=80=D0=B0=D1=81=D1=88=D0=B8?= =?UTF-8?q?=D1=80=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B8=D0=B7=20=D1=81=D0=BF?= =?UTF-8?q?=D0=B8=D1=81=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon.xml | 2 +- lib/gorrent2http/util.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/addon.xml b/addon.xml index d65050c..411a301 100644 --- a/addon.xml +++ b/addon.xml @@ -1,5 +1,5 @@ - + diff --git a/lib/gorrent2http/util.py b/lib/gorrent2http/util.py index b75b8c6..4e43a70 100644 --- a/lib/gorrent2http/util.py +++ b/lib/gorrent2http/util.py @@ -14,7 +14,7 @@ from .structs import MediaType SUBTITLES_FORMATS = ['.aqt', '.gsub', '.jss', '.sub', '.ttxt', '.pjs', '.psb', '.rt', '.smi', '.stl', '.ssf', '.srt', '.ssa', '.ass', '.usf', '.idx'] - +VIDEO_FORMATS = ['.mkv', '.mp4', '.avi', '.ogv', '.ts', '.flv', '.webm', '.vob', '.3gp', '.mpg', '.mpeg'] class Struct(dict): def __getattr__(self, attr): @@ -43,7 +43,9 @@ def detect_media_type(name): return MediaType.SUBTITLES else: mime_type = mimetypes.guess_type(name)[0] - if not mime_type: + if mime_type is None: + if ext.lower() in VIDEO_FORMATS: + return MediaType.VIDEO return MediaType.UNKNOWN mime_type = mime_type.split("/")[0] if mime_type == 'audio':