From 7764c1958c150cd99c12e47c93264f2aa84c211c Mon Sep 17 00:00:00 2001 From: Nekmo Date: Sat, 31 Mar 2018 01:33:31 +0200 Subject: [PATCH 1/2] File must exists --- telegram_upload/video.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/telegram_upload/video.py b/telegram_upload/video.py index b4139918..2b72dadd 100644 --- a/telegram_upload/video.py +++ b/telegram_upload/video.py @@ -32,5 +32,5 @@ def get_video_thumb(file, output=None, width=90): '-vframes', '1', output, ], stdout=subprocess.PIPE, stderr=subprocess.DEVNULL) - if not p.returncode: + if not p.returncode and os.path.lexists(file): return output From 93ac4bf43eff4cc5824a653b2649d337c9ef3754 Mon Sep 17 00:00:00 2001 From: Nekmo Date: Sat, 31 Mar 2018 01:36:28 +0200 Subject: [PATCH 2/2] Missing os module. --- telegram_upload/video.py | 1 + 1 file changed, 1 insertion(+) diff --git a/telegram_upload/video.py b/telegram_upload/video.py index 2b72dadd..39c15af3 100644 --- a/telegram_upload/video.py +++ b/telegram_upload/video.py @@ -1,6 +1,7 @@ import struct import subprocess import tempfile +import os from hachoir.metadata import extractMetadata from hachoir.parser import createParser