1
0
mirror of https://github.com/l1ving/youtube-dl synced 2024-11-20 20:42:52 +08:00

[utils] Improve determine_ext (Closes #7593)

This commit is contained in:
Sergey M․ 2015-11-22 06:29:39 +06:00
parent e568c2233e
commit 3e12bc583a

View File

@ -922,7 +922,7 @@ def unified_strdate(date_str, day_first=True):
def determine_ext(url, default_ext='unknown_video'):
if url is None:
return default_ext
guess = url.partition('?')[0].rpartition('.')[2]
guess = url.partition('?')[0].rpartition('.')[2].rstrip('/')
if re.match(r'^[A-Za-z0-9]+$', guess):
return guess
else: