Explorar el Código

Throw a better error if the protocol is invalid

Philipp Hagemeister hace 12 años
padre
commit
419c64b107
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      youtube_dl/InfoExtractors.py

+ 2 - 0
youtube_dl/InfoExtractors.py

@@ -1304,6 +1304,8 @@ class GenericIE(InfoExtractor):
             opener.add_handler(handler())
             opener.add_handler(handler())
 
 
         response = opener.open(HeadRequest(url))
         response = opener.open(HeadRequest(url))
+        if response is None:
+            raise ExtractorError(u'Invalid URL protocol')
         new_url = response.geturl()
         new_url = response.geturl()
 
 
         if url == new_url:
         if url == new_url: