Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* Test for {@link YoutubeSearchExtractor}
*/
public class YoutubeSearchCountTest {
public static class YoutubeChannelViewCountTest extends YoutubeSearchExtractorBaseTest {
public static class YoutubeChannelSubscriberCountTest extends YoutubeSearchExtractorBaseTest {
@BeforeClass
public static void setUpClass() throws Exception {
NewPipe.init(Downloader.getInstance(), new Localization("GB", "en"));
Expand All @@ -28,10 +28,15 @@ public static void setUpClass() throws Exception {
}

@Test
public void testViewCount() {
public void testSubscriberCount() {
ChannelInfoItem ci = (ChannelInfoItem) itemsPage.getItems().get(0);
assertTrue("Count does not fit: " + Long.toString(ci.getSubscriberCount()),
69043316 < ci.getSubscriberCount() && ci.getSubscriberCount() < 103043316);
long subscriberCount = ci.getSubscriberCount();

// Only test if subscribers count is available in the search page
if (subscriberCount != -1) {
assertTrue("Count does not fit: " + Long.toString(subscriberCount),
69043316 < subscriberCount && subscriberCount < 103043316);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to start failing because PewDiePie will soon have more that 103,043,316 subscribers (currently he has 102M).

Using this we should be safe for the next 10 years: ;-)

Suggested change
69043316 < subscriberCount && subscriberCount < 103043316);
100000000 < subscriberCount && subscriberCount < 300000000);

}
}
}
}