Use media.ccc.de instead of api.media.ccc.de

This commit is contained in:
wb9688 2020-04-01 11:40:03 +02:00
parent c8abc1abd5
commit bf24caa5f2
17 changed files with 184 additions and 181 deletions

View File

@ -6,7 +6,12 @@ import org.schabi.newpipe.extractor.comments.CommentsExtractor;
import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.kiosk.KioskExtractor; import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
import org.schabi.newpipe.extractor.kiosk.KioskList; import org.schabi.newpipe.extractor.kiosk.KioskList;
import org.schabi.newpipe.extractor.linkhandler.*; import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandlerFactory;
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandler;
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandlerFactory;
import org.schabi.newpipe.extractor.playlist.PlaylistExtractor; import org.schabi.newpipe.extractor.playlist.PlaylistExtractor;
import org.schabi.newpipe.extractor.search.SearchExtractor; import org.schabi.newpipe.extractor.search.SearchExtractor;
import org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCConferenceExtractor; import org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCConferenceExtractor;
@ -21,19 +26,17 @@ import org.schabi.newpipe.extractor.stream.StreamExtractor;
import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor; import org.schabi.newpipe.extractor.subscription.SubscriptionExtractor;
import org.schabi.newpipe.extractor.suggestion.SuggestionExtractor; import org.schabi.newpipe.extractor.suggestion.SuggestionExtractor;
import java.io.IOException;
import static java.util.Arrays.asList; import static java.util.Arrays.asList;
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.AUDIO; import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.AUDIO;
import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.VIDEO; import static org.schabi.newpipe.extractor.StreamingService.ServiceInfo.MediaCapability.VIDEO;
public class MediaCCCService extends StreamingService { public class MediaCCCService extends StreamingService {
public MediaCCCService(int id) { public MediaCCCService(final int id) {
super(id, "MediaCCC", asList(AUDIO, VIDEO)); super(id, "MediaCCC", asList(AUDIO, VIDEO));
} }
@Override @Override
public SearchExtractor getSearchExtractor(SearchQueryHandler query) { public SearchExtractor getSearchExtractor(final SearchQueryHandler query) {
return new MediaCCCSearchExtractor(this, query); return new MediaCCCSearchExtractor(this, query);
} }
@ -58,17 +61,17 @@ public class MediaCCCService extends StreamingService {
} }
@Override @Override
public StreamExtractor getStreamExtractor(LinkHandler linkHandler) { public StreamExtractor getStreamExtractor(final LinkHandler linkHandler) {
return new MediaCCCStreamExtractor(this, linkHandler); return new MediaCCCStreamExtractor(this, linkHandler);
} }
@Override @Override
public ChannelExtractor getChannelExtractor(ListLinkHandler linkHandler) { public ChannelExtractor getChannelExtractor(final ListLinkHandler linkHandler) {
return new MediaCCCConferenceExtractor(this, linkHandler); return new MediaCCCConferenceExtractor(this, linkHandler);
} }
@Override @Override
public PlaylistExtractor getPlaylistExtractor(ListLinkHandler linkHandler) { public PlaylistExtractor getPlaylistExtractor(final ListLinkHandler linkHandler) {
return null; return null;
} }
@ -85,9 +88,9 @@ public class MediaCCCService extends StreamingService {
try { try {
list.addKioskEntry(new KioskList.KioskExtractorFactory() { list.addKioskEntry(new KioskList.KioskExtractorFactory() {
@Override @Override
public KioskExtractor createNewKiosk(StreamingService streamingService, public KioskExtractor createNewKiosk(final StreamingService streamingService,
String url, final String url, final String kioskId)
String kioskId) throws ExtractionException, IOException { throws ExtractionException {
return new MediaCCCConferenceKiosk(MediaCCCService.this, return new MediaCCCConferenceKiosk(MediaCCCService.this,
new MediaCCCConferencesListLinkHandlerFactory().fromUrl(url), kioskId); new MediaCCCConferencesListLinkHandlerFactory().fromUrl(url), kioskId);
} }
@ -111,8 +114,7 @@ public class MediaCCCService extends StreamingService {
} }
@Override @Override
public CommentsExtractor getCommentsExtractor(ListLinkHandler linkHandler) public CommentsExtractor getCommentsExtractor(final ListLinkHandler linkHandler) {
throws ExtractionException {
return null; return null;
} }

View File

@ -4,6 +4,7 @@ import com.grack.nanojson.JsonArray;
import com.grack.nanojson.JsonObject; import com.grack.nanojson.JsonObject;
import com.grack.nanojson.JsonParser; import com.grack.nanojson.JsonParser;
import com.grack.nanojson.JsonParserException; import com.grack.nanojson.JsonParserException;
import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.channel.ChannelExtractor; import org.schabi.newpipe.extractor.channel.ChannelExtractor;
import org.schabi.newpipe.extractor.downloader.Downloader; import org.schabi.newpipe.extractor.downloader.Downloader;
@ -14,45 +15,46 @@ import org.schabi.newpipe.extractor.services.media_ccc.extractors.infoItems.Medi
import org.schabi.newpipe.extractor.stream.StreamInfoItem; import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector; import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector;
import javax.annotation.Nonnull;
import java.io.IOException; import java.io.IOException;
public class MediaCCCConferenceExtractor extends ChannelExtractor { import javax.annotation.Nonnull;
public class MediaCCCConferenceExtractor extends ChannelExtractor {
private JsonObject conferenceData; private JsonObject conferenceData;
public MediaCCCConferenceExtractor(StreamingService service, ListLinkHandler linkHandler) { public MediaCCCConferenceExtractor(final StreamingService service,
final ListLinkHandler linkHandler) {
super(service, linkHandler); super(service, linkHandler);
} }
@Override @Override
public String getAvatarUrl() throws ParsingException { public String getAvatarUrl() {
return conferenceData.getString("logo_url"); return conferenceData.getString("logo_url");
} }
@Override @Override
public String getBannerUrl() throws ParsingException { public String getBannerUrl() {
return conferenceData.getString("logo_url"); return conferenceData.getString("logo_url");
} }
@Override @Override
public String getFeedUrl() throws ParsingException { public String getFeedUrl() {
return null; return null;
} }
@Override @Override
public long getSubscriberCount() throws ParsingException { public long getSubscriberCount() {
return -1; return -1;
} }
@Override @Override
public String getDescription() throws ParsingException { public String getDescription() {
return null; return null;
} }
@Nonnull @Nonnull
@Override @Override
public InfoItemsPage<StreamInfoItem> getInitialPage() throws IOException, ExtractionException { public InfoItemsPage<StreamInfoItem> getInitialPage() {
StreamInfoItemsCollector collector = new StreamInfoItemsCollector(getServiceId()); StreamInfoItemsCollector collector = new StreamInfoItemsCollector(getServiceId());
JsonArray events = conferenceData.getArray("events"); JsonArray events = conferenceData.getArray("events");
for (int i = 0; i < events.size(); i++) { for (int i = 0; i < events.size(); i++) {
@ -62,17 +64,18 @@ public class MediaCCCConferenceExtractor extends ChannelExtractor {
} }
@Override @Override
public String getNextPageUrl() throws IOException, ExtractionException { public String getNextPageUrl() {
return null; return null;
} }
@Override @Override
public InfoItemsPage<StreamInfoItem> getPage(String pageUrl) throws IOException, ExtractionException { public InfoItemsPage<StreamInfoItem> getPage(final String pageUrl) {
return null; return null;
} }
@Override @Override
public void onFetchPage(@Nonnull Downloader downloader) throws IOException, ExtractionException { public void onFetchPage(@Nonnull final Downloader downloader)
throws IOException, ExtractionException {
try { try {
conferenceData = JsonParser.object().from(downloader.get(getUrl()).responseBody()); conferenceData = JsonParser.object().from(downloader.get(getUrl()).responseBody());
} catch (JsonParserException jpe) { } catch (JsonParserException jpe) {
@ -88,7 +91,7 @@ public class MediaCCCConferenceExtractor extends ChannelExtractor {
@Nonnull @Nonnull
@Override @Override
public String getOriginalUrl() throws ParsingException { public String getOriginalUrl() {
return "https://media.ccc.de/c/" + conferenceData.getString("acronym"); return "https://media.ccc.de/c/" + conferenceData.getString("acronym");
} }
} }

View File

@ -4,6 +4,7 @@ import com.grack.nanojson.JsonArray;
import com.grack.nanojson.JsonObject; import com.grack.nanojson.JsonObject;
import com.grack.nanojson.JsonParser; import com.grack.nanojson.JsonParser;
import com.grack.nanojson.JsonParserException; import com.grack.nanojson.JsonParserException;
import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.channel.ChannelInfoItem; import org.schabi.newpipe.extractor.channel.ChannelInfoItem;
import org.schabi.newpipe.extractor.channel.ChannelInfoItemsCollector; import org.schabi.newpipe.extractor.channel.ChannelInfoItemsCollector;
@ -14,22 +15,22 @@ import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler; import org.schabi.newpipe.extractor.linkhandler.ListLinkHandler;
import org.schabi.newpipe.extractor.services.media_ccc.extractors.infoItems.MediaCCCConferenceInfoItemExtractor; import org.schabi.newpipe.extractor.services.media_ccc.extractors.infoItems.MediaCCCConferenceInfoItemExtractor;
import javax.annotation.Nonnull;
import java.io.IOException; import java.io.IOException;
public class MediaCCCConferenceKiosk extends KioskExtractor<ChannelInfoItem> { import javax.annotation.Nonnull;
public class MediaCCCConferenceKiosk extends KioskExtractor<ChannelInfoItem> {
private JsonObject doc; private JsonObject doc;
public MediaCCCConferenceKiosk(StreamingService streamingService, public MediaCCCConferenceKiosk(final StreamingService streamingService,
ListLinkHandler linkHandler, final ListLinkHandler linkHandler,
String kioskId) { final String kioskId) {
super(streamingService, linkHandler, kioskId); super(streamingService, linkHandler, kioskId);
} }
@Nonnull @Nonnull
@Override @Override
public InfoItemsPage<ChannelInfoItem> getInitialPage() throws IOException, ExtractionException { public InfoItemsPage<ChannelInfoItem> getInitialPage() {
JsonArray conferences = doc.getArray("conferences"); JsonArray conferences = doc.getArray("conferences");
ChannelInfoItemsCollector collector = new ChannelInfoItemsCollector(getServiceId()); ChannelInfoItemsCollector collector = new ChannelInfoItemsCollector(getServiceId());
for (int i = 0; i < conferences.size(); i++) { for (int i = 0; i < conferences.size(); i++) {
@ -40,18 +41,20 @@ public class MediaCCCConferenceKiosk extends KioskExtractor<ChannelInfoItem> {
} }
@Override @Override
public String getNextPageUrl() throws IOException, ExtractionException { public String getNextPageUrl() {
return ""; return "";
} }
@Override @Override
public InfoItemsPage<ChannelInfoItem> getPage(String pageUrl) throws IOException, ExtractionException { public InfoItemsPage<ChannelInfoItem> getPage(final String pageUrl) {
return InfoItemsPage.emptyPage(); return InfoItemsPage.emptyPage();
} }
@Override @Override
public void onFetchPage(@Nonnull Downloader downloader) throws IOException, ExtractionException { public void onFetchPage(@Nonnull final Downloader downloader)
String site = downloader.get(getLinkHandler().getUrl(), getExtractorLocalization()).responseBody(); throws IOException, ExtractionException {
final String site = downloader.get(getLinkHandler().getUrl(), getExtractorLocalization())
.responseBody();
try { try {
doc = JsonParser.object().from(site); doc = JsonParser.object().from(site);
} catch (JsonParserException jpe) { } catch (JsonParserException jpe) {

View File

@ -7,11 +7,10 @@ import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
public class MediaCCCParsingHelper { public final class MediaCCCParsingHelper {
private MediaCCCParsingHelper() { private MediaCCCParsingHelper() { }
}
public static Calendar parseDateFrom(String textualUploadDate) throws ParsingException { public static Calendar parseDateFrom(final String textualUploadDate) throws ParsingException {
Date date; Date date;
try { try {
date = new SimpleDateFormat("yyyy-MM-dd").parse(textualUploadDate); date = new SimpleDateFormat("yyyy-MM-dd").parse(textualUploadDate);

View File

@ -4,31 +4,34 @@ import com.grack.nanojson.JsonArray;
import com.grack.nanojson.JsonObject; import com.grack.nanojson.JsonObject;
import com.grack.nanojson.JsonParser; import com.grack.nanojson.JsonParser;
import com.grack.nanojson.JsonParserException; import com.grack.nanojson.JsonParserException;
import org.schabi.newpipe.extractor.InfoItem; import org.schabi.newpipe.extractor.InfoItem;
import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.channel.ChannelInfoItem; import org.schabi.newpipe.extractor.channel.ChannelInfoItem;
import org.schabi.newpipe.extractor.channel.ChannelInfoItemExtractor; import org.schabi.newpipe.extractor.channel.ChannelInfoItemExtractor;
import org.schabi.newpipe.extractor.downloader.Downloader; import org.schabi.newpipe.extractor.downloader.Downloader;
import org.schabi.newpipe.extractor.exceptions.ExtractionException; import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandler; import org.schabi.newpipe.extractor.linkhandler.SearchQueryHandler;
import org.schabi.newpipe.extractor.search.InfoItemsSearchCollector; import org.schabi.newpipe.extractor.search.InfoItemsSearchCollector;
import org.schabi.newpipe.extractor.search.SearchExtractor; import org.schabi.newpipe.extractor.search.SearchExtractor;
import org.schabi.newpipe.extractor.services.media_ccc.extractors.infoItems.MediaCCCStreamInfoItemExtractor; import org.schabi.newpipe.extractor.services.media_ccc.extractors.infoItems.MediaCCCStreamInfoItemExtractor;
import org.schabi.newpipe.extractor.services.media_ccc.linkHandler.MediaCCCConferencesListLinkHandlerFactory; import org.schabi.newpipe.extractor.services.media_ccc.linkHandler.MediaCCCConferencesListLinkHandlerFactory;
import javax.annotation.Nonnull;
import java.io.IOException; import java.io.IOException;
import java.util.List; import java.util.List;
import static org.schabi.newpipe.extractor.services.media_ccc.linkHandler.MediaCCCSearchQueryHandlerFactory.*; import javax.annotation.Nonnull;
import static org.schabi.newpipe.extractor.services.media_ccc.linkHandler.MediaCCCSearchQueryHandlerFactory.ALL;
import static org.schabi.newpipe.extractor.services.media_ccc.linkHandler.MediaCCCSearchQueryHandlerFactory.CONFERENCES;
import static org.schabi.newpipe.extractor.services.media_ccc.linkHandler.MediaCCCSearchQueryHandlerFactory.EVENTS;
public class MediaCCCSearchExtractor extends SearchExtractor { public class MediaCCCSearchExtractor extends SearchExtractor {
private JsonObject doc; private JsonObject doc;
private MediaCCCConferenceKiosk conferenceKiosk; private MediaCCCConferenceKiosk conferenceKiosk;
public MediaCCCSearchExtractor(StreamingService service, SearchQueryHandler linkHandler) { public MediaCCCSearchExtractor(final StreamingService service,
final SearchQueryHandler linkHandler) {
super(service, linkHandler); super(service, linkHandler);
try { try {
conferenceKiosk = new MediaCCCConferenceKiosk(service, conferenceKiosk = new MediaCCCConferenceKiosk(service,
@ -40,13 +43,13 @@ public class MediaCCCSearchExtractor extends SearchExtractor {
} }
@Override @Override
public String getSearchSuggestion() throws ParsingException { public String getSearchSuggestion() {
return null; return null;
} }
@Nonnull @Nonnull
@Override @Override
public InfoItemsPage<InfoItem> getInitialPage() throws IOException, ExtractionException { public InfoItemsPage<InfoItem> getInitialPage() {
final InfoItemsSearchCollector searchItems = new InfoItemsSearchCollector(getServiceId()); final InfoItemsSearchCollector searchItems = new InfoItemsSearchCollector(getServiceId());
if (getLinkHandler().getContentFilters().contains(CONFERENCES) if (getLinkHandler().getContentFilters().contains(CONFERENCES)
@ -70,17 +73,18 @@ public class MediaCCCSearchExtractor extends SearchExtractor {
} }
@Override @Override
public String getNextPageUrl() throws IOException, ExtractionException { public String getNextPageUrl() {
return ""; return "";
} }
@Override @Override
public InfoItemsPage<InfoItem> getPage(String pageUrl) throws IOException, ExtractionException { public InfoItemsPage<InfoItem> getPage(final String pageUrl) {
return InfoItemsPage.emptyPage(); return InfoItemsPage.emptyPage();
} }
@Override @Override
public void onFetchPage(@Nonnull Downloader downloader) throws IOException, ExtractionException { public void onFetchPage(@Nonnull final Downloader downloader)
throws IOException, ExtractionException {
if (getLinkHandler().getContentFilters().contains(EVENTS) if (getLinkHandler().getContentFilters().contains(EVENTS)
|| getLinkHandler().getContentFilters().contains(ALL) || getLinkHandler().getContentFilters().contains(ALL)
|| getLinkHandler().getContentFilters().isEmpty()) { || getLinkHandler().getContentFilters().isEmpty()) {
@ -95,44 +99,45 @@ public class MediaCCCSearchExtractor extends SearchExtractor {
} }
if (getLinkHandler().getContentFilters().contains(CONFERENCES) if (getLinkHandler().getContentFilters().contains(CONFERENCES)
|| getLinkHandler().getContentFilters().contains(ALL) || getLinkHandler().getContentFilters().contains(ALL)
|| getLinkHandler().getContentFilters().isEmpty()) || getLinkHandler().getContentFilters().isEmpty()) {
conferenceKiosk.fetchPage(); conferenceKiosk.fetchPage();
}
} }
private void searchConferences(String searchString, private void searchConferences(final String searchString,
List<ChannelInfoItem> channelItems, final List<ChannelInfoItem> channelItems,
InfoItemsSearchCollector collector) { final InfoItemsSearchCollector collector) {
for (final ChannelInfoItem item : channelItems) { for (final ChannelInfoItem item : channelItems) {
if (item.getName().toUpperCase().contains( if (item.getName().toUpperCase().contains(
searchString.toUpperCase())) { searchString.toUpperCase())) {
collector.commit(new ChannelInfoItemExtractor() { collector.commit(new ChannelInfoItemExtractor() {
@Override @Override
public String getDescription() throws ParsingException { public String getDescription() {
return item.getDescription(); return item.getDescription();
} }
@Override @Override
public long getSubscriberCount() throws ParsingException { public long getSubscriberCount() {
return item.getSubscriberCount(); return item.getSubscriberCount();
} }
@Override @Override
public long getStreamCount() throws ParsingException { public long getStreamCount() {
return item.getStreamCount(); return item.getStreamCount();
} }
@Override @Override
public String getName() throws ParsingException { public String getName() {
return item.getName(); return item.getName();
} }
@Override @Override
public String getUrl() throws ParsingException { public String getUrl() {
return item.getUrl(); return item.getUrl();
} }
@Override @Override
public String getThumbnailUrl() throws ParsingException { public String getThumbnailUrl() {
return item.getThumbnailUrl(); return item.getThumbnailUrl();
} }
}); });

View File

@ -4,6 +4,7 @@ import com.grack.nanojson.JsonArray;
import com.grack.nanojson.JsonObject; import com.grack.nanojson.JsonObject;
import com.grack.nanojson.JsonParser; import com.grack.nanojson.JsonParser;
import com.grack.nanojson.JsonParserException; import com.grack.nanojson.JsonParserException;
import org.schabi.newpipe.extractor.MediaFormat; import org.schabi.newpipe.extractor.MediaFormat;
import org.schabi.newpipe.extractor.StreamingService; import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.downloader.Downloader; import org.schabi.newpipe.extractor.downloader.Downloader;
@ -11,27 +12,34 @@ import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.linkhandler.LinkHandler; import org.schabi.newpipe.extractor.linkhandler.LinkHandler;
import org.schabi.newpipe.extractor.localization.DateWrapper; import org.schabi.newpipe.extractor.localization.DateWrapper;
import org.schabi.newpipe.extractor.stream.*; import org.schabi.newpipe.extractor.stream.AudioStream;
import org.schabi.newpipe.extractor.stream.Description;
import org.schabi.newpipe.extractor.stream.StreamExtractor;
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
import org.schabi.newpipe.extractor.stream.StreamInfoItemsCollector;
import org.schabi.newpipe.extractor.stream.StreamType;
import org.schabi.newpipe.extractor.stream.SubtitlesStream;
import org.schabi.newpipe.extractor.stream.VideoStream;
import javax.annotation.Nonnull;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Locale; import java.util.Locale;
public class MediaCCCStreamExtractor extends StreamExtractor { import javax.annotation.Nonnull;
public class MediaCCCStreamExtractor extends StreamExtractor {
private JsonObject data; private JsonObject data;
private JsonObject conferenceData; private JsonObject conferenceData;
public MediaCCCStreamExtractor(StreamingService service, LinkHandler linkHandler) { public MediaCCCStreamExtractor(final StreamingService service, final LinkHandler linkHandler) {
super(service, linkHandler); super(service, linkHandler);
} }
@Nonnull @Nonnull
@Override @Override
public String getTextualUploadDate() throws ParsingException { public String getTextualUploadDate() {
return data.getString("release_date"); return data.getString("release_date");
} }
@ -43,79 +51,79 @@ public class MediaCCCStreamExtractor extends StreamExtractor {
@Nonnull @Nonnull
@Override @Override
public String getThumbnailUrl() throws ParsingException { public String getThumbnailUrl() {
return data.getString("thumb_url"); return data.getString("thumb_url");
} }
@Nonnull @Nonnull
@Override @Override
public Description getDescription() throws ParsingException { public Description getDescription() {
return new Description(data.getString("description"), Description.PLAIN_TEXT); return new Description(data.getString("description"), Description.PLAIN_TEXT);
} }
@Override @Override
public int getAgeLimit() throws ParsingException { public int getAgeLimit() {
return 0; return 0;
} }
@Override @Override
public long getLength() throws ParsingException { public long getLength() {
return data.getInt("length"); return data.getInt("length");
} }
@Override @Override
public long getTimeStamp() throws ParsingException { public long getTimeStamp() {
return 0; return 0;
} }
@Override @Override
public long getViewCount() throws ParsingException { public long getViewCount() {
return data.getInt("view_count"); return data.getInt("view_count");
} }
@Override @Override
public long getLikeCount() throws ParsingException { public long getLikeCount() {
return -1; return -1;
} }
@Override @Override
public long getDislikeCount() throws ParsingException { public long getDislikeCount() {
return -1; return -1;
} }
@Nonnull @Nonnull
@Override @Override
public String getUploaderUrl() throws ParsingException { public String getUploaderUrl() {
return data.getString("conference_url"); return data.getString("conference_url");
} }
@Nonnull @Nonnull
@Override @Override
public String getUploaderName() throws ParsingException { public String getUploaderName() {
return data.getString("conference_url") return data.getString("conference_url")
.replace("https://api.media.ccc.de/public/conferences/", ""); .replaceFirst("https://(api\\.)?media\\.ccc\\.de/public/conferences/", "");
} }
@Nonnull @Nonnull
@Override @Override
public String getUploaderAvatarUrl() throws ParsingException { public String getUploaderAvatarUrl() {
return conferenceData.getString("logo_url"); return conferenceData.getString("logo_url");
} }
@Nonnull @Nonnull
@Override @Override
public String getDashMpdUrl() throws ParsingException { public String getDashMpdUrl() {
return ""; return "";
} }
@Nonnull @Nonnull
@Override @Override
public String getHlsUrl() throws ParsingException { public String getHlsUrl() {
return ""; return "";
} }
@Override @Override
public List<AudioStream> getAudioStreams() throws IOException, ExtractionException { public List<AudioStream> getAudioStreams() throws ExtractionException {
final JsonArray recordings = data.getArray("recordings"); final JsonArray recordings = data.getArray("recordings");
final List<AudioStream> audioStreams = new ArrayList<>(); final List<AudioStream> audioStreams = new ArrayList<>();
for (int i = 0; i < recordings.size(); i++) { for (int i = 0; i < recordings.size(); i++) {
@ -134,14 +142,15 @@ public class MediaCCCStreamExtractor extends StreamExtractor {
throw new ExtractionException("Unknown media format: " + mimeType); throw new ExtractionException("Unknown media format: " + mimeType);
} }
audioStreams.add(new AudioStream(recording.getString("recording_url"), mediaFormat, -1)); audioStreams.add(new AudioStream(recording.getString("recording_url"),
mediaFormat, -1));
} }
} }
return audioStreams; return audioStreams;
} }
@Override @Override
public List<VideoStream> getVideoStreams() throws IOException, ExtractionException { public List<VideoStream> getVideoStreams() throws ExtractionException {
final JsonArray recordings = data.getArray("recordings"); final JsonArray recordings = data.getArray("recordings");
final List<VideoStream> videoStreams = new ArrayList<>(); final List<VideoStream> videoStreams = new ArrayList<>();
for (int i = 0; i < recordings.size(); i++) { for (int i = 0; i < recordings.size(); i++) {
@ -167,34 +176,34 @@ public class MediaCCCStreamExtractor extends StreamExtractor {
} }
@Override @Override
public List<VideoStream> getVideoOnlyStreams() throws IOException, ExtractionException { public List<VideoStream> getVideoOnlyStreams() {
return null; return null;
} }
@Nonnull @Nonnull
@Override @Override
public List<SubtitlesStream> getSubtitlesDefault() throws IOException, ExtractionException { public List<SubtitlesStream> getSubtitlesDefault() {
return Collections.emptyList(); return Collections.emptyList();
} }
@Nonnull @Nonnull
@Override @Override
public List<SubtitlesStream> getSubtitles(final MediaFormat format) throws IOException, ExtractionException { public List<SubtitlesStream> getSubtitles(final MediaFormat format) {
return Collections.emptyList(); return Collections.emptyList();
} }
@Override @Override
public StreamType getStreamType() throws ParsingException { public StreamType getStreamType() {
return StreamType.VIDEO_STREAM; return StreamType.VIDEO_STREAM;
} }
@Override @Override
public StreamInfoItem getNextStream() throws IOException, ExtractionException { public StreamInfoItem getNextStream() {
return null; return null;
} }
@Override @Override
public StreamInfoItemsCollector getRelatedStreams() throws IOException, ExtractionException { public StreamInfoItemsCollector getRelatedStreams() {
return new StreamInfoItemsCollector(getServiceId()); return new StreamInfoItemsCollector(getServiceId());
} }
@ -204,14 +213,16 @@ public class MediaCCCStreamExtractor extends StreamExtractor {
} }
@Override @Override
public void onFetchPage(@Nonnull Downloader downloader) throws IOException, ExtractionException { public void onFetchPage(@Nonnull final Downloader downloader)
throws IOException, ExtractionException {
try { try {
data = JsonParser.object().from( data = JsonParser.object().from(
downloader.get(getLinkHandler().getUrl()).responseBody()); downloader.get(getLinkHandler().getUrl()).responseBody());
conferenceData = JsonParser.object() conferenceData = JsonParser.object()
.from(downloader.get(getUploaderUrl()).responseBody()); .from(downloader.get(getUploaderUrl()).responseBody());
} catch (JsonParserException jpe) { } catch (JsonParserException jpe) {
throw new ExtractionException("Could not parse json returned by url: " + getLinkHandler().getUrl(), jpe); throw new ExtractionException("Could not parse json returned by url: "
+ getLinkHandler().getUrl(), jpe);
} }
} }
@ -223,44 +234,44 @@ public class MediaCCCStreamExtractor extends StreamExtractor {
@Nonnull @Nonnull
@Override @Override
public String getOriginalUrl() throws ParsingException { public String getOriginalUrl() {
return data.getString("frontend_link"); return data.getString("frontend_link");
} }
@Override @Override
public String getHost() throws ParsingException { public String getHost() {
return ""; return "";
} }
@Override @Override
public String getPrivacy() throws ParsingException { public String getPrivacy() {
return ""; return "";
} }
@Override @Override
public String getCategory() throws ParsingException { public String getCategory() {
return ""; return "";
} }
@Override @Override
public String getLicence() throws ParsingException { public String getLicence() {
return ""; return "";
} }
@Override @Override
public Locale getLanguageInfo() throws ParsingException { public Locale getLanguageInfo() {
return null; return null;
} }
@Nonnull @Nonnull
@Override @Override
public List<String> getTags() throws ParsingException { public List<String> getTags() {
return new ArrayList<>(); return new ArrayList<>();
} }
@Nonnull @Nonnull
@Override @Override
public String getSupportInfo() throws ParsingException { public String getSupportInfo() {
return ""; return "";
} }
} }

View File

@ -1,21 +0,0 @@
package org.schabi.newpipe.extractor.services.media_ccc.extractors;
import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.suggestion.SuggestionExtractor;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class MediaCCCSuggestionExtractor extends SuggestionExtractor {
public MediaCCCSuggestionExtractor(StreamingService service) {
super(service);
}
@Override
public List<String> suggestionList(String query) throws IOException, ExtractionException {
return new ArrayList<>(0);
}
}

View File

@ -5,25 +5,24 @@ import org.schabi.newpipe.extractor.channel.ChannelInfoItemExtractor;
import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.exceptions.ParsingException;
public class MediaCCCConferenceInfoItemExtractor implements ChannelInfoItemExtractor { public class MediaCCCConferenceInfoItemExtractor implements ChannelInfoItemExtractor {
private JsonObject conference;
JsonObject conference; public MediaCCCConferenceInfoItemExtractor(final JsonObject conference) {
public MediaCCCConferenceInfoItemExtractor(JsonObject conference) {
this.conference = conference; this.conference = conference;
} }
@Override @Override
public String getDescription() throws ParsingException { public String getDescription() {
return ""; return "";
} }
@Override @Override
public long getSubscriberCount() throws ParsingException { public long getSubscriberCount() {
return -1; return -1;
} }
@Override @Override
public long getStreamCount() throws ParsingException { public long getStreamCount() {
return -1; return -1;
} }
@ -38,7 +37,7 @@ public class MediaCCCConferenceInfoItemExtractor implements ChannelInfoItemExtra
} }
@Override @Override
public String getThumbnailUrl() throws ParsingException { public String getThumbnailUrl() {
return conference.getString("logo_url"); return conference.getString("logo_url");
} }
} }

View File

@ -10,47 +10,46 @@ import org.schabi.newpipe.extractor.stream.StreamType;
import javax.annotation.Nullable; import javax.annotation.Nullable;
public class MediaCCCStreamInfoItemExtractor implements StreamInfoItemExtractor { public class MediaCCCStreamInfoItemExtractor implements StreamInfoItemExtractor {
private JsonObject event;
JsonObject event; public MediaCCCStreamInfoItemExtractor(final JsonObject event) {
public MediaCCCStreamInfoItemExtractor(JsonObject event) {
this.event = event; this.event = event;
} }
@Override @Override
public StreamType getStreamType() throws ParsingException { public StreamType getStreamType() {
return StreamType.VIDEO_STREAM; return StreamType.VIDEO_STREAM;
} }
@Override @Override
public boolean isAd() throws ParsingException { public boolean isAd() {
return false; return false;
} }
@Override @Override
public long getDuration() throws ParsingException { public long getDuration() {
return event.getInt("length"); return event.getInt("length");
} }
@Override @Override
public long getViewCount() throws ParsingException { public long getViewCount() {
return event.getInt("view_count"); return event.getInt("view_count");
} }
@Override @Override
public String getUploaderName() throws ParsingException { public String getUploaderName() {
return event.getString("conference_url") return event.getString("conference_url")
.replace("https://api.media.ccc.de/public/conferences/", ""); .replaceFirst("https://(api\\.)?media\\.ccc\\.de/public/conferences/", "");
} }
@Override @Override
public String getUploaderUrl() throws ParsingException { public String getUploaderUrl() {
return event.getString("conference_url"); return event.getString("conference_url");
} }
@Nullable @Nullable
@Override @Override
public String getTextualUploadDate() throws ParsingException { public String getTextualUploadDate() {
return event.getString("release_date"); return event.getString("release_date");
} }
@ -67,12 +66,12 @@ public class MediaCCCStreamInfoItemExtractor implements StreamInfoItemExtractor
@Override @Override
public String getUrl() throws ParsingException { public String getUrl() throws ParsingException {
return "https://api.media.ccc.de/public/events/" + return "https://media.ccc.de/public/events/"
event.getString("guid"); + event.getString("guid");
} }
@Override @Override
public String getThumbnailUrl() throws ParsingException { public String getThumbnailUrl() {
return event.getString("thumb_url"); return event.getString("thumb_url");
} }
} }

View File

@ -7,16 +7,17 @@ import org.schabi.newpipe.extractor.utils.Parser;
import java.util.List; import java.util.List;
public class MediaCCCConferenceLinkHandlerFactory extends ListLinkHandlerFactory { public class MediaCCCConferenceLinkHandlerFactory extends ListLinkHandlerFactory {
@Override @Override
public String getUrl(String id, List<String> contentFilter, String sortFilter) throws ParsingException { public String getUrl(final String id, final List<String> contentFilter, final String sortFilter)
return "https://api.media.ccc.de/public/conferences/" + id; throws ParsingException {
return "https://media.ccc.de/public/conferences/" + id;
} }
@Override @Override
public String getId(String url) throws ParsingException { public String getId(final String url) throws ParsingException {
if (url.startsWith("https://api.media.ccc.de/public/conferences/")) { if (url.startsWith("https://media.ccc.de/public/conferences/")
return url.replace("https://api.media.ccc.de/public/conferences/", ""); || url.startsWith("https://api.media.ccc.de/public/conferences/")) {
return url.replaceFirst("https://(api\\.)?media\\.ccc\\.de/public/conferences/", "");
} else if (url.startsWith("https://media.ccc.de/c/")) { } else if (url.startsWith("https://media.ccc.de/c/")) {
return Parser.matchGroup1("https://media.ccc.de/c/([^?#]*)", url); return Parser.matchGroup1("https://media.ccc.de/c/([^?#]*)", url);
} else if (url.startsWith("https://media.ccc.de/b/")) { } else if (url.startsWith("https://media.ccc.de/b/")) {
@ -26,7 +27,7 @@ public class MediaCCCConferenceLinkHandlerFactory extends ListLinkHandlerFactory
} }
@Override @Override
public boolean onAcceptUrl(String url) throws ParsingException { public boolean onAcceptUrl(final String url) {
try { try {
getId(url); getId(url);
return true; return true;

View File

@ -7,18 +7,20 @@ import java.util.List;
public class MediaCCCConferencesListLinkHandlerFactory extends ListLinkHandlerFactory { public class MediaCCCConferencesListLinkHandlerFactory extends ListLinkHandlerFactory {
@Override @Override
public String getId(String url) throws ParsingException { public String getId(final String url) throws ParsingException {
return "conferences"; return "conferences";
} }
@Override @Override
public String getUrl(String id, List<String> contentFilter, String sortFilter) throws ParsingException { public String getUrl(final String id, final List<String> contentFilter,
return "https://api.media.ccc.de/public/conferences"; final String sortFilter) throws ParsingException {
return "https://media.ccc.de/public/conferences";
} }
@Override @Override
public boolean onAcceptUrl(String url) throws ParsingException { public boolean onAcceptUrl(final String url) {
return url.equals("https://media.ccc.de/b/conferences") return url.equals("https://media.ccc.de/b/conferences")
|| url.equals("https://media.ccc.de/public/conferences")
|| url.equals("https://api.media.ccc.de/public/conferences"); || url.equals("https://api.media.ccc.de/public/conferences");
} }
} }

View File

@ -8,7 +8,6 @@ import java.net.URLEncoder;
import java.util.List; import java.util.List;
public class MediaCCCSearchQueryHandlerFactory extends SearchQueryHandlerFactory { public class MediaCCCSearchQueryHandlerFactory extends SearchQueryHandlerFactory {
public static final String ALL = "all"; public static final String ALL = "all";
public static final String CONFERENCES = "conferences"; public static final String CONFERENCES = "conferences";
public static final String EVENTS = "events"; public static final String EVENTS = "events";
@ -28,11 +27,13 @@ public class MediaCCCSearchQueryHandlerFactory extends SearchQueryHandlerFactory
} }
@Override @Override
public String getUrl(String querry, List<String> contentFilter, String sortFilter) throws ParsingException { public String getUrl(final String query, final List<String> contentFilter,
final String sortFilter) throws ParsingException {
try { try {
return "https://api.media.ccc.de/public/events/search?q=" + URLEncoder.encode(querry, "UTF-8"); return "https://media.ccc.de/public/events/search?q="
+ URLEncoder.encode(query, "UTF-8");
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
throw new ParsingException("Could not create search string with querry: " + querry, e); throw new ParsingException("Could not create search string with querry: " + query, e);
} }
} }
} }

View File

@ -1,6 +1,5 @@
package org.schabi.newpipe.extractor.services.media_ccc.linkHandler; package org.schabi.newpipe.extractor.services.media_ccc.linkHandler;
import org.schabi.newpipe.extractor.exceptions.FoundAdException;
import org.schabi.newpipe.extractor.exceptions.ParsingException; import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory; import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
import org.schabi.newpipe.extractor.utils.Utils; import org.schabi.newpipe.extractor.utils.Utils;
@ -9,11 +8,15 @@ import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
public class MediaCCCStreamLinkHandlerFactory extends LinkHandlerFactory { public class MediaCCCStreamLinkHandlerFactory extends LinkHandlerFactory {
@Override @Override
public String getId(String urlString) throws ParsingException { public String getId(final String urlString) throws ParsingException {
if (urlString.startsWith("https://api.media.ccc.de/public/events/") && if (urlString.startsWith("https://media.ccc.de/public/events/")
!urlString.contains("?q=")) { && !urlString.contains("?q=")) {
return urlString.substring(35); //remove /public/events part
}
if (urlString.startsWith("https://api.media.ccc.de/public/events/")
&& !urlString.contains("?q=")) {
return urlString.substring(39); //remove api/public/events part return urlString.substring(39); //remove api/public/events part
} }
@ -38,12 +41,12 @@ public class MediaCCCStreamLinkHandlerFactory extends LinkHandlerFactory {
} }
@Override @Override
public String getUrl(String id) throws ParsingException { public String getUrl(final String id) throws ParsingException {
return "https://api.media.ccc.de/public/events/" + id; return "https://media.ccc.de/public/events/" + id;
} }
@Override @Override
public boolean onAcceptUrl(String url) throws ParsingException { public boolean onAcceptUrl(final String url) {
try { try {
getId(url); getId(url);
return true; return true;

View File

@ -14,7 +14,6 @@ import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
* Test {@link MediaCCCConferenceExtractor} * Test {@link MediaCCCConferenceExtractor}
*/ */
public class MediaCCCConferenceExtractorTest { public class MediaCCCConferenceExtractorTest {
public static class FrOSCon2017 { public static class FrOSCon2017 {
private static MediaCCCConferenceExtractor extractor; private static MediaCCCConferenceExtractor extractor;
@ -32,7 +31,7 @@ public class MediaCCCConferenceExtractorTest {
@Test @Test
public void testGetUrl() throws Exception { public void testGetUrl() throws Exception {
assertEquals("https://api.media.ccc.de/public/conferences/froscon2017", extractor.getUrl()); assertEquals("https://media.ccc.de/public/conferences/froscon2017", extractor.getUrl());
} }
@Test @Test
@ -68,7 +67,7 @@ public class MediaCCCConferenceExtractorTest {
@Test @Test
public void testGetUrl() throws Exception { public void testGetUrl() throws Exception {
assertEquals("https://api.media.ccc.de/public/conferences/oscal19", extractor.getUrl()); assertEquals("https://media.ccc.de/public/conferences/oscal19", extractor.getUrl());
} }
@Test @Test

View File

@ -15,14 +15,14 @@ import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
* Test {@link MediaCCCStreamExtractor} * Test {@link MediaCCCStreamExtractor}
*/ */
public class MediaCCCOggTest { public class MediaCCCOggTest {
// test against https://api.media.ccc.de/public/events/1317 // test against https://media.ccc.de/public/events/1317
private static StreamExtractor extractor; private static StreamExtractor extractor;
@BeforeClass @BeforeClass
public static void setUpClass() throws Exception { public static void setUpClass() throws Exception {
NewPipe.init(DownloaderTestImpl.getInstance()); NewPipe.init(DownloaderTestImpl.getInstance());
extractor = MediaCCC.getStreamExtractor("https://api.media.ccc.de/public/events/1317"); extractor = MediaCCC.getStreamExtractor("https://media.ccc.de/public/events/1317");
extractor.fetchPage(); extractor.fetchPage();
} }

View File

@ -9,7 +9,6 @@ import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCStreamExtractor; import org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCStreamExtractor;
import org.schabi.newpipe.extractor.stream.AudioStream; import org.schabi.newpipe.extractor.stream.AudioStream;
import org.schabi.newpipe.extractor.stream.VideoStream; import org.schabi.newpipe.extractor.stream.VideoStream;
import org.schabi.newpipe.extractor.utils.UtilsTest;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -25,7 +24,6 @@ import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
* Test {@link MediaCCCStreamExtractor} * Test {@link MediaCCCStreamExtractor}
*/ */
public class MediaCCCStreamExtractorTest { public class MediaCCCStreamExtractorTest {
public static class Gpn18Tmux { public static class Gpn18Tmux {
private static MediaCCCStreamExtractor extractor; private static MediaCCCStreamExtractor extractor;
@ -55,7 +53,7 @@ public class MediaCCCStreamExtractorTest {
@Test @Test
public void testUrl() throws Exception { public void testUrl() throws Exception {
assertIsSecureUrl(extractor.getUrl()); assertIsSecureUrl(extractor.getUrl());
assertEquals("https://api.media.ccc.de/public/events/gpn18-105-tmux-warum-ein-schwarzes-fenster-am-bildschirm-reicht", extractor.getUrl()); assertEquals("https://media.ccc.de/public/events/gpn18-105-tmux-warum-ein-schwarzes-fenster-am-bildschirm-reicht", extractor.getUrl());
} }
@Test @Test
@ -141,7 +139,7 @@ public class MediaCCCStreamExtractorTest {
@Test @Test
public void testUrl() throws Exception { public void testUrl() throws Exception {
assertIsSecureUrl(extractor.getUrl()); assertIsSecureUrl(extractor.getUrl());
assertEquals("https://api.media.ccc.de/public/events/36c3-10565-what_s_left_for_private_messaging", extractor.getUrl()); assertEquals("https://media.ccc.de/public/events/36c3-10565-what_s_left_for_private_messaging", extractor.getUrl());
} }
@Test @Test
@ -164,7 +162,7 @@ public class MediaCCCStreamExtractorTest {
@Test @Test
public void testUploaderUrl() throws Exception { public void testUploaderUrl() throws Exception {
assertIsSecureUrl(extractor.getUploaderUrl()); assertIsSecureUrl(extractor.getUploaderUrl());
assertEquals("https://api.media.ccc.de/public/conferences/36c3", extractor.getUploaderUrl()); assertEquals("https://media.ccc.de/public/conferences/36c3", extractor.getUploaderUrl());
} }
@Test @Test

View File

@ -16,7 +16,6 @@ import static org.schabi.newpipe.extractor.services.media_ccc.linkHandler.MediaC
import static org.schabi.newpipe.extractor.services.media_ccc.linkHandler.MediaCCCSearchQueryHandlerFactory.EVENTS; import static org.schabi.newpipe.extractor.services.media_ccc.linkHandler.MediaCCCSearchQueryHandlerFactory.EVENTS;
public class MediaCCCSearchExtractorTest { public class MediaCCCSearchExtractorTest {
public static class All extends DefaultSearchExtractorTest { public static class All extends DefaultSearchExtractorTest {
private static SearchExtractor extractor; private static SearchExtractor extractor;
private static final String QUERY = "kde"; private static final String QUERY = "kde";
@ -32,8 +31,8 @@ public class MediaCCCSearchExtractorTest {
@Override public StreamingService expectedService() { return MediaCCC; } @Override public StreamingService expectedService() { return MediaCCC; }
@Override public String expectedName() { return QUERY; } @Override public String expectedName() { return QUERY; }
@Override public String expectedId() { return QUERY; } @Override public String expectedId() { return QUERY; }
@Override public String expectedUrlContains() { return "api.media.ccc.de/public/events/search?q=" + QUERY; } @Override public String expectedUrlContains() { return "media.ccc.de/public/events/search?q=" + QUERY; }
@Override public String expectedOriginalUrlContains() { return "api.media.ccc.de/public/events/search?q=" + QUERY; } @Override public String expectedOriginalUrlContains() { return "media.ccc.de/public/events/search?q=" + QUERY; }
@Override public String expectedSearchString() { return QUERY; } @Override public String expectedSearchString() { return QUERY; }
@Nullable @Override public String expectedSearchSuggestion() { return null; } @Nullable @Override public String expectedSearchSuggestion() { return null; }
@ -55,8 +54,8 @@ public class MediaCCCSearchExtractorTest {
@Override public StreamingService expectedService() { return MediaCCC; } @Override public StreamingService expectedService() { return MediaCCC; }
@Override public String expectedName() { return QUERY; } @Override public String expectedName() { return QUERY; }
@Override public String expectedId() { return QUERY; } @Override public String expectedId() { return QUERY; }
@Override public String expectedUrlContains() { return "api.media.ccc.de/public/events/search?q=" + QUERY; } @Override public String expectedUrlContains() { return "media.ccc.de/public/events/search?q=" + QUERY; }
@Override public String expectedOriginalUrlContains() { return "api.media.ccc.de/public/events/search?q=" + QUERY; } @Override public String expectedOriginalUrlContains() { return "media.ccc.de/public/events/search?q=" + QUERY; }
@Override public String expectedSearchString() { return QUERY; } @Override public String expectedSearchString() { return QUERY; }
@Nullable @Override public String expectedSearchSuggestion() { return null; } @Nullable @Override public String expectedSearchSuggestion() { return null; }
@ -79,8 +78,8 @@ public class MediaCCCSearchExtractorTest {
@Override public StreamingService expectedService() { return MediaCCC; } @Override public StreamingService expectedService() { return MediaCCC; }
@Override public String expectedName() { return QUERY; } @Override public String expectedName() { return QUERY; }
@Override public String expectedId() { return QUERY; } @Override public String expectedId() { return QUERY; }
@Override public String expectedUrlContains() { return "api.media.ccc.de/public/events/search?q=" + QUERY; } @Override public String expectedUrlContains() { return "media.ccc.de/public/events/search?q=" + QUERY; }
@Override public String expectedOriginalUrlContains() { return "api.media.ccc.de/public/events/search?q=" + QUERY; } @Override public String expectedOriginalUrlContains() { return "media.ccc.de/public/events/search?q=" + QUERY; }
@Override public String expectedSearchString() { return QUERY; } @Override public String expectedSearchString() { return QUERY; }
@Nullable @Override public String expectedSearchSuggestion() { return null; } @Nullable @Override public String expectedSearchSuggestion() { return null; }