Improve testChannelUrl()

This commit is contained in:
wb9688 2020-02-29 18:20:35 +01:00
parent bfe3eb1409
commit 3e4d2fd64e

View file

@ -92,13 +92,18 @@ public class YoutubeSearchExtractorChannelOnlyTest extends YoutubeSearchExtracto
if (item instanceof ChannelInfoItem) { if (item instanceof ChannelInfoItem) {
ChannelInfoItem channel = (ChannelInfoItem) item; ChannelInfoItem channel = (ChannelInfoItem) item;
if (channel.getSubscriberCount() > 5e7 && channel.getName().equals("PewDiePie")) { // the real PewDiePie if (channel.getSubscriberCount() > 1e8) { // the real PewDiePie
assertEquals("https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw", item.getUrl()); assertEquals("https://www.youtube.com/channel/UC-lHJZR3Gqxm24_Vd_AJ5Yw", item.getUrl());
} else { break;
assertThat(item.getUrl(), CoreMatchers.startsWith("https://www.youtube.com/channel/"));
} }
} }
} }
for (InfoItem item : itemsPage.getItems()) {
if (item instanceof ChannelInfoItem) {
assertThat(item.getUrl(), CoreMatchers.startsWith("https://www.youtube.com/channel/"));
}
}
} }
@Test @Test