Fix NPE on collecting page items

This commit is contained in:
TobiGr 2020-02-23 22:24:47 +01:00
parent 4462cbe3f1
commit 6d20b2b1d0
1 changed files with 2 additions and 1 deletions

View File

@ -113,12 +113,13 @@ public class YoutubeSearchExtractor extends SearchExtractor {
"&page=" + Integer.toString(pageNr + 1));
}
private InfoItemsSearchCollector collectItems(Document doc) throws NothingFoundException {
private InfoItemsSearchCollector collectItems(Document doc) throws NothingFoundException, ParsingException {
InfoItemsSearchCollector collector = getInfoItemSearchCollector();
collector.reset();
final TimeAgoParser timeAgoParser = getTimeAgoParser();
if (initialData == null) initialData = YoutubeParsingHelper.getInitialData(doc.toString());
JsonArray list = initialData.getObject("contents").getObject("twoColumnSearchResultsRenderer")
.getObject("primaryContents").getObject("sectionListRenderer").getArray("contents")
.getObject(0).getObject("itemSectionRenderer").getArray("contents");