mirror of
https://github.com/TeamNewPipe/NewPipeExtractor
synced 2025-08-22 18:07:47 +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,
|
trendingLHF,
|
||||||
YoutubeTrendingExtractor.KIOSK_ID
|
YoutubeTrendingExtractor.KIOSK_ID
|
||||||
);
|
);
|
||||||
list.setDefaultKiosk(YoutubeTrendingExtractor.KIOSK_ID);
|
list.setDefaultKiosk(YoutubeLiveLinkHandlerFactory.KIOSK_ID);
|
||||||
} catch (final Exception e) {
|
} catch (final Exception e) {
|
||||||
throw new ExtractionException(e);
|
throw new ExtractionException(e);
|
||||||
}
|
}
|
||||||
|
@ -19,63 +19,11 @@ import org.schabi.newpipe.extractor.services.youtube.extractors.kiosk.YoutubeTre
|
|||||||
|
|
||||||
public class YoutubeKioskExtractorTest {
|
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>
|
public static class Live extends DefaultSimpleExtractorTest<YoutubeLiveExtractor>
|
||||||
implements BaseListExtractorTest, InitYoutubeTest {
|
implements BaseListExtractorTest, InitYoutubeTest {
|
||||||
@Override
|
@Override
|
||||||
protected YoutubeLiveExtractor createExtractor() throws Exception {
|
protected YoutubeLiveExtractor createExtractor() throws Exception {
|
||||||
return (YoutubeLiveExtractor) YouTube.getKioskList().getExtractorById(
|
return (YoutubeLiveExtractor) YouTube.getKioskList().getDefaultKioskExtractor();
|
||||||
"live", null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -345,4 +293,57 @@ public class YoutubeKioskExtractorTest {
|
|||||||
assertNoMoreItems(extractor());
|
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
|
@Test
|
||||||
void testGetDefaultKiosk() throws Exception {
|
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