[utils] Fix urljoin for paths with non-http(s) schemes
[youtube-dl] / youtube_dl / utils.py
index d2d3c1a9fde82510f47b8fcd43c726b51bedf9d6..d0cb65814238234e61ea32cff77eeb4a3ad210d3 100644 (file)
@@ -1868,7 +1868,7 @@ def urljoin(base, path):
         path = path.decode('utf-8')
     if not isinstance(path, compat_str) or not path:
         return None
-    if re.match(r'^(?:https?:)?//', path):
+    if re.match(r'^(?:[a-zA-Z][a-zA-Z0-9+-.]*:)?//', path):
         return path
     if isinstance(base, bytes):
         base = base.decode('utf-8')