diff options
author | Simon Sawicki <contact@grub4k.xyz> | 2023-12-30 22:27:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-30 22:27:36 +0100 |
commit | f9fb3ce86e3c6a0c3c33b45392b8d7288bceba76 (patch) | |
tree | 4238cec16764841f1c61b4d8860b87615dfedd6b /yt_dlp/networking/_requests.py | |
parent | 5f009a094f0e8450792b097c4c8273622778052d (diff) |
[cleanup] Misc (#8598)
Authored by: bashonly, pukkandan, seproDev, Grub4K
Co-authored-by: bashonly <bashonly@protonmail.com>
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
Co-authored-by: sepro <4618135+seproDev@users.noreply.github.com>
Diffstat (limited to 'yt_dlp/networking/_requests.py')
-rw-r--r-- | yt_dlp/networking/_requests.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/yt_dlp/networking/_requests.py b/yt_dlp/networking/_requests.py index 9fb1d75f4..e129110ca 100644 --- a/yt_dlp/networking/_requests.py +++ b/yt_dlp/networking/_requests.py @@ -188,6 +188,7 @@ class RequestsSession(requests.sessions.Session): """ Ensure unified redirect method handling with our urllib redirect handler. """ + def rebuild_method(self, prepared_request, response): new_method = get_redirect_method(prepared_request.method, response.status_code) @@ -218,6 +219,7 @@ class Urllib3LoggingFilter(logging.Filter): class Urllib3LoggingHandler(logging.Handler): """Redirect urllib3 logs to our logger""" + def __init__(self, logger, *args, **kwargs): super().__init__(*args, **kwargs) self._logger = logger @@ -367,7 +369,7 @@ class SocksHTTPConnection(urllib3.connection.HTTPConnection): self, f'Connection to {self.host} timed out. (connect timeout={self.timeout})') from e except SocksProxyError as e: raise urllib3.exceptions.ProxyError(str(e), e) from e - except (OSError, socket.error) as e: + except OSError as e: raise urllib3.exceptions.NewConnectionError( self, f'Failed to establish a new connection: {e}') from e |