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(),