Fix issue when there is no didYouMeanRenderer in itemSectionRenderer
This commit is contained in:
parent
5a775a4bbe
commit
dd434cca01
|
@ -176,8 +176,10 @@ public class YoutubeSearchExtractor extends SearchExtractor {
|
|||
final JsonObject itemSectionRenderer = initialData.getObject("contents").getObject("sectionListRenderer")
|
||||
.getArray("contents").getObject(0).getObject("itemSectionRenderer");
|
||||
if (itemSectionRenderer == null) return "";
|
||||
return getTextFromObject(itemSectionRenderer.getArray("contents").getObject(0)
|
||||
.getObject("didYouMeanRenderer").getObject("correctedQuery"));
|
||||
final JsonObject didYouMeanRenderer = itemSectionRenderer.getArray("contents")
|
||||
.getObject(0).getObject("didYouMeanRenderer");
|
||||
if (didYouMeanRenderer == null) return "";
|
||||
return getTextFromObject(didYouMeanRenderer.getObject("correctedQuery"));
|
||||
} else {
|
||||
JsonObject showingResultsForRenderer = initialData.getObject("contents")
|
||||
.getObject("twoColumnSearchResultsRenderer").getObject("primaryContents")
|
||||
|
|
Loading…
Reference in New Issue