2023-08-17 23:18:12 +00:00
2023-08-18 00:50:32 +02:00
2023-08-18 00:50:32 +02:00
2023-08-18 00:50:32 +02:00
2023-08-18 00:50:32 +02:00
2023-08-05 18:15:37 +02:00
2023-08-16 20:14:40 +02:00
2023-08-17 23:18:12 +00:00
2023-08-16 19:19:29 +02:00

TikTok-Live-Java

A Java library based on TikTok-Connector and TikTokLiveSharp. Use it to receive live stream events such as comments and gifts in realtime from TikTok LIVE by connecting to TikTok's internal WebCast push service. The package includes a wrapper that connects to the WebCast service using just the username (uniqueId). This allows you to connect to your own live chat as well as the live chat of other streamers. No credentials are required. Besides Chat Comments, other events such as Members Joining, Gifts, Subscriptions, Viewers, Follows, Shares, Questions, Likes and Battles can be tracked. You can also send automatic messages into the chat by providing your Session ID.

Do you prefer other programming languages?

NOTE: This is not an official API. It's a reverse engineering project.

Overview

Getting started

  1. Install the package via Maven
npm i tiktok-live-connector
  1. Create your first chat connection
  public static void main(String[] args)
  {
     // Username of someone who is currently live
     var tiktokUsername = "officialgeilegisela";

     TikTokLive.newClient(tiktokUsername)
                .onConnected(event ->
                {
                    System.out.println("Connected");
                })
                .onJoin(event ->
                {
                    System.out.println("User joined -> " + event.getUser().getNickName());
                })
                .onComment(event ->
                {
                    System.out.println(event.getUser().getUniqueId() + ": " + event.getText());
                })
                .onError(event ->
                {
                    event.getException().printStackTrace();
                })
                .buildAndRun();
    }

Methods

A TikTokLive object contains the following methods.

Method Name Description
connect Connects to the live stream chat.
Returns a Promise which will be resolved when the connection is successfully established.
disconnect Disconnects the connection.
getRoomInfo Gets the current room info from TikTok API including streamer info, room status and statistics.

Events

A TikTokLive object has the following events

Events:



Contributing

Your improvements are welcome! Feel free to open an issue or pull request.

Description
Java implementation of TikTok-Live-Connector library. Receive live stream events (comments, gifts, etc.) in realtime from TikTok LIVE.
Readme 20 MiB
Languages
Java 99.4%
HTML 0.5%