add getMoreInfo to SearchInfo

This commit is contained in:
Christian Schabesberger 2018-07-08 14:32:31 +02:00
parent 39332a283b
commit 2f351be772
1 changed files with 16 additions and 3 deletions

View File

@ -1,11 +1,15 @@
package org.schabi.newpipe.extractor.search;
import org.schabi.newpipe.extractor.InfoItem;
import org.schabi.newpipe.extractor.ListExtractor;
import org.schabi.newpipe.extractor.ListInfo;
import org.schabi.newpipe.extractor.StreamingService;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.exceptions.ParsingException;
import org.schabi.newpipe.extractor.uih.SearchQIHandler;
import java.io.IOException;
public class SearchInfo extends ListInfo<InfoItem> {
private String searchString;
@ -13,13 +17,13 @@ public class SearchInfo extends ListInfo<InfoItem> {
public SearchInfo(int serviceId,
SearchQIHandler qIHandler,
String searchString) throws ParsingException {
String searchString) {
super(serviceId, qIHandler, "Search");
this.searchString = searchString;
}
public static SearchInfo getInfo(SearchExtractor extractor) throws ExtractionException {
public static SearchInfo getInfo(SearchExtractor extractor) {
final SearchInfo info = new SearchInfo(
extractor.getServiceId(),
extractor.getUIHandler(),
@ -34,6 +38,15 @@ public class SearchInfo extends ListInfo<InfoItem> {
return info;
}
public static ListExtractor.InfoItemsPage<InfoItem> getMoreItems(StreamingService service,
SearchQIHandler query,
String contentCountry,
String pageUrl)
throws IOException, ExtractionException {
return service.getSearchExtractor(query, contentCountry).getPage(pageUrl);
}
// Getter
public String getSearchString() {
return searchString;