Skip to content

ws_utils

module TikTokLive.client.ws.ws_utils

  • build_webcast_uri — Build a webcast URI from a base URI and parameters. This method will format the base URI with the parameters and return the formatted URI.
  • extract_webcast_push_frame — Extract a WebcastPushFrame from a raw byte payload. This method will parse the payload and return a WebcastPushFrame object. This method is useful for extracting push frames from a WebSocket connection.
  • extract_webcast_response_message — Extract the ProtoMessageFetchResult from a push frame. If compression is enabled on the WebSocket, then messages will come gzipped. This method will decompress the payload if necessary. The gzip format allows for less bandwidth usage, at the cost of a slight CPU increase for message decompression.
  • extract_websocket_options — Options are a cookie-style string, so we parse with SimpleCookie from the stdlib.
import TikTokLive.client.ws.ws_utils

TikTokLive/client/ws/ws_utils.py