From 9abf01b02a704afb2ea1562a1cd65dc74707ad3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Wed, 31 Jan 2018 14:26:51 +0100 Subject: [PATCH] fix extensions moar --- robot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/robot.py b/robot.py index 5e33ac1..2c71994 100755 --- a/robot.py +++ b/robot.py @@ -50,9 +50,12 @@ def download_ydl(urls, date): def download_raw(url, date): - ext = '' - if 'api.telegram.org' in url and 'animation' in url and "mp4" not in url: + if 'api.telegram.org' in url \ + and ('animation' in url or 'video' in url) \ + and "mp4" not in url: ext = '.mp4' + else: + ext = '' local_filename = OUT_DIR + '/' + datestr(date) + '__' + url.split('/')[-1] + ext r = requests.get(url, stream=True) with open(local_filename, 'wb') as f: