mirror of
https://github.com/TeamNewPipe/NewPipeExtractor.git
synced 2025-01-06 01:20:32 +05:30
Fix search queries with a promotedSparklesTextSearchRenderer returning 0 results
This commit is contained in:
parent
94a2d5be46
commit
f946310af5
@ -101,11 +101,13 @@ public class YoutubeSearchExtractor extends SearchExtractor {
|
|||||||
@Override
|
@Override
|
||||||
public InfoItemsPage<InfoItem> getInitialPage() throws ExtractionException {
|
public InfoItemsPage<InfoItem> getInitialPage() throws ExtractionException {
|
||||||
InfoItemsSearchCollector collector = getInfoItemSearchCollector();
|
InfoItemsSearchCollector collector = getInfoItemSearchCollector();
|
||||||
JsonArray videos = initialData.getObject("contents").getObject("twoColumnSearchResultsRenderer")
|
JsonArray sections = initialData.getObject("contents").getObject("twoColumnSearchResultsRenderer")
|
||||||
.getObject("primaryContents").getObject("sectionListRenderer").getArray("contents")
|
.getObject("primaryContents").getObject("sectionListRenderer").getArray("contents");
|
||||||
.getObject(0).getObject("itemSectionRenderer").getArray("contents");
|
|
||||||
|
for (Object section : sections) {
|
||||||
|
collectStreamsFrom(collector, ((JsonObject) section).getObject("itemSectionRenderer").getArray("contents"));
|
||||||
|
}
|
||||||
|
|
||||||
collectStreamsFrom(collector, videos);
|
|
||||||
return new InfoItemsPage<>(collector, getNextPageUrl());
|
return new InfoItemsPage<>(collector, getNextPageUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user