Utility to sign any TikTok request using Euler Stream
Signature
Section titled “Signature”class TikTokSigner
TikTokSigner(sign_api_key: Optional[str] = None, sign_api_base: Optional[str] = None)Initialize the signing class
Parameters
Section titled “Parameters”sign_api_key(Optional[str], defaultNone) — API key for signing requestssign_api_base(Optional[str], defaultNone) — Base URL for the signing API
Attributes
Section titled “Attributes”sign_api_key(property,Optional[str]) — API key for signing requestssdk_client(property,AuthenticatedClient | Client) — The SDK client used to sign requestsclient(property) — The httpx client used to sign requests
Methods
Section titled “Methods”webcast_sign
Section titled “webcast_sign”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,) -> SignTikTokUrlResponseParameters
Section titled “Parameters”url(str | URL) — The URL to signmethod(str) — The HTTP method to sign withsign_url_type(Literal['xhr', 'fetch']) — The type of signing to usepayload(str) — The payload to send with the requestuser_agent(str) — The user agent to use for signingsession_id(Optional[str], defaultNone) — The session ID to use for signingtt_target_idc(Optional[str], defaultNone) — The target IDC to use for signing
Returns
Section titled “Returns”SignTikTokUrlResponse — The signature response
Import
Section titled “Import”from TikTokLive.client.web.web_signer import TikTokSigner