TikTokLive.client.web package#

Subpackages#

Submodules#

TikTokLive.client.web.web_base module#

class TikTokLive.client.web.web_base.ClientRoute(web: TikTokHTTPClient)#

Bases: ABC

A callable API route for TikTok

class TikTokLive.client.web.web_base.TikTokHTTPClient(proxy: Proxy | None = None, httpx_kwargs: dict = {})#

Bases: object

HTTP client for interacting with the various APIs

async close() None#

Close the HTTP client gracefully

Returns:

None

classmethod generate_device_id() int#

Generate a spoofed device ID for the TikTok API call

Returns:

Device ID number

async get_response(url: str, extra_params: dict = {}, extra_headers: dict = {}, client: AsyncClient | None = None, **kwargs) Response#

Get a response from the underlying httpx.AsyncClient client.

Parameters:
  • url – The URL to request

  • extra_params – Extra parameters to append to the globals

  • extra_headers – Extra headers to append to the globals

  • client – An optional override for the httpx.AsyncClient client

  • kwargs – Optional keywords for the httpx.AsyncClient.get method

Returns:

An httpx.Response object

set_session_id(session_id: str) None#

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

Parameters:

session_id – The (must be valid) session ID

Returns:

None

TikTokLive.client.web.web_client module#

class TikTokLive.client.web.web_client.TikTokWebClient(**kwargs)#

Bases: TikTokHTTPClient

Wrapper for the HTTP client to add web routes

TikTokLive.client.web.web_settings module#

Module contents#