mirror of
https://github.com/TeamNewPipe/NewPipeExtractor
synced 2025-08-22 01:48:58 +00:00
[YouTube] Set running lives as new default kiosk
Also move YoutubeKioskExtractorTest.Trending at the bottom of the file and add deprecation notice on test class too.
This commit is contained in:
parent
5c7abeeab0
commit
25e30b745a
@ -228,7 +228,7 @@ public class YoutubeService extends StreamingService {
|
||||
trendingLHF,
|
||||
YoutubeTrendingExtractor.KIOSK_ID
|
||||
);
|
||||
list.setDefaultKiosk(YoutubeTrendingExtractor.KIOSK_ID);
|
||||
list.setDefaultKiosk(YoutubeLiveLinkHandlerFactory.KIOSK_ID);
|
||||
} catch (final Exception e) {
|
||||
throw new ExtractionException(e);
|
||||
}
|
||||
|
@ -19,63 +19,11 @@ import org.schabi.newpipe.extractor.services.youtube.extractors.kiosk.YoutubeTre
|
||||
|
||||
public class YoutubeKioskExtractorTest {
|
||||
|
||||
public static class Trending extends DefaultSimpleExtractorTest<YoutubeTrendingExtractor>
|
||||
implements BaseListExtractorTest, InitYoutubeTest {
|
||||
|
||||
@Override
|
||||
protected YoutubeTrendingExtractor createExtractor() throws Exception {
|
||||
return (YoutubeTrendingExtractor) YouTube.getKioskList().getDefaultKioskExtractor();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testServiceId() {
|
||||
assertEquals(YouTube.getServiceId(), extractor().getServiceId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testName() throws Exception {
|
||||
assertEquals("Trending", extractor().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testId() throws Exception {
|
||||
assertEquals("Trending", extractor().getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testUrl() throws ParsingException {
|
||||
assertEquals("https://www.youtube.com/feed/trending", extractor().getUrl());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testOriginalUrl() throws ParsingException {
|
||||
assertEquals("https://www.youtube.com/feed/trending", extractor().getOriginalUrl());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testRelatedItems() throws Exception {
|
||||
defaultTestRelatedItems(extractor());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testMoreRelatedItems() throws Exception {
|
||||
assertNoMoreItems(extractor());
|
||||
}
|
||||
}
|
||||
|
||||
public static class Live extends DefaultSimpleExtractorTest<YoutubeLiveExtractor>
|
||||
implements BaseListExtractorTest, InitYoutubeTest {
|
||||
@Override
|
||||
protected YoutubeLiveExtractor createExtractor() throws Exception {
|
||||
return (YoutubeLiveExtractor) YouTube.getKioskList().getExtractorById(
|
||||
"live", null);
|
||||
return (YoutubeLiveExtractor) YouTube.getKioskList().getDefaultKioskExtractor();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -345,4 +293,57 @@ public class YoutubeKioskExtractorTest {
|
||||
assertNoMoreItems(extractor());
|
||||
}
|
||||
}
|
||||
|
||||
// Deprecated (i.e. removed from the interface of YouTube) since July 21, 2025
|
||||
public static class Trending extends DefaultSimpleExtractorTest<YoutubeTrendingExtractor>
|
||||
implements BaseListExtractorTest, InitYoutubeTest {
|
||||
|
||||
@Override
|
||||
protected YoutubeTrendingExtractor createExtractor() throws Exception {
|
||||
return (YoutubeTrendingExtractor) YouTube.getKioskList().getExtractorById(
|
||||
"Trending", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testServiceId() {
|
||||
assertEquals(YouTube.getServiceId(), extractor().getServiceId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testName() throws Exception {
|
||||
assertEquals("Trending", extractor().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testId() throws Exception {
|
||||
assertEquals("Trending", extractor().getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testUrl() throws ParsingException {
|
||||
assertEquals("https://www.youtube.com/feed/trending", extractor().getUrl());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testOriginalUrl() throws ParsingException {
|
||||
assertEquals("https://www.youtube.com/feed/trending", extractor().getOriginalUrl());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testRelatedItems() throws Exception {
|
||||
defaultTestRelatedItems(extractor());
|
||||
}
|
||||
|
||||
@Override
|
||||
@Test
|
||||
public void testMoreRelatedItems() throws Exception {
|
||||
assertNoMoreItems(extractor());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public class YoutubeServiceTest {
|
||||
|
||||
@Test
|
||||
void testGetDefaultKiosk() throws Exception {
|
||||
assertEquals("Trending", kioskList.getDefaultKioskExtractor(null).getId());
|
||||
assertEquals("live", kioskList.getDefaultKioskExtractor(null).getId());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user