From 8c0d5041dfc15cb8af4eac815594160b49eb86f3 Mon Sep 17 00:00:00 2001 From: coletdjnz Date: Sat, 18 May 2024 15:54:38 +1200 Subject: [PATCH] revert --- yt_dlp/networking/_websockets.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/yt_dlp/networking/_websockets.py b/yt_dlp/networking/_websockets.py index 541d0eb985..0de81773d4 100644 --- a/yt_dlp/networking/_websockets.py +++ b/yt_dlp/networking/_websockets.py @@ -204,18 +204,15 @@ def _send(self, request): ssl_context = WebsocketsSSLContext(self._make_sslcontext()) else: ssl_context = self._make_sslcontext() - sock = self._make_sock(proxy, request.url, timeout) - # We need to reset the timeout to not conflict with websocket handshake - sock.settimeout(None) try: conn = websockets.sync.client.connect( - sock=sock, + sock=self._make_sock(proxy, request.url, timeout), uri=request.url, additional_headers=headers, open_timeout=timeout, user_agent_header=None, ssl_context=ssl_context, - close_timeout=0, # not ideal, but prevents yt-dlp hanging + close_timeout=0.1, # not ideal, but prevents yt-dlp hanging ) return WebsocketsResponseAdapter(conn, url=request.url)