mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-27 08:49:40 -05:00
Compare commits
2 Commits
1.11.4-Rel
...
1.11.5-Rel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfdced9645 | ||
|
|
7589a2ac4a |
@@ -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.11.3-Release</version>
|
<version>1.11.4-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<artifactId>API</artifactId>
|
<artifactId>API</artifactId>
|
||||||
|
|||||||
@@ -66,5 +66,5 @@ public interface LiveHttpClient
|
|||||||
|
|
||||||
LiveConnectionData.Response fetchLiveConnectionData(LiveConnectionData.Request request);
|
LiveConnectionData.Response fetchLiveConnectionData(LiveConnectionData.Request request);
|
||||||
|
|
||||||
boolean sendChat(LiveRoomInfo roomInfo, String content);
|
boolean sendChat(LiveRoomInfo roomInfo, String content, String sessionId, String ttTargetIdc);
|
||||||
}
|
}
|
||||||
@@ -102,4 +102,12 @@ public interface LiveClient {
|
|||||||
* <p>We cannot fix this as it is a TikTok issue, not a library issue.
|
* <p>We cannot fix this as it is a TikTok issue, not a library issue.
|
||||||
*/
|
*/
|
||||||
boolean sendChat(String content);
|
boolean sendChat(String content);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send a chat message to the connected room
|
||||||
|
* @return true if successful, otherwise false
|
||||||
|
* @apiNote This is known to return true on some sessionIds despite failing!
|
||||||
|
* <p>We cannot fix this as it is a TikTok issue, not a library issue.
|
||||||
|
*/
|
||||||
|
boolean sendChat(String content, String sessionId, String ttTargetIdc);
|
||||||
}
|
}
|
||||||
@@ -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.11.3-Release</version>
|
<version>1.11.4-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
@@ -199,7 +199,12 @@ public class TikTokLiveClient implements LiveClient
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean sendChat(String content) {
|
public boolean sendChat(String content) {
|
||||||
return httpClient.sendChat(roomInfo, content);
|
return sendChat(content, clientSettings.getSessionId(), clientSettings.getTtTargetIdc());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean sendChat(String content, String sessionId, String ttTargetIdc) {
|
||||||
|
return httpClient.sendChat(roomInfo, content, sessionId, ttTargetIdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void connectAsync(Consumer<LiveClient> onConnection) {
|
public void connectAsync(Consumer<LiveClient> onConnection) {
|
||||||
|
|||||||
@@ -182,23 +182,23 @@ public class TikTokLiveHttpClient implements LiveHttpClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean sendChat(LiveRoomInfo roomInfo, String content) {
|
public boolean sendChat(LiveRoomInfo roomInfo, String content, String sessionId, String ttTargetIdc) {
|
||||||
var proxyClientSettings = clientSettings.getHttpSettings().getProxyClientSettings();
|
var proxyClientSettings = clientSettings.getHttpSettings().getProxyClientSettings();
|
||||||
if (proxyClientSettings.isEnabled()) {
|
if (proxyClientSettings.isEnabled()) {
|
||||||
while (proxyClientSettings.hasNext()) {
|
while (proxyClientSettings.hasNext()) {
|
||||||
try {
|
try {
|
||||||
return requestSendChat(roomInfo, content);
|
return requestSendChat(roomInfo, content, sessionId, ttTargetIdc);
|
||||||
} catch (TikTokProxyRequestException ignored) {}
|
} catch (TikTokProxyRequestException ignored) {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return requestSendChat(roomInfo, content);
|
return requestSendChat(roomInfo, content, sessionId, ttTargetIdc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean requestSendChat(LiveRoomInfo roomInfo, String content) {
|
public boolean requestSendChat(LiveRoomInfo roomInfo, String content, String sessionId, String ttTargetIdc) {
|
||||||
JsonObject body = new JsonObject();
|
JsonObject body = new JsonObject();
|
||||||
body.addProperty("content", content);
|
body.addProperty("content", content);
|
||||||
body.addProperty("sessionId", clientSettings.getSessionId());
|
body.addProperty("sessionId", sessionId);
|
||||||
body.addProperty("ttTargetIdc", clientSettings.getTtTargetIdc());
|
body.addProperty("ttTargetIdc", ttTargetIdc);
|
||||||
body.addProperty("roomId", roomInfo.getRoomId());
|
body.addProperty("roomId", roomInfo.getRoomId());
|
||||||
HttpClientBuilder builder = httpFactory.client(clientSettings.isUseEulerstreamEnterprise() ? TIKTOK_CHAT_ENTERPRISE_URL : TIKTOK_CHAT_URL)
|
HttpClientBuilder builder = httpFactory.client(clientSettings.isUseEulerstreamEnterprise() ? TIKTOK_CHAT_ENTERPRISE_URL : TIKTOK_CHAT_URL)
|
||||||
.withHeader("Content-Type", "application/json");
|
.withHeader("Content-Type", "application/json");
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class TikTokLiveHttpOfflineClient implements LiveHttpClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean sendChat(LiveRoomInfo roomInfo, String content) {
|
public boolean sendChat(LiveRoomInfo roomInfo, String content, String sessionId, String ttTargetIdc) {
|
||||||
// DO NOTHING
|
// DO NOTHING
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.11.3-Release</version>
|
<version>1.11.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.11.3-Release</version>
|
<version>1.11.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.11.3-Release</version>
|
<version>1.11.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.11.3-Release</version>
|
<version>1.11.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.11.3-Release</version>
|
<version>1.11.4-Release</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user