[media.ccc.de] Only extract live streams if the conference is streaming

This commit is contained in:
TobiGr 2023-08-05 01:51:59 +02:00
parent 5492343b8e
commit fe27d6a0ec
2 changed files with 11 additions and 8 deletions

View File

@ -96,7 +96,7 @@ public class MediaCCCConferenceExtractor extends ChannelExtractor {
try { try {
conferenceData = JsonParser.object().from(downloader.get(conferenceUrl).responseBody()); conferenceData = JsonParser.object().from(downloader.get(conferenceUrl).responseBody());
} catch (final JsonParserException jpe) { } catch (final JsonParserException jpe) {
throw new ExtractionException("Could not parse json returnd by url: " + conferenceUrl); throw new ExtractionException("Could not parse json returned by URL: " + conferenceUrl);
} }
} }

View File

@ -36,13 +36,16 @@ public class MediaCCCLiveStreamKiosk extends KioskExtractor<StreamInfoItem> {
final StreamInfoItemsCollector collector = new StreamInfoItemsCollector(getServiceId()); final StreamInfoItemsCollector collector = new StreamInfoItemsCollector(getServiceId());
for (int c = 0; c < doc.size(); c++) { for (int c = 0; c < doc.size(); c++) {
final JsonObject conference = doc.getObject(c); final JsonObject conference = doc.getObject(c);
final JsonArray groups = conference.getArray("groups"); if (conference.getBoolean("isCurrentlyStreaming")) {
for (int g = 0; g < groups.size(); g++) { final JsonArray groups = conference.getArray("groups");
final String group = groups.getObject(g).getString("group"); for (int g = 0; g < groups.size(); g++) {
final JsonArray rooms = groups.getObject(g).getArray("rooms"); final String group = groups.getObject(g).getString("group");
for (int r = 0; r < rooms.size(); r++) { final JsonArray rooms = groups.getObject(g).getArray("rooms");
final JsonObject room = rooms.getObject(r); for (int r = 0; r < rooms.size(); r++) {
collector.commit(new MediaCCCLiveStreamKioskExtractor(conference, group, room)); final JsonObject room = rooms.getObject(r);
collector.commit(new MediaCCCLiveStreamKioskExtractor(
conference, group, room));
}
} }
} }