mirror of
https://github.com/blackjack4494/yt-dlc.git
synced 2024-12-22 15:57:23 +00:00
[utils] Improve determine_ext (Closes #7593)
This commit is contained in:
parent
e568c2233e
commit
3e12bc583a
1 changed files with 1 additions and 1 deletions
|
@ -922,7 +922,7 @@ def unified_strdate(date_str, day_first=True):
|
||||||
def determine_ext(url, default_ext='unknown_video'):
|
def determine_ext(url, default_ext='unknown_video'):
|
||||||
if url is None:
|
if url is None:
|
||||||
return default_ext
|
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):
|
if re.match(r'^[A-Za-z0-9]+$', guess):
|
||||||
return guess
|
return guess
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue