mirror of
https://github.com/TeamNewPipe/NewPipeExtractor
synced 2025-09-04 08:15:32 +00:00
Fix NPE on collecting page items
This commit is contained in:
@@ -113,12 +113,13 @@ public class YoutubeSearchExtractor extends SearchExtractor {
|
|||||||
"&page=" + Integer.toString(pageNr + 1));
|
"&page=" + Integer.toString(pageNr + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
private InfoItemsSearchCollector collectItems(Document doc) throws NothingFoundException {
|
private InfoItemsSearchCollector collectItems(Document doc) throws NothingFoundException, ParsingException {
|
||||||
InfoItemsSearchCollector collector = getInfoItemSearchCollector();
|
InfoItemsSearchCollector collector = getInfoItemSearchCollector();
|
||||||
collector.reset();
|
collector.reset();
|
||||||
|
|
||||||
final TimeAgoParser timeAgoParser = getTimeAgoParser();
|
final TimeAgoParser timeAgoParser = getTimeAgoParser();
|
||||||
|
|
||||||
|
if (initialData == null) initialData = YoutubeParsingHelper.getInitialData(doc.toString());
|
||||||
JsonArray list = initialData.getObject("contents").getObject("twoColumnSearchResultsRenderer")
|
JsonArray list = initialData.getObject("contents").getObject("twoColumnSearchResultsRenderer")
|
||||||
.getObject("primaryContents").getObject("sectionListRenderer").getArray("contents")
|
.getObject("primaryContents").getObject("sectionListRenderer").getArray("contents")
|
||||||
.getObject(0).getObject("itemSectionRenderer").getArray("contents");
|
.getObject(0).getObject("itemSectionRenderer").getArray("contents");
|
||||||
|
Reference in New Issue
Block a user