Skip to content

Commit f3eeb71

Browse files
committed
tdd: feature tab
1 parent ba70ea7 commit f3eeb71

3 files changed

Lines changed: 22 additions & 1 deletion

File tree

extractor/src/main/java/org/schabi/newpipe/extractor/InfoItem.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ public enum InfoType {
7676
STREAM,
7777
PLAYLIST,
7878
CHANNEL,
79-
COMMENT
79+
COMMENT,
80+
RENDERERLIST
8081
}
8182
}

extractor/src/main/java/org/schabi/newpipe/extractor/channel/tabs/ChannelTabs.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* Constants of channel tabs supported by the extractor.
55
*/
66
public final class ChannelTabs {
7+
8+
public static final String FEATURED = "featured"; // Home Tab
79
public static final String VIDEOS = "videos";
810
public static final String TRACKS = "tracks";
911
public static final String SHORTS = "shorts";

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/YoutubeChannelTabExtractorTest.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,24 @@
1313

1414
class YoutubeChannelTabExtractorTest {
1515

16+
static class Features extends DefaultListExtractorTest<ChannelTabExtractor>
17+
implements InitYoutubeTest {
18+
19+
@Override
20+
protected ChannelTabExtractor createExtractor() throws Exception {
21+
return YouTube.getChannelTabExtractorFromId(
22+
"user/LinusTechTips", ChannelTabs.FEATURED);
23+
}
24+
25+
@Override public StreamingService expectedService() throws Exception { return YouTube; }
26+
@Override public String expectedName() throws Exception { return ChannelTabs.FEATURED; }
27+
@Override public String expectedId() throws Exception { return "UCXuqSBlHAE6Xw-yeJA0Tunw"; }
28+
@Override public String expectedUrlContains() throws Exception { return "https://www.youtube.com/channel/UCXuqSBlHAE6Xw-yeJA0Tunw/featured"; }
29+
@Override public String expectedOriginalUrlContains() throws Exception { return "https://www.youtube.com/user/LinusTechTips/featured"; }
30+
@Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.RENDERERLIST; }
31+
@Override public boolean expectedHasMoreItems() { return false; }
32+
}
33+
1634
static class Videos extends DefaultListExtractorTest<ChannelTabExtractor>
1735
implements InitYoutubeTest {
1836

0 commit comments

Comments
 (0)