1
0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-12 10:11:02 +01:00

[utils] YoutubeDLHTTPSHandler.https_open: pass all required arguments to do_open

With this change the '--no-check-certificate' works again (#4807).
This commit is contained in:
Jaime Marquínez Ferrándiz 2015-01-29 13:37:17 +01:00
parent dcf53d4408
commit 4f264c02c7

View File

@ -654,9 +654,14 @@ class YoutubeDLHTTPSHandler(compat_urllib_request.HTTPSHandler):
self._params = params self._params = params
def https_open(self, req): def https_open(self, req):
kwargs = {}
if hasattr(self, '_context'): # python > 2.6
kwargs['context'] = self._context
if hasattr(self, '_check_hostname'): # python 3.x
kwargs['check_hostname'] = self._check_hostname
return self.do_open(functools.partial( return self.do_open(functools.partial(
_create_http_connection, self, self._https_conn_class, True), _create_http_connection, self, self._https_conn_class, True),
req) req, **kwargs)
def parse_iso8601(date_str, delimiter='T'): def parse_iso8601(date_str, delimiter='T'):