Overview
TheTikTokWebClient is a wrapper for the HTTP client that provides access to TikTok LIVE API routes. It extends TikTokHTTPClient and registers various routes for interacting with TikTok’s web services.
Usage
The web client is automatically instantiated when you create aTikTokLiveClient. Access it via the client.web property:
Available Routes
TheTikTokWebClient provides the following route attributes:
Room Information Routes
fetch_room_id_from_html
Type: FetchRoomIdLiveHTMLRoute
Fetch a user’s room ID by parsing their livestream HTML page.
fetch_room_id_from_api
Type: FetchRoomIdAPIRoute
Fetch a user’s room ID from TikTok’s API endpoint.
fetch_room_info
Type: FetchRoomInfoRoute
Retrieve detailed room information for a livestream.
Status Routes
fetch_is_live
Type: FetchIsLiveRoute
Check if a user is currently live.
Gift Routes
fetch_gift_list
Type: FetchGifListRoute
Fetch the list of available gifts from TikTok.
Media Routes
fetch_image_data
Type: FetchImageDataRoute
Download image data from TikTok’s CDN.
fetch_video_data
Type: FetchVideoDataRoute
Record a livestream video in real-time.
WebSocket Routes
fetch_signed_websocket
Type: FetchSignedWebSocketRoute
Fetch signed WebSocket connection data from the signature server.
User Routes
fetch_user_unique_id
Type: FetchUserUniqueIdRoute
Resolve a user ID to their unique_id (username).
Interaction Routes
These routes require authentication via session cookies. See Session Management for details.
send_room_chat
Type: SendRoomChatRoute
Send a chat message to a livestream room.
send_room_like
Type: SendRoomLikeRoute
Send likes to a livestream room.
send_room_gift
Type: SendRoomGiftRoute
Send a gift to a livestream broadcaster.
Deprecated Properties
fetch_video
fetch_image
Constructor
Parameters
**kwargs- Arguments passed to the parentTikTokHTTPClientclass