diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMusicSearchExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMusicSearchExtractor.java index a7ac5cc6d..0e17c60c6 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMusicSearchExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeMusicSearchExtractor.java @@ -147,8 +147,10 @@ public class YoutubeMusicSearchExtractor extends SearchExtractor { return false; } - final boolean corrected = itemSectionRenderer.getArray("contents").getObject(0) - .has("didYouMeanRenderer"); + JsonObject firstContent = itemSectionRenderer.getArray("contents").getObject(0); + + final boolean corrected = firstContent + .has("didYouMeanRenderer") || firstContent.has("showingResultsForRenderer"); return corrected; } diff --git a/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeMusicSearchExtractorTest.java b/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeMusicSearchExtractorTest.java index 785250e74..6f9f81f8e 100644 --- a/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeMusicSearchExtractorTest.java +++ b/extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeMusicSearchExtractorTest.java @@ -133,6 +133,7 @@ public class YoutubeMusicSearchExtractorTest { public static class Suggestion extends DefaultSearchExtractorTest { private static SearchExtractor extractor; private static final String QUERY = "megaman x3"; + private static final boolean CORRECTED = true; @BeforeClass public static void setUp() throws Exception { @@ -150,6 +151,7 @@ public class YoutubeMusicSearchExtractorTest { @Override public String expectedSearchString() { return QUERY; } @Nullable @Override public String expectedSearchSuggestion() { return "mega man x3"; } @Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.STREAM; } + @Override public boolean isCorrectedSearch() { return CORRECTED; } } public static class CorrectedSearch extends DefaultSearchExtractorTest {