Skip to content

extract_websocket_options

Options are a cookie-style string, so we parse with SimpleCookie from the stdlib.

Options are a cookie-style string, so we parse with SimpleCookie from the stdlib.

Accepts any string→string mapping so this works with raw dicts as well as websockets’ Headers / httpx Headers objects.

def extract_websocket_options(headers: Mapping[str, str]) -> dict[str, str]
  • headers (Mapping[str, str])

dict[str, str]

from TikTokLive.client.ws.ws_utils import extract_websocket_options

TikTokLive/client/ws/ws_utils.py:114