Skip to content

Commit 53f0bc9

Browse files
committed
add getInfo without need for search extractor to searchinfo
1 parent 35b4690 commit 53f0bc9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/search/SearchInfo.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import org.schabi.newpipe.extractor.ListInfo;
66
import org.schabi.newpipe.extractor.StreamingService;
77
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
8+
import org.schabi.newpipe.extractor.stream.Stream;
89
import org.schabi.newpipe.extractor.uih.SearchQIHandler;
910

1011
import java.io.IOException;
@@ -23,6 +24,12 @@ public SearchInfo(int serviceId,
2324
}
2425

2526

27+
public static SearchInfo getInfo(StreamingService service, SearchQIHandler searchQuery, String contentCountry) throws ExtractionException, IOException {
28+
SearchExtractor extractor = service.getSearchExtractor(searchQuery, contentCountry);
29+
extractor.fetchPage();
30+
return getInfo(extractor);
31+
}
32+
2633
public static SearchInfo getInfo(SearchExtractor extractor) throws ExtractionException, IOException {
2734
final SearchInfo info = new SearchInfo(
2835
extractor.getServiceId(),

0 commit comments

Comments
 (0)