mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-04-29 00:10:35 +05:30
Merge pull request #1089 from TeamNewPipe/ccc
[media.ccc.de] Only extract kiosk live stream rooms if they are streaming
This commit is contained in:
commit
7c70fef197
@ -101,7 +101,7 @@ public class MediaCCCService extends StreamingService {
|
|||||||
kioskId
|
kioskId
|
||||||
),
|
),
|
||||||
new MediaCCCConferencesListLinkHandlerFactory(),
|
new MediaCCCConferencesListLinkHandlerFactory(),
|
||||||
"conferences"
|
MediaCCCConferenceKiosk.KIOSK_ID
|
||||||
);
|
);
|
||||||
|
|
||||||
list.addKioskEntry(
|
list.addKioskEntry(
|
||||||
@ -111,7 +111,7 @@ public class MediaCCCService extends StreamingService {
|
|||||||
kioskId
|
kioskId
|
||||||
),
|
),
|
||||||
new MediaCCCRecentListLinkHandlerFactory(),
|
new MediaCCCRecentListLinkHandlerFactory(),
|
||||||
"recent"
|
MediaCCCRecentKiosk.KIOSK_ID
|
||||||
);
|
);
|
||||||
|
|
||||||
list.addKioskEntry(
|
list.addKioskEntry(
|
||||||
@ -121,10 +121,10 @@ public class MediaCCCService extends StreamingService {
|
|||||||
kioskId
|
kioskId
|
||||||
),
|
),
|
||||||
new MediaCCCLiveListLinkHandlerFactory(),
|
new MediaCCCLiveListLinkHandlerFactory(),
|
||||||
"live"
|
MediaCCCLiveStreamKiosk.KIOSK_ID
|
||||||
);
|
);
|
||||||
|
|
||||||
list.setDefaultKiosk("recent");
|
list.setDefaultKiosk(MediaCCCRecentKiosk.KIOSK_ID);
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new ExtractionException(e);
|
throw new ExtractionException(e);
|
||||||
}
|
}
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,6 +21,8 @@ import java.io.IOException;
|
|||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
public class MediaCCCConferenceKiosk extends KioskExtractor<ChannelInfoItem> {
|
public class MediaCCCConferenceKiosk extends KioskExtractor<ChannelInfoItem> {
|
||||||
|
|
||||||
|
public static final String KIOSK_ID = "conferences";
|
||||||
private JsonObject doc;
|
private JsonObject doc;
|
||||||
|
|
||||||
public MediaCCCConferenceKiosk(final StreamingService streamingService,
|
public MediaCCCConferenceKiosk(final StreamingService streamingService,
|
||||||
|
@ -16,6 +16,8 @@ import javax.annotation.Nonnull;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
public class MediaCCCLiveStreamKiosk extends KioskExtractor<StreamInfoItem> {
|
public class MediaCCCLiveStreamKiosk extends KioskExtractor<StreamInfoItem> {
|
||||||
|
|
||||||
|
public static final String KIOSK_ID = "live";
|
||||||
private JsonArray doc;
|
private JsonArray doc;
|
||||||
|
|
||||||
public MediaCCCLiveStreamKiosk(final StreamingService streamingService,
|
public MediaCCCLiveStreamKiosk(final StreamingService streamingService,
|
||||||
@ -36,13 +38,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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,6 +64,6 @@ public class MediaCCCLiveStreamKiosk extends KioskExtractor<StreamInfoItem> {
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public String getName() throws ParsingException {
|
public String getName() throws ParsingException {
|
||||||
return "live";
|
return KIOSK_ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,8 @@ import javax.annotation.Nonnull;
|
|||||||
|
|
||||||
public class MediaCCCRecentKiosk extends KioskExtractor<StreamInfoItem> {
|
public class MediaCCCRecentKiosk extends KioskExtractor<StreamInfoItem> {
|
||||||
|
|
||||||
|
public static final String KIOSK_ID = "recent";
|
||||||
|
|
||||||
private JsonObject doc;
|
private JsonObject doc;
|
||||||
|
|
||||||
public MediaCCCRecentKiosk(final StreamingService streamingService,
|
public MediaCCCRecentKiosk(final StreamingService streamingService,
|
||||||
@ -77,6 +79,6 @@ public class MediaCCCRecentKiosk extends KioskExtractor<StreamInfoItem> {
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public String getName() throws ParsingException {
|
public String getName() throws ParsingException {
|
||||||
return "recent";
|
return KIOSK_ID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,9 +146,9 @@ public class YoutubeService extends StreamingService {
|
|||||||
id
|
id
|
||||||
),
|
),
|
||||||
new YoutubeTrendingLinkHandlerFactory(),
|
new YoutubeTrendingLinkHandlerFactory(),
|
||||||
"Trending"
|
YoutubeTrendingExtractor.KIOSK_ID
|
||||||
);
|
);
|
||||||
list.setDefaultKiosk("Trending");
|
list.setDefaultKiosk(YoutubeTrendingExtractor.KIOSK_ID);
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new ExtractionException(e);
|
throw new ExtractionException(e);
|
||||||
}
|
}
|
||||||
|
@ -46,6 +46,9 @@ import java.util.stream.Stream;
|
|||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
public class YoutubeTrendingExtractor extends KioskExtractor<StreamInfoItem> {
|
public class YoutubeTrendingExtractor extends KioskExtractor<StreamInfoItem> {
|
||||||
|
|
||||||
|
public static final String KIOSK_ID = "Trending";
|
||||||
|
|
||||||
private JsonObject initialData;
|
private JsonObject initialData;
|
||||||
|
|
||||||
private static final String VIDEOS_TAB_PARAMS = "4gIOGgxtb3N0X3BvcHVsYXI%3D";
|
private static final String VIDEOS_TAB_PARAMS = "4gIOGgxtb3N0X3BvcHVsYXI%3D";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user