From 53f0bc9d8d3c958176ed48a53b2dcf40a0468081 Mon Sep 17 00:00:00 2001 From: Christian Schabesberger Date: Sun, 8 Jul 2018 20:15:14 +0200 Subject: [PATCH] add getInfo without need for search extractor to searchinfo --- .../org/schabi/newpipe/extractor/search/SearchInfo.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/search/SearchInfo.java b/extractor/src/main/java/org/schabi/newpipe/extractor/search/SearchInfo.java index 71f8bc37..6a212124 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/search/SearchInfo.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/search/SearchInfo.java @@ -5,6 +5,7 @@ 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.stream.Stream; import org.schabi.newpipe.extractor.uih.SearchQIHandler; import java.io.IOException; @@ -23,6 +24,12 @@ public class SearchInfo extends ListInfo { } + public static SearchInfo getInfo(StreamingService service, SearchQIHandler searchQuery, String contentCountry) throws ExtractionException, IOException { + SearchExtractor extractor = service.getSearchExtractor(searchQuery, contentCountry); + extractor.fetchPage(); + return getInfo(extractor); + } + public static SearchInfo getInfo(SearchExtractor extractor) throws ExtractionException, IOException { final SearchInfo info = new SearchInfo( extractor.getServiceId(),