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