2020-03-07 16:03:12 +01:00
|
|
|
package org.schabi.newpipe.extractor.services.youtube;
|
|
|
|
|
2020-04-16 19:28:27 +02:00
|
|
|
import org.hamcrest.MatcherAssert;
|
2020-03-07 16:03:12 +01:00
|
|
|
import org.junit.BeforeClass;
|
|
|
|
import org.junit.Test;
|
2020-04-16 19:28:27 +02:00
|
|
|
import org.junit.runner.RunWith;
|
|
|
|
import org.junit.runners.Suite;
|
|
|
|
import org.junit.runners.Suite.SuiteClasses;
|
2020-12-15 15:19:42 +01:00
|
|
|
import org.schabi.newpipe.downloader.DownloaderFactory;
|
2020-03-07 16:03:12 +01:00
|
|
|
import org.schabi.newpipe.extractor.ListExtractor;
|
|
|
|
import org.schabi.newpipe.extractor.ListExtractor.InfoItemsPage;
|
|
|
|
import org.schabi.newpipe.extractor.NewPipe;
|
2020-04-16 19:28:27 +02:00
|
|
|
import org.schabi.newpipe.extractor.Page;
|
2020-03-07 16:03:12 +01:00
|
|
|
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
|
2020-04-16 19:28:27 +02:00
|
|
|
import org.schabi.newpipe.extractor.services.youtube.YoutubeMixPlaylistExtractorTest.ChannelMix;
|
|
|
|
import org.schabi.newpipe.extractor.services.youtube.YoutubeMixPlaylistExtractorTest.Invalid;
|
|
|
|
import org.schabi.newpipe.extractor.services.youtube.YoutubeMixPlaylistExtractorTest.Mix;
|
|
|
|
import org.schabi.newpipe.extractor.services.youtube.YoutubeMixPlaylistExtractorTest.MixWithIndex;
|
|
|
|
import org.schabi.newpipe.extractor.services.youtube.YoutubeMixPlaylistExtractorTest.MyMix;
|
2020-03-07 16:03:12 +01:00
|
|
|
import org.schabi.newpipe.extractor.services.youtube.extractors.YoutubeMixPlaylistExtractor;
|
|
|
|
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
|
|
|
|
2021-01-17 18:55:37 +01:00
|
|
|
import java.io.IOException;
|
2021-04-07 12:25:59 +02:00
|
|
|
import java.util.*;
|
2021-01-17 18:55:37 +01:00
|
|
|
|
2020-09-26 11:22:24 +02:00
|
|
|
import static org.hamcrest.CoreMatchers.containsString;
|
|
|
|
import static org.hamcrest.CoreMatchers.startsWith;
|
|
|
|
import static org.hamcrest.MatcherAssert.assertThat;
|
|
|
|
import static org.junit.Assert.assertEquals;
|
|
|
|
import static org.junit.Assert.assertFalse;
|
|
|
|
import static org.junit.Assert.assertTrue;
|
|
|
|
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertIsSecureUrl;
|
|
|
|
import static org.schabi.newpipe.extractor.ServiceList.YouTube;
|
|
|
|
|
2020-04-16 19:28:27 +02:00
|
|
|
@RunWith(Suite.class)
|
|
|
|
@SuiteClasses({Mix.class, MixWithIndex.class, MyMix.class, Invalid.class, ChannelMix.class})
|
2020-03-07 16:03:12 +01:00
|
|
|
public class YoutubeMixPlaylistExtractorTest {
|
|
|
|
|
2020-04-16 19:28:27 +02:00
|
|
|
public static final String PBJ = "&pbj=1";
|
|
|
|
private static final String VIDEO_ID = "_AzeUSL9lZc";
|
|
|
|
private static final String VIDEO_TITLE =
|
|
|
|
"Most Beautiful And Emotional Piano: Anime Music Shigatsu wa Kimi no Uso OST IMO";
|
2021-01-17 18:55:37 +01:00
|
|
|
private static final String RESOURCE_PATH = DownloaderFactory.RESOURCE_PATH + "services/youtube/extractor/mix/";
|
2021-04-07 12:25:59 +02:00
|
|
|
private static final Map<String, String> dummyCookie = new HashMap<>();
|
2020-04-16 19:28:27 +02:00
|
|
|
|
2020-03-07 16:03:12 +01:00
|
|
|
private static YoutubeMixPlaylistExtractor extractor;
|
|
|
|
|
|
|
|
public static class Mix {
|
|
|
|
|
|
|
|
@BeforeClass
|
|
|
|
public static void setUp() throws Exception {
|
2021-01-10 20:24:50 +01:00
|
|
|
YoutubeParsingHelper.resetClientVersionAndKey();
|
2021-01-10 20:39:22 +01:00
|
|
|
NewPipe.init(new DownloaderFactory().getDownloader(RESOURCE_PATH + "mix"));
|
2021-04-07 12:25:59 +02:00
|
|
|
dummyCookie.put(YoutubeMixPlaylistExtractor.COOKIE_NAME, "whatever");
|
2020-03-07 16:03:12 +01:00
|
|
|
extractor = (YoutubeMixPlaylistExtractor) YouTube
|
2020-04-16 19:28:27 +02:00
|
|
|
.getPlaylistExtractor(
|
|
|
|
"https://www.youtube.com/watch?v=" + VIDEO_ID + "&list=RD" + VIDEO_ID);
|
2020-03-07 16:03:12 +01:00
|
|
|
extractor.fetchPage();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getServiceId() {
|
|
|
|
assertEquals(YouTube.getServiceId(), extractor.getServiceId());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getName() throws Exception {
|
2020-04-16 19:28:27 +02:00
|
|
|
final String name = extractor.getName();
|
2020-03-07 16:03:12 +01:00
|
|
|
assertThat(name, startsWith("Mix"));
|
2020-04-16 19:28:27 +02:00
|
|
|
assertThat(name, containsString(VIDEO_TITLE));
|
2020-03-07 16:03:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getThumbnailUrl() throws Exception {
|
|
|
|
final String thumbnailUrl = extractor.getThumbnailUrl();
|
|
|
|
assertIsSecureUrl(thumbnailUrl);
|
2020-04-16 19:28:27 +02:00
|
|
|
MatcherAssert.assertThat(thumbnailUrl, containsString("yt"));
|
|
|
|
assertThat(thumbnailUrl, containsString(VIDEO_ID));
|
2020-03-07 16:03:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getInitialPage() throws Exception {
|
2020-04-16 19:28:27 +02:00
|
|
|
final InfoItemsPage<StreamInfoItem> streams = extractor.getInitialPage();
|
2020-03-07 16:03:12 +01:00
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getPage() throws Exception {
|
2020-04-16 19:28:27 +02:00
|
|
|
final InfoItemsPage<StreamInfoItem> streams = extractor.getPage(
|
2020-09-26 11:22:24 +02:00
|
|
|
new Page("https://www.youtube.com/watch?v=" + VIDEO_ID + "&list=RD" + VIDEO_ID
|
|
|
|
+ PBJ, dummyCookie));
|
2020-03-07 16:03:12 +01:00
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2020-04-16 19:28:27 +02:00
|
|
|
public void getContinuations() throws Exception {
|
|
|
|
InfoItemsPage<StreamInfoItem> streams = extractor.getInitialPage();
|
|
|
|
final Set<String> urls = new HashSet<>();
|
2020-03-07 16:03:12 +01:00
|
|
|
|
|
|
|
//Should work infinitely, but for testing purposes only 3 times
|
|
|
|
for (int i = 0; i < 3; i++) {
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
|
2020-04-16 19:28:27 +02:00
|
|
|
for (final StreamInfoItem item : streams.getItems()) {
|
|
|
|
assertFalse(urls.contains(item.getUrl()));
|
|
|
|
urls.add(item.getUrl());
|
|
|
|
}
|
|
|
|
|
|
|
|
streams = extractor.getPage(streams.getNextPage());
|
2020-03-07 16:03:12 +01:00
|
|
|
}
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2020-04-16 19:28:27 +02:00
|
|
|
public void getStreamCount() {
|
2020-03-07 16:03:12 +01:00
|
|
|
assertEquals(ListExtractor.ITEM_COUNT_INFINITE, extractor.getStreamCount());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class MixWithIndex {
|
|
|
|
|
2020-04-16 19:28:27 +02:00
|
|
|
private static final String INDEX = "&index=13";
|
|
|
|
private static final String VIDEO_ID_NUMBER_13 = "qHtzO49SDmk";
|
2020-03-07 16:03:12 +01:00
|
|
|
|
|
|
|
@BeforeClass
|
|
|
|
public static void setUp() throws Exception {
|
2021-01-10 20:24:50 +01:00
|
|
|
YoutubeParsingHelper.resetClientVersionAndKey();
|
2021-01-10 20:39:22 +01:00
|
|
|
NewPipe.init(new DownloaderFactory().getDownloader(RESOURCE_PATH + "mixWithIndex"));
|
2021-04-07 12:25:59 +02:00
|
|
|
dummyCookie.put(YoutubeMixPlaylistExtractor.COOKIE_NAME, "whatever");
|
2020-03-07 16:03:12 +01:00
|
|
|
extractor = (YoutubeMixPlaylistExtractor) YouTube
|
2021-01-17 18:55:37 +01:00
|
|
|
.getPlaylistExtractor(
|
|
|
|
"https://www.youtube.com/watch?v=" + VIDEO_ID_NUMBER_13 + "&list=RD"
|
|
|
|
+ VIDEO_ID + INDEX);
|
2020-03-07 16:03:12 +01:00
|
|
|
extractor.fetchPage();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getName() throws Exception {
|
2020-04-16 19:28:27 +02:00
|
|
|
final String name = extractor.getName();
|
2020-03-07 16:03:12 +01:00
|
|
|
assertThat(name, startsWith("Mix"));
|
2020-04-16 19:28:27 +02:00
|
|
|
assertThat(name, containsString(VIDEO_TITLE));
|
2020-03-07 16:03:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getThumbnailUrl() throws Exception {
|
|
|
|
final String thumbnailUrl = extractor.getThumbnailUrl();
|
|
|
|
assertIsSecureUrl(thumbnailUrl);
|
|
|
|
assertThat(thumbnailUrl, containsString("yt"));
|
2020-04-16 19:28:27 +02:00
|
|
|
assertThat(thumbnailUrl, containsString(VIDEO_ID));
|
2020-03-07 16:03:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getInitialPage() throws Exception {
|
2020-04-16 19:28:27 +02:00
|
|
|
final InfoItemsPage<StreamInfoItem> streams = extractor.getInitialPage();
|
2020-03-07 16:03:12 +01:00
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getPage() throws Exception {
|
2020-04-16 19:28:27 +02:00
|
|
|
final InfoItemsPage<StreamInfoItem> streams = extractor.getPage(
|
2021-01-17 18:55:37 +01:00
|
|
|
new Page("https://www.youtube.com/watch?v=" + VIDEO_ID_NUMBER_13 + "&list=RD"
|
|
|
|
+ VIDEO_ID + INDEX + PBJ, dummyCookie));
|
2020-03-07 16:03:12 +01:00
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2020-04-16 19:28:27 +02:00
|
|
|
public void getContinuations() throws Exception {
|
|
|
|
InfoItemsPage<StreamInfoItem> streams = extractor.getInitialPage();
|
|
|
|
final Set<String> urls = new HashSet<>();
|
2020-03-07 16:03:12 +01:00
|
|
|
|
|
|
|
//Should work infinitely, but for testing purposes only 3 times
|
|
|
|
for (int i = 0; i < 3; i++) {
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
assertFalse(streams.getItems().isEmpty());
|
2020-04-16 19:28:27 +02:00
|
|
|
for (final StreamInfoItem item : streams.getItems()) {
|
|
|
|
assertFalse(urls.contains(item.getUrl()));
|
|
|
|
urls.add(item.getUrl());
|
|
|
|
}
|
2020-03-07 16:03:12 +01:00
|
|
|
|
2020-04-16 19:28:27 +02:00
|
|
|
streams = extractor.getPage(streams.getNextPage());
|
2020-03-07 16:03:12 +01:00
|
|
|
}
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
}
|
|
|
|
|
2020-03-17 14:04:46 +01:00
|
|
|
@Test
|
2020-04-16 19:28:27 +02:00
|
|
|
public void getStreamCount() {
|
2020-03-17 14:04:46 +01:00
|
|
|
assertEquals(ListExtractor.ITEM_COUNT_INFINITE, extractor.getStreamCount());
|
|
|
|
}
|
2020-03-07 16:03:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public static class MyMix {
|
|
|
|
|
|
|
|
@BeforeClass
|
|
|
|
public static void setUp() throws Exception {
|
2021-01-10 20:24:50 +01:00
|
|
|
YoutubeParsingHelper.resetClientVersionAndKey();
|
2021-01-10 20:39:22 +01:00
|
|
|
NewPipe.init(new DownloaderFactory().getDownloader(RESOURCE_PATH + "myMix"));
|
2021-04-07 12:25:59 +02:00
|
|
|
dummyCookie.put(YoutubeMixPlaylistExtractor.COOKIE_NAME, "whatever");
|
2020-03-07 16:03:12 +01:00
|
|
|
extractor = (YoutubeMixPlaylistExtractor) YouTube
|
2021-01-17 18:55:37 +01:00
|
|
|
.getPlaylistExtractor(
|
|
|
|
"https://www.youtube.com/watch?v=" + VIDEO_ID + "&list=RDMM"
|
|
|
|
+ VIDEO_ID);
|
2020-03-07 16:03:12 +01:00
|
|
|
extractor.fetchPage();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getServiceId() {
|
|
|
|
assertEquals(YouTube.getServiceId(), extractor.getServiceId());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getName() throws Exception {
|
2020-04-16 19:28:27 +02:00
|
|
|
final String name = extractor.getName();
|
2020-03-07 16:03:12 +01:00
|
|
|
assertEquals("My Mix", name);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getThumbnailUrl() throws Exception {
|
|
|
|
final String thumbnailUrl = extractor.getThumbnailUrl();
|
|
|
|
assertIsSecureUrl(thumbnailUrl);
|
|
|
|
assertThat(thumbnailUrl, startsWith("https://i.ytimg.com/vi/_AzeUSL9lZc"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getInitialPage() throws Exception {
|
2020-04-16 19:28:27 +02:00
|
|
|
final InfoItemsPage<StreamInfoItem> streams = extractor.getInitialPage();
|
2020-03-07 16:03:12 +01:00
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getPage() throws Exception {
|
2020-04-16 19:28:27 +02:00
|
|
|
final InfoItemsPage<StreamInfoItem> streams =
|
2021-01-17 18:55:37 +01:00
|
|
|
extractor.getPage(new Page("https://www.youtube.com/watch?v=" + VIDEO_ID
|
|
|
|
+ "&list=RDMM" + VIDEO_ID + PBJ, dummyCookie));
|
2020-03-07 16:03:12 +01:00
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
}
|
2021-01-17 18:55:37 +01:00
|
|
|
|
2020-03-07 16:03:12 +01:00
|
|
|
@Test
|
2020-04-16 19:28:27 +02:00
|
|
|
public void getContinuations() throws Exception {
|
|
|
|
InfoItemsPage<StreamInfoItem> streams = extractor.getInitialPage();
|
|
|
|
final Set<String> urls = new HashSet<>();
|
2020-03-07 16:03:12 +01:00
|
|
|
|
|
|
|
//Should work infinitely, but for testing purposes only 3 times
|
|
|
|
for (int i = 0; i < 3; i++) {
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
|
2020-04-16 19:28:27 +02:00
|
|
|
for (final StreamInfoItem item : streams.getItems()) {
|
|
|
|
assertFalse(urls.contains(item.getUrl()));
|
|
|
|
urls.add(item.getUrl());
|
|
|
|
}
|
|
|
|
|
|
|
|
streams = extractor.getPage(streams.getNextPage());
|
2020-03-07 16:03:12 +01:00
|
|
|
}
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2020-04-16 19:28:27 +02:00
|
|
|
public void getStreamCount() {
|
2020-03-07 16:03:12 +01:00
|
|
|
assertEquals(ListExtractor.ITEM_COUNT_INFINITE, extractor.getStreamCount());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class Invalid {
|
|
|
|
|
|
|
|
@BeforeClass
|
2020-12-15 15:19:42 +01:00
|
|
|
public static void setUp() throws IOException {
|
2021-01-10 20:24:50 +01:00
|
|
|
YoutubeParsingHelper.resetClientVersionAndKey();
|
2021-01-10 20:39:22 +01:00
|
|
|
NewPipe.init(new DownloaderFactory().getDownloader(RESOURCE_PATH + "invalid"));
|
2021-04-07 12:25:59 +02:00
|
|
|
dummyCookie.put(YoutubeMixPlaylistExtractor.COOKIE_NAME, "whatever");
|
2020-03-07 16:03:12 +01:00
|
|
|
}
|
|
|
|
|
2020-09-26 11:22:24 +02:00
|
|
|
@Test(expected = IllegalArgumentException.class)
|
2020-03-07 16:03:12 +01:00
|
|
|
public void getPageEmptyUrl() throws Exception {
|
|
|
|
extractor = (YoutubeMixPlaylistExtractor) YouTube
|
2020-04-16 19:28:27 +02:00
|
|
|
.getPlaylistExtractor(
|
|
|
|
"https://www.youtube.com/watch?v=" + VIDEO_ID + "&list=RD" + VIDEO_ID);
|
2020-03-07 16:03:12 +01:00
|
|
|
extractor.fetchPage();
|
2020-04-16 19:28:27 +02:00
|
|
|
extractor.getPage(new Page(""));
|
2020-03-07 16:03:12 +01:00
|
|
|
}
|
|
|
|
|
2020-03-21 18:48:12 +01:00
|
|
|
@Test(expected = ExtractionException.class)
|
2020-03-07 16:03:12 +01:00
|
|
|
public void invalidVideoId() throws Exception {
|
|
|
|
extractor = (YoutubeMixPlaylistExtractor) YouTube
|
2021-01-17 18:55:37 +01:00
|
|
|
.getPlaylistExtractor(
|
|
|
|
"https://www.youtube.com/watch?v=" + "abcde" + "&list=RD" + "abcde");
|
2020-03-07 16:03:12 +01:00
|
|
|
extractor.fetchPage();
|
2020-03-21 18:48:12 +01:00
|
|
|
extractor.getName();
|
2020-03-07 16:03:12 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static class ChannelMix {
|
|
|
|
|
2020-04-16 19:28:27 +02:00
|
|
|
private static final String CHANNEL_ID = "UCXuqSBlHAE6Xw-yeJA0Tunw";
|
|
|
|
private static final String VIDEO_ID_OF_CHANNEL = "mnk6gnOBYIo";
|
|
|
|
private static final String CHANNEL_TITLE = "Linus Tech Tips";
|
2020-03-07 16:03:12 +01:00
|
|
|
|
|
|
|
|
|
|
|
@BeforeClass
|
|
|
|
public static void setUp() throws Exception {
|
2021-01-10 20:24:50 +01:00
|
|
|
YoutubeParsingHelper.resetClientVersionAndKey();
|
2021-01-10 20:39:22 +01:00
|
|
|
NewPipe.init(new DownloaderFactory().getDownloader(RESOURCE_PATH + "channelMix"));
|
2021-04-07 12:25:59 +02:00
|
|
|
dummyCookie.put(YoutubeMixPlaylistExtractor.COOKIE_NAME, "whatever");
|
2020-03-07 16:03:12 +01:00
|
|
|
extractor = (YoutubeMixPlaylistExtractor) YouTube
|
2021-01-17 18:55:37 +01:00
|
|
|
.getPlaylistExtractor(
|
|
|
|
"https://www.youtube.com/watch?v=" + VIDEO_ID_OF_CHANNEL
|
|
|
|
+ "&list=RDCM" + CHANNEL_ID);
|
2020-03-07 16:03:12 +01:00
|
|
|
extractor.fetchPage();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getName() throws Exception {
|
2020-04-16 19:28:27 +02:00
|
|
|
final String name = extractor.getName();
|
2020-03-07 16:03:12 +01:00
|
|
|
assertThat(name, startsWith("Mix"));
|
2020-04-16 19:28:27 +02:00
|
|
|
assertThat(name, containsString(CHANNEL_TITLE));
|
2020-03-07 16:03:12 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getThumbnailUrl() throws Exception {
|
|
|
|
final String thumbnailUrl = extractor.getThumbnailUrl();
|
|
|
|
assertIsSecureUrl(thumbnailUrl);
|
|
|
|
assertThat(thumbnailUrl, containsString("yt"));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getInitialPage() throws Exception {
|
2020-04-16 19:28:27 +02:00
|
|
|
final InfoItemsPage<StreamInfoItem> streams = extractor.getInitialPage();
|
2020-03-07 16:03:12 +01:00
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
|
|
|
public void getPage() throws Exception {
|
2020-04-16 19:28:27 +02:00
|
|
|
final InfoItemsPage<StreamInfoItem> streams = extractor.getPage(
|
2021-01-17 18:55:37 +01:00
|
|
|
new Page("https://www.youtube.com/watch?v=" + VIDEO_ID_OF_CHANNEL
|
|
|
|
+ "&list=RDCM" + CHANNEL_ID + PBJ, dummyCookie));
|
2020-03-07 16:03:12 +01:00
|
|
|
assertFalse(streams.getItems().isEmpty());
|
|
|
|
assertTrue(streams.hasNextPage());
|
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2020-04-16 19:28:27 +02:00
|
|
|
public void getStreamCount() {
|
2020-03-07 16:03:12 +01:00
|
|
|
assertEquals(ListExtractor.ITEM_COUNT_INFINITE, extractor.getStreamCount());
|
|
|
|
}
|
|
|
|
}
|
2020-04-16 19:28:27 +02:00
|
|
|
}
|