]> git.bitcoin.ninja Git - youtube-dl/commitdiff
[generic] If the url doesn't specify the protocol, then try to extract prepending...
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 6 Sep 2013 16:39:35 +0000 (18:39 +0200)
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>
Fri, 6 Sep 2013 16:39:35 +0000 (18:39 +0200)
youtube_dl/extractor/generic.py

index de7379a921bbe2ade08bdc27250c597cd6c1e532..f92e61fea5db38a5c0df130b512a7920def14af5 100644 (file)
@@ -109,6 +109,11 @@ class GenericIE(InfoExtractor):
         return new_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:
             new_url = self._test_redirect(url)
             if new_url: