Skip to content

TikTokSigner

Utility to sign any TikTok request using Euler Stream

Utility to sign any TikTok request using Euler Stream

class TikTokSigner
TikTokSigner(sign_api_key: Optional[str] = None, sign_api_base: Optional[str] = None)

Initialize the signing class

  • sign_api_key (Optional[str], default None) — API key for signing requests
  • sign_api_base (Optional[str], default None) — Base URL for the signing API
  • sign_api_key (property, Optional[str]) — API key for signing requests
  • sdk_client (property, AuthenticatedClient | Client) — The SDK client used to sign requests
  • client (property) — The httpx client used to sign requests

Fetch a signed URL for any /webcast/* route using the Sign Server

async def webcast_sign(
url: str | URL,
method: str,
sign_url_type: Literal['xhr', 'fetch'],
payload: str,
user_agent: str,
session_id: Optional[str] = None,
tt_target_idc: Optional[str] = None,
) -> SignTikTokUrlResponse
  • url (str | URL) — The URL to sign
  • method (str) — The HTTP method to sign with
  • sign_url_type (Literal['xhr', 'fetch']) — The type of signing to use
  • payload (str) — The payload to send with the request
  • user_agent (str) — The user agent to use for signing
  • session_id (Optional[str], default None) — The session ID to use for signing
  • tt_target_idc (Optional[str], default None) — The target IDC to use for signing

SignTikTokUrlResponse — The signature response

from TikTokLive.client.web.web_signer import TikTokSigner

TikTokLive/client/web/web_signer.py:24