Fix YouTubeChannelExtractor

It was given some inconsistent results (/user and /channel), now it only returns /channel urls don't matter what the original is (at least when calling the getCleanUrl() method).
This commit is contained in:
Mauricio Colli
2017-08-15 23:56:10 -03:00
parent a8a4eaf81b
commit 34547a37b6
2 changed files with 28 additions and 7 deletions

View File

@@ -41,7 +41,7 @@ public class YoutubeChannelExtractorTest {
public void setUp() throws Exception {
NewPipe.init(Downloader.getInstance());
extractor = YouTube.getService()
.getChannelExtractor("https://www.youtube.com/channel/UCYJ61XIK64sp6ZFFS8sctxw");
.getChannelExtractor("https://www.youtube.com/user/Gronkh");
}
@Test
@@ -54,6 +54,16 @@ public class YoutubeChannelExtractorTest {
assertEquals(extractor.getName(), "Gronkh");
}
@Test
public void testGetId() throws Exception {
assertEquals(extractor.getId(), "UCYJ61XIK64sp6ZFFS8sctxw");
}
@Test
public void testGetUrl() throws Exception {
assertEquals(extractor.getCleanUrl(), "https://www.youtube.com/channel/UCYJ61XIK64sp6ZFFS8sctxw");
}
@Test
public void testGetDescription() throws Exception {
assertEquals(extractor.getDescription(), "★ ★ ★ KLICK MICH HART, DU SAU! :D ★ ★ ★ Zart im Schmelz und süffig im Abgang. Ungebremster Spieltrieb seit 1896. Tägliche Folgen nonstop seit dem 01.04.2010!...");
@@ -71,7 +81,7 @@ public class YoutubeChannelExtractorTest {
@Test
public void testGetFeedUrl() throws Exception {
assertTrue(extractor.getFeedUrl(), extractor.getFeedUrl().contains("feed"));
assertEquals(extractor.getFeedUrl(), "https://www.youtube.com/feeds/videos.xml?channel_id=UCYJ61XIK64sp6ZFFS8sctxw");
}
@Test