From f8e0a6c24b4ce2f5a1eedf78348ebe63baf32f90 Mon Sep 17 00:00:00 2001 From: Huyuumi Date: Sun, 29 Jul 2018 02:40:08 +0900 Subject: [PATCH 1/3] Remove the return statement from the __init__ method --- youtube_dl/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index b84436ed6..fdff1b628 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -3569,6 +3569,8 @@ class PerRequestProxyHandler(compat_urllib_request.ProxyHandler): setattr(self, '%s_open' % type, lambda r, proxy='__noproxy__', type=type, meth=self.proxy_open: meth(r, proxy, type)) + + def proxy_handler(self, proxies=None): return compat_urllib_request.ProxyHandler.__init__(self, proxies) def proxy_open(self, req, proxy, type): From 60400dbc3a27c66472ea1897e7cf37598b6fbf79 Mon Sep 17 00:00:00 2001 From: Huyuumi Date: Sun, 29 Jul 2018 02:58:48 +0900 Subject: [PATCH 2/3] add property --- youtube_dl/utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index fdff1b628..7537bc6b7 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -3570,6 +3570,7 @@ class PerRequestProxyHandler(compat_urllib_request.ProxyHandler): lambda r, proxy='__noproxy__', type=type, meth=self.proxy_open: meth(r, proxy, type)) + @property def proxy_handler(self, proxies=None): return compat_urllib_request.ProxyHandler.__init__(self, proxies) From 056490f3365fe158a550194286c87887cadd664e Mon Sep 17 00:00:00 2001 From: Huyuumi Date: Sun, 29 Jul 2018 03:49:37 +0900 Subject: [PATCH 3/3] fix --- youtube_dl/utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py index 7537bc6b7..29cafd8f0 100644 --- a/youtube_dl/utils.py +++ b/youtube_dl/utils.py @@ -3569,10 +3569,7 @@ class PerRequestProxyHandler(compat_urllib_request.ProxyHandler): setattr(self, '%s_open' % type, lambda r, proxy='__noproxy__', type=type, meth=self.proxy_open: meth(r, proxy, type)) - - @property - def proxy_handler(self, proxies=None): - return compat_urllib_request.ProxyHandler.__init__(self, proxies) + compat_urllib_request.ProxyHandler.__init__(self, proxies) def proxy_open(self, req, proxy, type): req_proxy = req.headers.get('Ytdl-request-proxy')