diff options
author | Remita Amine <remitamine@gmail.com> | 2020-12-30 09:22:30 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2020-12-30 09:22:30 +0100 |
commit | 9dd674e1d20440564a3d25f33cd8785695e110f6 (patch) | |
tree | c0a878181142c7c8267f9c580fb59f7647f9f428 /youtube_dl/utils.py | |
parent | 9c1e164e0cd77331ea4f0b474b32fd06f84bad71 (diff) |
[utils] accept only supported protocols in url_or_none
Diffstat (limited to 'youtube_dl/utils.py')
-rw-r--r-- | youtube_dl/utils.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 8cefafd79..d5fb6fd24 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -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): |