mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 16:59:39 -05:00
Changes:
`onWebsocketMessage()` TikTokWebsocketMessageEvent new event that is triggered when new ProtocolBuffer message come from TikTok server. Should be mainly use for debuging purpose Bugs: - Fixed bug: WebcastSocialMessage was always triggering `TikTokShareEvent` events such as `TikTokLikeEvent`, `TikTokFollowEvent`, `TikTokShareEvent`, `TikTokJoinEvent` was ignored - Fixed bug: Websocket was disconnecting when there was no incoming events for the while. Fixed by implementing background loop that pinging TikTok server every few ms. - Fixed bug: Disconnect method was not working
This commit is contained in:
@@ -33,6 +33,11 @@
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jsoup</groupId>
|
||||
<artifactId>jsoup</artifactId>
|
||||
<version>1.13.1</version> <!-- Check for the latest version -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||
<artifactId>Client</artifactId>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package io.github.jwdeveloper.tiktok.protocol;
|
||||
|
||||
|
||||
import org.jsoup.Jsoup;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public class ProtocolGenerator
|
||||
{
|
||||
public static void main(String[] args) {
|
||||
// Path to the HTML file
|
||||
File htmlFile = new File("C:\\Users\\ja\\IdeaProjects\\TikTokLiveJava\\Tools\\src\\main\\resources\\page.html");
|
||||
|
||||
try {
|
||||
// Parse the HTML file with Jsoup
|
||||
var doc = Jsoup.parse(htmlFile, "UTF-8");
|
||||
|
||||
// Find all script tags
|
||||
var scriptTags = doc.select("script");
|
||||
|
||||
// Display all script tags
|
||||
int counter = 1;
|
||||
for (var scriptTag : scriptTags) {
|
||||
String srcValue = scriptTag.attr("src");
|
||||
|
||||
|
||||
|
||||
if(!srcValue.contains("tiktok/webapp/main/webapp-live/"))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// Only print those script tags which have a 'src' attribute
|
||||
if (!srcValue.isEmpty()) {
|
||||
System.out.println("Script Tag " + counter + " src attribute: " + srcValue);
|
||||
}
|
||||
counter++;
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user