diff options
author | Philipp Hagemeister <[email protected]> | 2014-03-10 20:42:54 +0100 |
---|---|---|
committer | Philipp Hagemeister <[email protected]> | 2014-03-10 20:42:54 +0100 |
commit | 04f9bebbcb07c1ca73c34cff1d80fe0b6abaa576 (patch) | |
tree | 4102ae04b0f9dc3e2ac92e9176970b607faf8326 | |
parent | 3ee52157fbade0dc5aab23c25db4c3d86f9d0dd3 (diff) | |
parent | a0792b738ed51ca61eed36ff1dba41d05141093c (diff) | |
download | youtube-dl-04f9bebbcb07c1ca73c34cff1d80fe0b6abaa576.tar.gz youtube-dl-04f9bebbcb07c1ca73c34cff1d80fe0b6abaa576.zip |
Merge remote-tracking branch 'jaimeMF/remove_global_opener'
-rw-r--r-- | youtube_dl/YoutubeDL.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 523eba3c1..1db27315c 100644 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1167,7 +1167,7 @@ class YoutubeDL(object): def urlopen(self, req): """ Start an HTTP download """ - return self._opener.open(req) + return self._opener.open(req, timeout=self._socket_timeout) def print_debug_header(self): if not self.params.get('verbose'): @@ -1198,7 +1198,7 @@ class YoutubeDL(object): def _setup_opener(self): timeout_val = self.params.get('socket_timeout') - timeout = 600 if timeout_val is None else float(timeout_val) + self._socket_timeout = 600 if timeout_val is None else float(timeout_val) opts_cookiefile = self.params.get('cookiefile') opts_proxy = self.params.get('proxy') @@ -1236,7 +1236,3 @@ class YoutubeDL(object): # (See https://github.com/rg3/youtube-dl/issues/1309 for details) opener.addheaders = [] self._opener = opener - - # TODO remove this global modification - compat_urllib_request.install_opener(opener) - socket.setdefaulttimeout(timeout) |