Explorar o código

[extractor/common] Assume non HTTP(S) URLs valid

Sergey M․ %!s(int64=10) %!d(string=hai) anos
pai
achega
2f0f6578c3
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      youtube_dl/extractor/common.py

+ 4 - 0
youtube_dl/extractor/common.py

@@ -767,6 +767,10 @@ class InfoExtractor(object):
                 formats)
 
     def _is_valid_url(self, url, video_id, item='video'):
+        url = self._proto_relative_url(url, scheme='http:')
+        # For now assume non HTTP(S) URLs always valid
+        if not (url.startswith('http://') or url.startswith('https://')):
+            return True
         try:
             self._request_webpage(url, video_id, 'Checking %s URL' % item)
             return True