diff --git a/common/src/main/java/ctbrec/sites/chaturbate/ChaturbateModel.java b/common/src/main/java/ctbrec/sites/chaturbate/ChaturbateModel.java index 9334199d..7c2176ef 100644 --- a/common/src/main/java/ctbrec/sites/chaturbate/ChaturbateModel.java +++ b/common/src/main/java/ctbrec/sites/chaturbate/ChaturbateModel.java @@ -315,18 +315,20 @@ public class ChaturbateModel extends AbstractModel { log.trace("Raw stream info for model {}: {}", getName(), content); streamInfo = mapper.readValue(content, StreamInfo.class); - if (streamInfo.cmaf_edge && streamInfo.url.contains("playlist.m3u8")) { - streamInfo.url = streamInfo.url.replace("playlist.m3u8", "playlist_sfm4s.m3u8"); - } else if (streamInfo.url.contains("playlist_sfm4s.m3u8")) { - streamInfo.url = streamInfo.url.replace("playlist_sfm4s.m3u8", "playlist.m3u8"); - } - - var match = serverPattern.matcher(streamInfo.url); - - if (getSite().getHttpClient().isLoggedIn()) { - streamInfo.url = match.replaceFirst("live-fhls/amlst"); - } else { - streamInfo.url = match.replaceFirst("live-c-fhls/amlst"); + if (streamInfo.cmaf_edge) { + if (streamInfo.url.contains("playlist.m3u8")) { + streamInfo.url = streamInfo.url.replace("playlist.m3u8", "playlist_sfm4s.m3u8"); + } else if (streamInfo.url.contains("playlist_sfm4s.m3u8")) { + streamInfo.url = streamInfo.url.replace("playlist_sfm4s.m3u8", "playlist.m3u8"); + } + + var match = serverPattern.matcher(streamInfo.url); + + if (getSite().getHttpClient().isLoggedIn()) { + streamInfo.url = match.replaceFirst("live-fhls/amlst"); + } else { + streamInfo.url = match.replaceFirst("live-c-fhls/amlst"); + } } return streamInfo;