fix youtub.be links in description

This commit is contained in:
Christian Schabesberger 2018-09-24 15:06:00 +02:00
parent ad4b15ac66
commit f334dd07de

View File

@ -188,7 +188,7 @@ public class YoutubeStreamExtractorDefaultTest {
}
@Test
public void testGetFullLinksInDescriptlion() throws ParsingException {
public void testGetFullLinksInDescription() throws ParsingException {
assertTrue(extractor.getDescription().contains("https://www.reddit.com/r/PewdiepieSubmissions/"));
assertTrue(extractor.getDescription().contains("https://www.youtube.com/channel/UCeKXymg6S6Pt4EjjOlA759w"));
assertTrue(extractor.getDescription().contains("https://www.youtube.com/watch?v=N6hVmn9FM7o"));
@ -200,4 +200,35 @@ public class YoutubeStreamExtractorDefaultTest {
assertFalse(extractor.getDescription().contains("https://usa.clutchchairz.com/product/..."));
}
}
public static class DescriptionTestUnboxing {
private static YoutubeStreamExtractor extractor;
@BeforeClass
public static void setUp() throws Exception {
NewPipe.init(Downloader.getInstance(), new Localization("GB", "en"));
extractor = (YoutubeStreamExtractor) YouTube
.getStreamExtractor("https://www.youtube.com/watch?v=cV5TjZCJkuA");
extractor.fetchPage();
}
@Test
public void testGetDescription() throws ParsingException {
assertNotNull(extractor.getDescription());
assertFalse(extractor.getDescription().isEmpty());
}
@Test
public void testGetFullLinksInDescription() throws ParsingException {
assertTrue(extractor.getDescription().contains("https://www.youtube.com/watch?v=X7FLCHVXpsA&list=PL7u4lWXQ3wfI_7PgX0C-VTiwLeu0S4v34"));
assertTrue(extractor.getDescription().contains("https://www.youtube.com/watch?v=Lqv6G0pDNnw&list=PL7u4lWXQ3wfI_7PgX0C-VTiwLeu0S4v34"));
assertTrue(extractor.getDescription().contains("https://www.youtube.com/watch?v=XxaRBPyrnBU&list=PL7u4lWXQ3wfI_7PgX0C-VTiwLeu0S4v34"));
assertTrue(extractor.getDescription().contains("https://www.youtube.com/watch?v=U-9tUEOFKNU&list=PL7u4lWXQ3wfI_7PgX0C-VTiwLeu0S4v34"));
assertFalse(extractor.getDescription().contains("https://youtu.be/X7FLCHVXpsA?list=PL7..."));
assertFalse(extractor.getDescription().contains("https://youtu.be/Lqv6G0pDNnw?list=PL7..."));
assertFalse(extractor.getDescription().contains("https://youtu.be/XxaRBPyrnBU?list=PL7..."));
assertFalse(extractor.getDescription().contains("https://youtu.be/U-9tUEOFKNU?list=PL7..."));
}
}
}