Throw a better error if the protocol is invalid

This commit is contained in:
Philipp Hagemeister 2013-05-13 19:54:07 +02:00
parent 99a5ae3f8e
commit 419c64b107

View file

@ -1304,6 +1304,8 @@ def http_error_405(self, req, fp, code, msg, headers):
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: