Throw a better error if the protocol is invalid
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 13 May 2013 17:54:07 +0000 (19:54 +0200)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 13 May 2013 17:54:07 +0000 (19:54 +0200)
youtube_dl/InfoExtractors.py

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