diff options
author | coletdjnz <coletdjnz@protonmail.com> | 2023-11-20 08:04:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-20 08:04:04 +0000 |
commit | ccfd70f4c24b579c72123ca76ab50164f8f122b7 (patch) | |
tree | 51641546cbe1365db94c491661e6d946ee4772ee /yt_dlp/YoutubeDL.py | |
parent | 45d82be65f71bb05506bd55376c6fdb36bc54142 (diff) |
[rh:websockets] Migrate websockets to networking framework (#7720)
* Adds a basic WebSocket framework
* Introduces new minimum `websockets` version of 12.0
* Deprecates `WebSocketsWrapper`
Fixes https://github.com/yt-dlp/yt-dlp/issues/8439
Authored by: coletdjnz
Diffstat (limited to 'yt_dlp/YoutubeDL.py')
-rw-r--r-- | yt_dlp/YoutubeDL.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/yt_dlp/YoutubeDL.py b/yt_dlp/YoutubeDL.py index 740826b45..85b282bd5 100644 --- a/yt_dlp/YoutubeDL.py +++ b/yt_dlp/YoutubeDL.py @@ -4052,6 +4052,7 @@ class YoutubeDL: return self._request_director.send(req) except NoSupportingHandlers as e: for ue in e.unsupported_errors: + # FIXME: This depends on the order of errors. if not (ue.handler and ue.msg): continue if ue.handler.RH_KEY == 'Urllib' and 'unsupported url scheme: "file"' in ue.msg.lower(): @@ -4061,6 +4062,15 @@ class YoutubeDL: if 'unsupported proxy type: "https"' in ue.msg.lower(): raise RequestError( 'To use an HTTPS proxy for this request, one of the following dependencies needs to be installed: requests') + + elif ( + re.match(r'unsupported url scheme: "wss?"', ue.msg.lower()) + and 'websockets' not in self._request_director.handlers + ): + raise RequestError( + 'This request requires WebSocket support. ' + 'Ensure one of the following dependencies are installed: websockets', + cause=ue) from ue raise except SSLError as e: if 'UNSAFE_LEGACY_RENEGOTIATION_DISABLED' in str(e): |