mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-07-18 19:41:09 -05:00
[utils] accept only supported protocols in url_or_none
This commit is contained in:
@ -3640,7 +3640,7 @@ def url_or_none(url):
|
||||
if not url or not isinstance(url, compat_str):
|
||||
return None
|
||||
url = url.strip()
|
||||
return url if re.match(r'^(?:[a-zA-Z][\da-zA-Z.+-]*:)?//', url) else None
|
||||
return url if re.match(r'^(?:(?:https?|rt(?:m(?:pt?[es]?|fp)|sp[su]?)|mms|ftps?):)?//', url) else None
|
||||
|
||||
|
||||
def parse_duration(s):
|
||||
|
Reference in New Issue
Block a user