File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
API/src/main/java/io/github/jwdeveloper/tiktok/data/settings
Client/src/main/java/io/github/jwdeveloper/tiktok Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -90,11 +90,18 @@ public class LiveClientSettings {
9090 private boolean throwOnAgeRestriction ;
9191
9292 /**
93- * Optional: Sometimes not every messages from chat are send to TikTokLiveJava to fix this issue you can set sessionId
94- * @see <a href="https://github.com/isaackogan/TikTok-Live-Connector#send-chat-messages">Documentation: How to obtain sessionId</a>
93+ * Optional: Sometimes not every messages from chat are send to TikTokLiveJava to fix this issue you can set sessionId.
94+ * <p>This requires {@link #ttTargetIdc} also being set correctly for sessionid to be effective.
95+ * @apiNote This cookie is supplied by <a href="https://www.tiktok.com">TikTok</a> and can be found in your browser cookies.
9596 */
9697 private String sessionId ;
9798
99+ /**
100+ * Used with {@link #sessionId} to verify it is valid and return extra chat messages and 18+ content.
101+ * @apiNote This cookie is supplied by <a href="https://www.tiktok.com">TikTok</a> and can be found in your browser cookies.
102+ */
103+ private String ttTargetIdc ;
104+
98105 /**
99106 * Optional: By default roomID is fetched before connect to live, but you can set it manually
100107 */
Original file line number Diff line number Diff line change @@ -113,6 +113,7 @@ public LiveUserData.Response getLiveUserData(LiveUserData.Request request) {
113113 .withParam ("uniqueId" , request .getUserName ())
114114 .withParam ("sourceType" , "54" ) //MAGIC NUMBER, WHAT 54 means?
115115 .withCookie ("sessionid" , clientSettings .getSessionId ())
116+ .withCookie ("tt-target-idc" , clientSettings .getTtTargetIdc ())
116117 .build ()
117118 .toJsonResponse ();
118119
@@ -141,6 +142,7 @@ public LiveData.Response getLiveData(LiveData.Request request) {
141142 var result = httpFactory .client (url )
142143 .withParam ("room_id" , request .getRoomId ())
143144 .withCookie ("sessionid" , clientSettings .getSessionId ())
145+ .withCookie ("tt-target-idc" , clientSettings .getTtTargetIdc ())
144146 .build ()
145147 .toJsonResponse ();
146148
You can’t perform that action at this time.
0 commit comments