❤️❤️🎁 Connect to TikTok live in 3 lines 🎁❤️❤️
Introduction
A Rust library. Use it to receive live stream events such as comments and gifts in realtime from TikTok LIVE No credentials are required.
Join the support discord and visit the #rust-support channel for questions, contributions and ideas. Feel free to make pull requests with missing/new features, fixes, etc
Do you prefer other programming languages?
- Java TikTokLiveJava
- Node TikTok-Live-Connector by @zerodytrash
- Python TikTokLive by @isaackogan
- C# TikTokLiveSharp by @frankvHoof93
NOTE: This is not an official API. It's a reverse engineering project.
Overview
Getting started
Dependencies
[]
= "0.0.13"
= { = "1.35.1", = ["full"] }
= "1.0"
= "0.4"
= "0.10.1"
Usage example
use ; // Importing the logger builder and environment configuration
use LevelFilter; // Importing log level filter
use ;
use Duration; // Importing Duration for timeout settings
use ;
use signal; // Importing signal handling from tokio
// Main function is asynchronous and uses tokio runtime
async
// Function to initialize the logger with a default log level
// Function to configure the TikTok live settings
// Function to configure the TikTok live settings with cookies for authentication
// Function to create a TikTok live client for the given username
// Function to create a TikTok live client with cookies for the given username
Library errors table
You can catch errors on events with
use LibError;
if let Err = client.connect.await
| Error type | Description |
|---|---|
| RoomIDFieldMissing | Room ID field is missing, contact developer |
| UserFieldMissing | User field is missing |
| UserDataFieldMissing | User data field is missing |
| LiveDataFieldMissing | Live data field is missing |
| JsonParseError | Error parsing JSON |
| UserMessageFieldMissing | User message field is missing |
| ParamsError | Params error |
| UserStatusFieldMissing | User status field is missing |
| LiveStatusFieldMissing | Live status field is missing |
| TitleFieldMissing | Title field is missing |
| UserCountFieldMissing | User count field is missing |
| StatsFieldMissing | Stats field is missing |
| LikeCountFieldMissing | Like count is missing |
| TotalUserFieldMissing | Total user field is missing |
| LiveRoomFieldMissing | Live room field is missing |
| StartTimeFieldMissing | Start time field is missing |
| UserNotFound | User not found |
| HostNotOnline | Live stream for host is not online!, current status HostOffline |
| InvalidHost | Invalid host in WebSocket URL |
| WebSocketConnectFailed | Failed to connect to WebSocket |
| PushFrameParseError | Unable to read push frame |
| WebcastResponseParseError | Unable to read webcast response |
| AckPacketSendError | Unable to send ack packet |
| HttpRequestFailed | HTTP request failed |
| UrlSigningFailed | URL signing failed |
| HeaderNotReceived | Header was not received |
| BytesParseError | Unable to parse bytes to Push Frame |
test2
Contributing
Your improvements are welcome! Feel free to open an issue or pull request.