Skip to content

A feature-rich command-line audio/video downloader

Throw a better error if the protocol is invalid

Philipp Hagemeister419c64b10789
diff --git a/youtube_dl/InfoExtractors.py b/youtube_dl/InfoExtractors.py
index ce959a6dfe..6d6203a1cd 100755
--- a/youtube_dl/InfoExtractors.py
+++ b/youtube_dl/InfoExtractors.py
@@ -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: