fix extensions moar

This commit is contained in:
Tomáš Mládek 2018-01-31 14:26:51 +01:00 committed by Tomáš Mládek
parent a949c82bce
commit 9abf01b02a

View file

@ -50,9 +50,12 @@ def download_ydl(urls, date):
def download_raw(url, date): def download_raw(url, date):
ext = '' if 'api.telegram.org' in url \
if 'api.telegram.org' in url and 'animation' in url and "mp4" not in url: and ('animation' in url or 'video' in url) \
and "mp4" not in url:
ext = '.mp4' ext = '.mp4'
else:
ext = ''
local_filename = OUT_DIR + '/' + datestr(date) + '__' + url.split('/')[-1] + ext local_filename = OUT_DIR + '/' + datestr(date) + '__' + url.split('/')[-1] + ext
r = requests.get(url, stream=True) r = requests.get(url, stream=True)
with open(local_filename, 'wb') as f: with open(local_filename, 'wb') as f: