Fix Camsoda playlist URLs

They changed their code again, which constructs the playlist URLs
This commit is contained in:
0xb00bface 2021-02-28 15:09:39 +01:00
parent e7b483088e
commit 8c359e5772
1 changed files with 6 additions and 13 deletions

View File

@ -76,19 +76,12 @@ public class CamsodaModel extends AbstractModel {
private String constructStreamUrl(String edgeServer, String streamName, String token) { private String constructStreamUrl(String edgeServer, String streamName, String token) {
StringBuilder url = new StringBuilder("https://"); StringBuilder url = new StringBuilder("https://");
url.append(edgeServer).append('/'); url.append(edgeServer).append('/');
if (streamName.contains("-flu")) { url.append(streamName);
url.append(streamName); url.append("_h264_aac");
url.append("_h264_aac"); url.append(streamName.contains("-flu") ? "_720p" : "_480p");
url.append(streamName.contains("-flu-hd") ? "_720p" : "_480p"); url.append("/index.m3u8");
url.append("/index.m3u8"); if (!isPublic(streamName)) {
if (!isPublic(streamName)) { url.append("?token=").append(token);
url.append("?token=").append(token);
}
} else {
// https://vide7-ord.camsoda.com/cam/mp4:maxandtokio-enc10-ord_h264_aac_480p/playlist.m3u8
url.append("cam/mp4:");
url.append(streamName);
url.append("_h264_aac_480p/playlist.m3u8");
} }
LOG.trace("Stream URL: {}", url); LOG.trace("Stream URL: {}", url);
return url.toString(); return url.toString();