Skip to content

Commit dee84c3

Browse files
committed
[YouTube] Fix/ignore failing tests after YouTube fully removed Trending
1 parent b6ed15a commit dee84c3

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeKioskExtractorTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestRelatedItems;
88

99
import org.junit.jupiter.api.Test;
10+
import org.junit.jupiter.api.Disabled;
1011
import org.schabi.newpipe.extractor.exceptions.ParsingException;
1112
import org.schabi.newpipe.extractor.services.BaseListExtractorTest;
1213
import org.schabi.newpipe.extractor.services.DefaultSimpleExtractorTest;
@@ -295,6 +296,7 @@ public void testMoreRelatedItems() throws Exception {
295296
}
296297

297298
// Deprecated (i.e. removed from the interface of YouTube) since July 21, 2025
299+
@Disabled("Trending section was removed from YouTube")
298300
public static class Trending extends DefaultSimpleExtractorTest<YoutubeTrendingExtractor>
299301
implements BaseListExtractorTest, InitYoutubeTest {
300302

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeTrendingKioskInfoTest.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,15 @@
2020
* along with NewPipe Extractor. If not, see <http://www.gnu.org/licenses/>.
2121
*/
2222

23+
import static org.junit.jupiter.api.Assertions.assertEquals;
2324
import static org.junit.jupiter.api.Assertions.assertFalse;
24-
import static org.junit.jupiter.api.Assertions.assertTrue;
2525
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
2626

2727
import org.junit.jupiter.api.BeforeAll;
2828
import org.junit.jupiter.api.Test;
2929
import org.schabi.newpipe.extractor.kiosk.KioskInfo;
3030
import org.schabi.newpipe.extractor.linkhandler.LinkHandlerFactory;
31+
import org.schabi.newpipe.extractor.services.youtube.linkHandler.YoutubeLiveLinkHandlerFactory;
3132

3233
/**
3334
* Test for {@link KioskInfo}
@@ -41,9 +42,11 @@ class YoutubeTrendingKioskInfoTest implements InitYoutubeTest {
4142
public void setUp() throws Exception {
4243
InitYoutubeTest.super.setUp();
4344

44-
final LinkHandlerFactory linkHandlerFactory = YouTube.getKioskList().getListLinkHandlerFactoryByType("Trending");
45+
final LinkHandlerFactory linkHandlerFactory = YouTube.getKioskList()
46+
.getListLinkHandlerFactoryByType(YoutubeLiveLinkHandlerFactory.KIOSK_ID);
4547

46-
kioskInfo = KioskInfo.getInfo(YouTube, linkHandlerFactory.fromId("Trending").getUrl());
48+
kioskInfo = KioskInfo.getInfo(YouTube,
49+
linkHandlerFactory.fromId(YoutubeLiveLinkHandlerFactory.KIOSK_ID).getUrl());
4750
}
4851

4952
@Test
@@ -53,8 +56,7 @@ void getStreams() {
5356

5457
@Test
5558
void getId() {
56-
assertTrue(kioskInfo.getId().equals("Trending")
57-
|| kioskInfo.getId().equals("Trends"));
59+
assertEquals(YoutubeLiveLinkHandlerFactory.KIOSK_ID, kioskInfo.getId());
5860
}
5961

6062
@Test

0 commit comments

Comments
 (0)