Skip to content

set_session

Set the session id cookies for the HTTP client and Websocket connection

Method of TikTokHTTPClient.

Set the session id cookies for the HTTP client and Websocket connection

def set_session(session_id: str | None, tt_target_idc: str | None) -> None
  • session_id (str | None) — The (must be valid) session ID
  • tt_target_idc (str | None) — The tt-target-idc cookie, i.e. the data center holding the user’s account credentials. (e.g. eu-ttp2)

None — None

from TikTokLive.client.web.web_base import TikTokHTTPClient

TikTokLive/client/web/web_base.py:123