]> jfr.im git - yt-dlp.git/blob - yt_dlp/networking/websocket.py
[rh:websockets] Migrate websockets to networking framework (#7720)
[yt-dlp.git] / yt_dlp / networking / websocket.py
1 from __future__ import annotations
2
3 import abc
4
5 from .common import Response, RequestHandler
6
7
8 class WebSocketResponse(Response):
9
10 def send(self, message: bytes | str):
11 """
12 Send a message to the server.
13
14 @param message: The message to send. A string (str) is sent as a text frame, bytes is sent as a binary frame.
15 """
16 raise NotImplementedError
17
18 def recv(self):
19 raise NotImplementedError
20
21
22 class WebSocketRequestHandler(RequestHandler, abc.ABC):
23 pass