Use determine_ext when saving the thumbnail
Urls that contain a query produced filenames with wrong extensions
This commit is contained in:
parent
6543f0dca5
commit
cbdbb76665
2 changed files with 3 additions and 5 deletions
|
@ -650,12 +650,12 @@ def unified_strdate(date_str):
|
|||
pass
|
||||
return upload_date
|
||||
|
||||
def determine_ext(url):
|
||||
def determine_ext(url, default_ext=u'unknown_video'):
|
||||
guess = url.partition(u'?')[0].rpartition(u'.')[2]
|
||||
if re.match(r'^[A-Za-z0-9]+$', guess):
|
||||
return guess
|
||||
else:
|
||||
return u'unknown_video'
|
||||
return default_ext
|
||||
|
||||
def date_from_str(date_str):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue