mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-28 09:19:40 -05:00
Compare commits
7 Commits
develop-1.
...
1.10.5-Rel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba69f5f5eb | ||
|
|
e9a91f5741 | ||
|
|
053bb5e3dc | ||
|
|
906796dc23 | ||
|
|
162092c638 | ||
|
|
a72d134796 | ||
|
|
75f6368f2c |
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.10.2-Release</version>
|
<version>1.10.4-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>API</artifactId>
|
<artifactId>API</artifactId>
|
||||||
|
|||||||
@@ -90,11 +90,18 @@ public class LiveClientSettings {
|
|||||||
private boolean throwOnAgeRestriction;
|
private boolean throwOnAgeRestriction;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional: Sometimes not every messages from chat are send to TikTokLiveJava to fix this issue you can set sessionId
|
* Optional: Sometimes not every messages from chat are send to TikTokLiveJava to fix this issue you can set sessionId.
|
||||||
* @see <a href="https://github.com/isaackogan/TikTok-Live-Connector#send-chat-messages">Documentation: How to obtain sessionId</a>
|
* <p>This requires {@link #ttTargetIdc} also being set correctly for sessionid to be effective.
|
||||||
|
* @apiNote This cookie is supplied by <a href="https://www.tiktok.com">TikTok</a> and can be found in your browser cookies.
|
||||||
*/
|
*/
|
||||||
private String sessionId;
|
private String sessionId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Used with {@link #sessionId} to verify it is valid and return extra chat messages and 18+ content.
|
||||||
|
* @apiNote This cookie is supplied by <a href="https://www.tiktok.com">TikTok</a> and can be found in your browser cookies.
|
||||||
|
*/
|
||||||
|
private String ttTargetIdc;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional: By default roomID is fetched before connect to live, but you can set it manually
|
* Optional: By default roomID is fetched before connect to live, but you can set it manually
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.10.2-Release</version>
|
<version>1.10.4-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ public class TikTokLiveHttpClient implements LiveHttpClient
|
|||||||
.withParam("uniqueId", request.getUserName())
|
.withParam("uniqueId", request.getUserName())
|
||||||
.withParam("sourceType", "54") //MAGIC NUMBER, WHAT 54 means?
|
.withParam("sourceType", "54") //MAGIC NUMBER, WHAT 54 means?
|
||||||
.withCookie("sessionid", clientSettings.getSessionId())
|
.withCookie("sessionid", clientSettings.getSessionId())
|
||||||
|
.withCookie("tt-target-idc", clientSettings.getTtTargetIdc())
|
||||||
.build()
|
.build()
|
||||||
.toJsonResponse();
|
.toJsonResponse();
|
||||||
|
|
||||||
@@ -141,6 +142,7 @@ public class TikTokLiveHttpClient implements LiveHttpClient
|
|||||||
var result = httpFactory.client(url)
|
var result = httpFactory.client(url)
|
||||||
.withParam("room_id", request.getRoomId())
|
.withParam("room_id", request.getRoomId())
|
||||||
.withCookie("sessionid", clientSettings.getSessionId())
|
.withCookie("sessionid", clientSettings.getSessionId())
|
||||||
|
.withCookie("tt-target-idc", clientSettings.getTtTargetIdc())
|
||||||
.build()
|
.build()
|
||||||
.toJsonResponse();
|
.toJsonResponse();
|
||||||
|
|
||||||
|
|||||||
@@ -110,13 +110,12 @@ public class TikTokWebSocketClient implements LiveSocketClient {
|
|||||||
ProxyData proxyData = proxySettings.next();
|
ProxyData proxyData = proxySettings.next();
|
||||||
if (tryProxyConnection(proxySettings, proxyData)) {
|
if (tryProxyConnection(proxySettings, proxyData)) {
|
||||||
heartbeatTask.run(webSocketClient, clientSettings.getPingInterval());
|
heartbeatTask.run(webSocketClient, clientSettings.getPingInterval());
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
if (proxySettings.isAutoDiscard())
|
if (proxySettings.isAutoDiscard())
|
||||||
proxySettings.remove();
|
proxySettings.remove();
|
||||||
}
|
}
|
||||||
if (!isConnected())
|
throw new TikTokLiveException("Failed to connect to the websocket");
|
||||||
throw new TikTokLiveException("Failed to connect to the websocket");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean tryProxyConnection(ProxyClientSettings proxySettings, ProxyData proxyData) {
|
public boolean tryProxyConnection(ProxyClientSettings proxySettings, ProxyData proxyData) {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.10.2-Release</version>
|
<version>1.10.4-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<version>1.10.2-Release</version>
|
<version>1.10.4-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.10.2-Release</version>
|
<version>1.10.4-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>extension-recorder</artifactId>
|
<artifactId>extension-recorder</artifactId>
|
||||||
|
|||||||
2
pom.xml
2
pom.xml
@@ -7,7 +7,7 @@
|
|||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.10.2-Release</version>
|
<version>1.10.4-Release</version>
|
||||||
<modules>
|
<modules>
|
||||||
<module>API</module>
|
<module>API</module>
|
||||||
<module>Client</module>
|
<module>Client</module>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>TikTokLiveJava</artifactId>
|
<artifactId>TikTokLiveJava</artifactId>
|
||||||
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
<groupId>io.github.jwdeveloper.tiktok</groupId>
|
||||||
<version>1.10.2-Release</version>
|
<version>1.10.4-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user