pull/9625/head
coletdjnz 2 weeks ago
parent 44da2e1323
commit 8c0d5041df
No known key found for this signature in database
GPG Key ID: 91984263BB39894A

@ -204,18 +204,15 @@ class WebsocketsRH(WebSocketRequestHandler):
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)

Loading…
Cancel
Save