aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2015-01-30 01:57:46 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2015-01-30 01:57:46 +0100
commita16f6643f0350b52a8940073b81f86f53b7e3001 (patch)
tree9de54cd0a6815589bd363d665bb406cedb4834ee
parentadc0ae3ceb9371eb23a9a4d81d0e134ac861723e (diff)
parent4f264c02c73c8f7551bcdbc960c9635860003196 (diff)
downloadyoutube-dl-a16f6643f0350b52a8940073b81f86f53b7e3001.tar.xz
Merge pull request #4815 from jaimeMF/https_handler
[utils] YoutubeDLHTTPSHandler.https_open: pass all required arguments to to do_open
-rw-r--r--youtube_dl/utils.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
index b8c52af74..a4c9813ec 100644
--- a/youtube_dl/utils.py
+++ b/youtube_dl/utils.py
@@ -654,9 +654,14 @@ class YoutubeDLHTTPSHandler(compat_urllib_request.HTTPSHandler):
self._params = params
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(
_create_http_connection, self, self._https_conn_class, True),
- req)
+ req, **kwargs)
def parse_iso8601(date_str, delimiter='T'):