Fix isCorrectedSearch test.
This commit is contained in:
parent
fd19c53f65
commit
88c11db4c5
|
@ -141,16 +141,15 @@ public class YoutubeMusicSearchExtractor extends SearchExtractor {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isCorrectedSearch() {
|
public boolean isCorrectedSearch() throws ParsingException {
|
||||||
final JsonObject itemSectionRenderer = initialData.getObject("contents").getObject("sectionListRenderer")
|
final JsonObject itemSectionRenderer = JsonUtils.getArray(JsonUtils.getArray(initialData, "contents.tabbedSearchResultsRenderer.tabs").getObject(0), "tabRenderer.content.sectionListRenderer.contents").getObject(0).getObject("itemSectionRenderer");
|
||||||
.getArray("contents").getObject(0).getObject("itemSectionRenderer");
|
|
||||||
if (itemSectionRenderer.isEmpty()) {
|
if (itemSectionRenderer.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
final JsonObject showingResultsForRenderer = itemSectionRenderer.getArray("contents").getObject(0)
|
final boolean corrected = itemSectionRenderer.getArray("contents").getObject(0)
|
||||||
.getObject("showingResultsForRenderer");
|
.has("didYouMeanRenderer");
|
||||||
return !showingResultsForRenderer.isEmpty();
|
return corrected;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
|
|
Loading…
Reference in New Issue