@@ -392,6 +392,100 @@ public void testSubscriberCount() throws Exception {
392392 }
393393 }
394394
395+ // this channel has no "Subscribe" button
396+ public static class EminemVEVO implements BaseChannelExtractorTest {
397+ private static YoutubeChannelExtractor extractor ;
398+
399+ @ BeforeClass
400+ public static void setUp () throws Exception {
401+ NewPipe .init (Downloader .getInstance (), new Localization ("GB" , "en" ));
402+ extractor = (YoutubeChannelExtractor ) YouTube
403+ .getChannelExtractor ("https://www.youtube.com/user/EminemVEVO/" );
404+ extractor .fetchPage ();
405+ }
406+
407+ /*//////////////////////////////////////////////////////////////////////////
408+ // Extractor
409+ //////////////////////////////////////////////////////////////////////////*/
410+
411+ @ Test
412+ public void testServiceId () {
413+ assertEquals (YouTube .getServiceId (), extractor .getServiceId ());
414+ }
415+
416+ @ Test
417+ public void testName () throws Exception {
418+ assertEquals ("EminemVEVO" , extractor .getName ());
419+ }
420+
421+ @ Test
422+ public void testId () throws Exception {
423+ assertEquals ("UC20vb-R_px4CguHzzBPhoyQ" , extractor .getId ());
424+ }
425+
426+ @ Test
427+ public void testUrl () throws ParsingException {
428+ assertEquals ("https://www.youtube.com/channel/UC20vb-R_px4CguHzzBPhoyQ" , extractor .getUrl ());
429+ }
430+
431+ @ Test
432+ public void testOriginalUrl () throws ParsingException {
433+ assertEquals ("https://www.youtube.com/user/EminemVEVO/" , extractor .getOriginalUrl ());
434+ }
435+
436+ /*//////////////////////////////////////////////////////////////////////////
437+ // ListExtractor
438+ //////////////////////////////////////////////////////////////////////////*/
439+
440+ @ Test
441+ public void testRelatedItems () throws Exception {
442+ defaultTestRelatedItems (extractor , YouTube .getServiceId ());
443+ }
444+
445+ @ Test
446+ public void testMoreRelatedItems () throws Exception {
447+ defaultTestMoreItems (extractor , YouTube .getServiceId ());
448+ }
449+
450+ /*//////////////////////////////////////////////////////////////////////////
451+ // ChannelExtractor
452+ //////////////////////////////////////////////////////////////////////////*/
453+
454+ @ Test
455+ public void testDescription () throws Exception {
456+ final String description = extractor .getDescription ();
457+ assertTrue (description , description .contains ("Eminem on Vevo" ));
458+ }
459+
460+ @ Test
461+ public void testAvatarUrl () throws Exception {
462+ String avatarUrl = extractor .getAvatarUrl ();
463+ assertIsSecureUrl (avatarUrl );
464+ assertTrue (avatarUrl , avatarUrl .contains ("yt3" ));
465+ }
466+
467+ @ Test
468+ public void testBannerUrl () throws Exception {
469+ String bannerUrl = extractor .getBannerUrl ();
470+ assertIsSecureUrl (bannerUrl );
471+ assertTrue (bannerUrl , bannerUrl .contains ("yt3" ));
472+ }
473+
474+ @ Test
475+ public void testFeedUrl () throws Exception {
476+ assertEquals ("https://www.youtube.com/feeds/videos.xml?channel_id=UC20vb-R_px4CguHzzBPhoyQ" , extractor .getFeedUrl ());
477+ }
478+
479+ @ Test
480+ public void testSubscriberCount () throws Exception {
481+ // there is no "Subscribe" button
482+ long subscribers = extractor .getSubscriberCount ();
483+ assertEquals ("Wrong subscriber count" , -1 , subscribers );
484+ }
485+ }
486+
487+
488+
395489 public static class RandomChannel implements BaseChannelExtractorTest {
396490 private static YoutubeChannelExtractor extractor ;
397491
@@ -483,8 +577,9 @@ public void testFeedUrl() throws Exception {
483577
484578 @ Test
485579 public void testSubscriberCount () throws Exception {
486- assertTrue ("Wrong subscriber count" , extractor .getSubscriberCount () >= 50 );
580+ long subscribers = extractor .getSubscriberCount ();
581+ assertTrue ("Wrong subscriber count: " + subscribers , subscribers >= 50 );
487582 }
488583 }
489- };
584+ }
490585
0 commit comments