fix extensions moar
This commit is contained in:
parent
a949c82bce
commit
9abf01b02a
1 changed files with 5 additions and 2 deletions
7
robot.py
7
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:
|
||||
|
|
Loading…
Reference in a new issue