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:
JW
2023-09-19 02:53:04 +02:00
parent a2da5169db
commit 84bbfa97e9
13 changed files with 105 additions and 47 deletions

View File

@@ -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?");