2
0
Эх сурвалжийг харах

[generic] If the url doesn't specify the protocol, then try to extract prepending 'http://'

Jaime Marquínez Ferrándiz 12 жил өмнө
parent
commit
a7130543fa

+ 5 - 0
youtube_dl/extractor/generic.py

@@ -109,6 +109,11 @@ class GenericIE(InfoExtractor):
         return new_url
         return new_url
 
 
     def _real_extract(self, url):
     def _real_extract(self, url):
+        parsed_url = compat_urlparse.urlparse(url)
+        if not parsed_url.scheme:
+            self._downloader.report_warning('The url doesn\'t specify the protocol, trying with http')
+            return self.url_result('http://' + url)
+
         try:
         try:
             new_url = self._test_redirect(url)
             new_url = self._test_redirect(url)
             if new_url:
             if new_url: