mirror of
https://github.com/jwdeveloper/TikTokLiveJava.git
synced 2026-02-28 01:09:40 -05:00
Fixed bugs:
- addListeners() was throwing exception - 404 response code was return while connecting to tiktok for some users - configure.setRoomId() method for people that want to set roomId manually - client.roomInfo().isAgeRestricted() check if live has age restriction
This commit is contained in:
@@ -89,8 +89,20 @@ public class TikTokLiveClient implements LiveClient {
|
||||
|
||||
|
||||
apiService.updateSessionId();
|
||||
var roomId = apiService.fetchRoomId(liveRoomInfo.getUserName());
|
||||
liveRoomInfo.setRoomId(roomId);
|
||||
|
||||
if(clientSettings.getRoomId() != null)
|
||||
{
|
||||
|
||||
liveRoomInfo.setRoomId(clientSettings.getRoomId());
|
||||
logger.info("Using roomID from settings: "+clientSettings.getRoomId());
|
||||
}
|
||||
else
|
||||
{
|
||||
var roomId = apiService.fetchRoomId(liveRoomInfo.getUserName());
|
||||
liveRoomInfo.setRoomId(roomId);
|
||||
}
|
||||
|
||||
|
||||
var roomData = apiService.fetchRoomInfo();
|
||||
if (roomData.getStatus() == 0 || roomData.getStatus() == 4) {
|
||||
throw new TikTokLiveOfflineHostException("LiveStream for HostID could not be found. Is the Host online?");
|
||||
|
||||
Reference in New Issue
Block a user