forked from j62/ctbrec
1
0
Fork 0

Fixed bug in JSON parsing

Some models wouldn't get recorded, because of a missing element in the
JSON doc
This commit is contained in:
0xb00bface 2020-08-08 21:23:38 +02:00
parent caf329eb23
commit b6e4bad837
1 changed files with 2 additions and 3 deletions

View File

@ -95,9 +95,8 @@ public class StripchatModel extends AbstractModel {
best.width = broadcastSettings.optInt("width");
best.mediaPlaylistUrl = "https://b-" + serverName + ".stripst.com/hls/" + streamName + "/" + streamName + ".m3u8";
sources.add(best);
Object resolutionObject = broadcastSettings.get("resolutions");
if (resolutionObject instanceof JSONObject) {
JSONObject resolutions = (JSONObject) resolutionObject;
JSONObject resolutions = broadcastSettings.optJSONObject("resolutions");
if (resolutions instanceof JSONObject) {
JSONArray heights = resolutions.names();
for (int i = 0; i < heights.length(); i++) {
String h = heights.getString(i);