@@ -114,6 +114,103 @@ public void testChannelDonation() throws Exception {
114114 }
115115 }
116116
117+ // Youtube RED/Premium ad blocking test
118+ public static class VSauce implements BaseChannelExtractorTest {
119+ private static YoutubeChannelExtractor extractor ;
120+
121+ @ BeforeClass
122+ public static void setUp () throws Exception {
123+ NewPipe .init (Downloader .getInstance ());
124+ extractor = (YoutubeChannelExtractor ) YouTube
125+ .getChannelExtractor ("https://www.youtube.com/user/Vsauce" );
126+ extractor .fetchPage ();
127+ }
128+
129+ /*//////////////////////////////////////////////////////////////////////////
130+ // Extractor
131+ //////////////////////////////////////////////////////////////////////////*/
132+
133+ @ Test
134+ public void testServiceId () {
135+ assertEquals (YouTube .getServiceId (), extractor .getServiceId ());
136+ }
137+
138+ @ Test
139+ public void testName () throws Exception {
140+ assertEquals ("Vsauce" , extractor .getName ());
141+ }
142+
143+ @ Test
144+ public void testId () throws Exception {
145+ assertEquals ("UC6nSFpj9HTCZ5t-N3Rm3-HA" , extractor .getId ());
146+ }
147+
148+ @ Test
149+ public void testUrl () throws ParsingException {
150+ assertEquals ("https://www.youtube.com/channel/UC6nSFpj9HTCZ5t-N3Rm3-HA" , extractor .getUrl ());
151+ }
152+
153+ @ Test
154+ public void testOriginalUrl () throws ParsingException {
155+ assertEquals ("https://www.youtube.com/user/Vsauce" , extractor .getOriginalUrl ());
156+ }
157+
158+ /*//////////////////////////////////////////////////////////////////////////
159+ // ListExtractor
160+ //////////////////////////////////////////////////////////////////////////*/
161+
162+ @ Test
163+ public void testRelatedItems () throws Exception {
164+ defaultTestRelatedItems (extractor , YouTube .getServiceId ());
165+ }
166+
167+ @ Test
168+ public void testMoreRelatedItems () throws Exception {
169+ defaultTestMoreItems (extractor , ServiceList .YouTube .getServiceId ());
170+ }
171+
172+ /*//////////////////////////////////////////////////////////////////////////
173+ // ChannelExtractor
174+ //////////////////////////////////////////////////////////////////////////*/
175+
176+ @ Test
177+ public void testDescription () throws Exception {
178+ assertTrue ("What it actually was: " + extractor .getDescription (),
179+ extractor .getDescription ().contains ("Our World is Amazing. Questions? Ideas? Tweet me:" ));
180+ }
181+
182+ @ Test
183+ public void testAvatarUrl () throws Exception {
184+ String avatarUrl = extractor .getAvatarUrl ();
185+ assertIsSecureUrl (avatarUrl );
186+ assertTrue (avatarUrl , avatarUrl .contains ("yt3" ));
187+ }
188+
189+ @ Test
190+ public void testBannerUrl () throws Exception {
191+ String bannerUrl = extractor .getBannerUrl ();
192+ assertIsSecureUrl (bannerUrl );
193+ assertTrue (bannerUrl , bannerUrl .contains ("yt3" ));
194+ }
195+
196+ @ Test
197+ public void testFeedUrl () throws Exception {
198+ assertEquals ("https://www.youtube.com/feeds/videos.xml?channel_id=UC6nSFpj9HTCZ5t-N3Rm3-HA" , extractor .getFeedUrl ());
199+ }
200+
201+ @ Test
202+ public void testSubscriberCount () throws Exception {
203+ assertTrue ("Wrong subscriber count" , extractor .getSubscriberCount () >= 0 );
204+ }
205+
206+ @ Test
207+ public void testChannelDonation () throws Exception {
208+ // this needs to be ignored since wed have to upgrade channel extractor to the new yt interface
209+ // in order to make this work
210+ assertTrue (extractor .getDonationLinks ().length == 0 );
211+ }
212+ }
213+
117214 public static class Kurzgesagt implements BaseChannelExtractorTest {
118215 private static YoutubeChannelExtractor extractor ;
119216
0 commit comments