@@ -432,190 +432,6 @@ public void testSubscriberCount() throws Exception {
432432 }
433433 }
434434
435- // this channel has no "Subscribe" button
436- public static class EminemVEVO implements BaseChannelExtractorTest {
437- private static YoutubeChannelExtractor extractor ;
438-
439- @ BeforeClass
440- public static void setUp () throws Exception {
441- NewPipe .init (DownloaderTestImpl .getInstance ());
442- extractor = (YoutubeChannelExtractor ) YouTube
443- .getChannelExtractor ("https://www.youtube.com/user/EminemVEVO/" );
444- extractor .fetchPage ();
445- }
446-
447- /*//////////////////////////////////////////////////////////////////////////
448- // Extractor
449- //////////////////////////////////////////////////////////////////////////*/
450-
451- @ Test
452- public void testServiceId () {
453- assertEquals (YouTube .getServiceId (), extractor .getServiceId ());
454- }
455-
456- @ Test
457- public void testName () throws Exception {
458- assertEquals ("EminemVEVO" , extractor .getName ());
459- }
460-
461- @ Test
462- public void testId () throws Exception {
463- assertEquals ("UC20vb-R_px4CguHzzBPhoyQ" , extractor .getId ());
464- }
465-
466- @ Test
467- public void testUrl () throws ParsingException {
468- assertEquals ("https://www.youtube.com/channel/UC20vb-R_px4CguHzzBPhoyQ" , extractor .getUrl ());
469- }
470-
471- @ Test
472- public void testOriginalUrl () throws ParsingException {
473- assertEquals ("https://www.youtube.com/user/EminemVEVO/" , extractor .getOriginalUrl ());
474- }
475-
476- /*//////////////////////////////////////////////////////////////////////////
477- // ListExtractor
478- //////////////////////////////////////////////////////////////////////////*/
479-
480- @ Test
481- public void testRelatedItems () throws Exception {
482- defaultTestRelatedItems (extractor );
483- }
484-
485- @ Test
486- public void testMoreRelatedItems () throws Exception {
487- defaultTestMoreItems (extractor );
488- }
489-
490- /*//////////////////////////////////////////////////////////////////////////
491- // ChannelExtractor
492- //////////////////////////////////////////////////////////////////////////*/
493-
494- @ Test
495- public void testDescription () throws Exception {
496- final String description = extractor .getDescription ();
497- assertTrue (description , description .contains ("Eminem on Vevo" ));
498- }
499-
500- @ Test
501- public void testAvatarUrl () throws Exception {
502- String avatarUrl = extractor .getAvatarUrl ();
503- assertIsSecureUrl (avatarUrl );
504- assertTrue (avatarUrl , avatarUrl .contains ("yt3" ));
505- }
506-
507- @ Test
508- public void testBannerUrl () throws Exception {
509- String bannerUrl = extractor .getBannerUrl ();
510- assertIsSecureUrl (bannerUrl );
511- assertTrue (bannerUrl , bannerUrl .contains ("yt3" ));
512- }
513-
514- @ Test
515- public void testFeedUrl () throws Exception {
516- assertEquals ("https://www.youtube.com/feeds/videos.xml?channel_id=UC20vb-R_px4CguHzzBPhoyQ" , extractor .getFeedUrl ());
517- }
518-
519- @ Test
520- public void testSubscriberCount () throws Exception {
521- // there is no "Subscribe" button
522- long subscribers = extractor .getSubscriberCount ();
523- assertEquals ("Wrong subscriber count" , -1 , subscribers );
524- }
525- }
526-
527- /**
528- * Some VEVO channels will redirect to a new page with a new channel id.
529- * <p>
530- * Though, it isn't a simple redirect, but a redirect instruction embed in the response itself, this
531- * test assure that we account for that.
532- */
533- public static class RedirectedChannel implements BaseChannelExtractorTest {
534- private static YoutubeChannelExtractor extractor ;
535-
536- @ BeforeClass
537- public static void setUp () throws Exception {
538- NewPipe .init (DownloaderTestImpl .getInstance ());
539- extractor = (YoutubeChannelExtractor ) YouTube
540- .getChannelExtractor ("https://www.youtube.com/channel/UCITk7Ky4iE5_xISw9IaHqpQ" );
541- extractor .fetchPage ();
542- }
543-
544- /*//////////////////////////////////////////////////////////////////////////
545- // Extractor
546- //////////////////////////////////////////////////////////////////////////*/
547-
548- @ Test
549- public void testServiceId () {
550- assertEquals (YouTube .getServiceId (), extractor .getServiceId ());
551- }
552-
553- @ Test
554- public void testName () throws Exception {
555- assertEquals ("LordiVEVO" , extractor .getName ());
556- }
557-
558- @ Test
559- public void testId () throws Exception {
560- assertEquals ("UCrxkwepj7-4Wz1wHyfzw-sQ" , extractor .getId ());
561- }
562-
563- @ Test
564- public void testUrl () throws ParsingException {
565- assertEquals ("https://www.youtube.com/channel/UCrxkwepj7-4Wz1wHyfzw-sQ" , extractor .getUrl ());
566- }
567-
568- @ Test
569- public void testOriginalUrl () throws ParsingException {
570- assertEquals ("https://www.youtube.com/channel/UCITk7Ky4iE5_xISw9IaHqpQ" , extractor .getOriginalUrl ());
571- }
572-
573- /*//////////////////////////////////////////////////////////////////////////
574- // ListExtractor
575- //////////////////////////////////////////////////////////////////////////*/
576-
577- @ Test
578- public void testRelatedItems () throws Exception {
579- defaultTestRelatedItems (extractor );
580- }
581-
582- @ Test
583- public void testMoreRelatedItems () throws Exception {
584- assertNoMoreItems (extractor );
585- }
586-
587- /*//////////////////////////////////////////////////////////////////////////
588- // ChannelExtractor
589- //////////////////////////////////////////////////////////////////////////*/
590-
591- @ Test
592- public void testDescription () throws Exception {
593- assertEmpty (extractor .getDescription ());
594- }
595-
596- @ Test
597- public void testAvatarUrl () throws Exception {
598- String avatarUrl = extractor .getAvatarUrl ();
599- assertIsSecureUrl (avatarUrl );
600- assertTrue (avatarUrl , avatarUrl .contains ("yt3" ));
601- }
602-
603- @ Test
604- public void testBannerUrl () throws Exception {
605- assertEmpty (extractor .getBannerUrl ());
606- }
607-
608- @ Test
609- public void testFeedUrl () throws Exception {
610- assertEquals ("https://www.youtube.com/feeds/videos.xml?channel_id=UCrxkwepj7-4Wz1wHyfzw-sQ" , extractor .getFeedUrl ());
611- }
612-
613- @ Test
614- public void testSubscriberCount () throws Exception {
615- assertEquals (-1 , extractor .getSubscriberCount ());
616- }
617- }
618-
619435 public static class RandomChannel implements BaseChannelExtractorTest {
620436 private static YoutubeChannelExtractor extractor ;
621437
0 commit comments