Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,18 @@ public class LiveClientSettings {
private boolean throwOnAgeRestriction;

/**
* 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>
* Optional: Sometimes not every messages from chat are send to TikTokLiveJava to fix this issue you can set sessionId.
* <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;

/**
* 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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ public LiveUserData.Response getLiveUserData(LiveUserData.Request request) {
.withParam("uniqueId", request.getUserName())
.withParam("sourceType", "54") //MAGIC NUMBER, WHAT 54 means?
.withCookie("sessionid", clientSettings.getSessionId())
.withCookie("tt-target-idc", clientSettings.getTtTargetIdc())
.build()
.toJsonResponse();

Expand Down Expand Up @@ -141,6 +142,7 @@ public LiveData.Response getLiveData(LiveData.Request request) {
var result = httpFactory.client(url)
.withParam("room_id", request.getRoomId())
.withCookie("sessionid", clientSettings.getSessionId())
.withCookie("tt-target-idc", clientSettings.getTtTargetIdc())
.build()
.toJsonResponse();

Expand Down