[YouTube] Add Albums channel tab
This commit is contained in:
parent
9ab932e394
commit
4408e2d0ac
|
@ -445,6 +445,9 @@ public class YoutubeChannelExtractor extends ChannelExtractor {
|
|||
case "streams":
|
||||
addNonVideosTab.accept(ChannelTabs.LIVESTREAMS);
|
||||
break;
|
||||
case "releases":
|
||||
addNonVideosTab.accept(ChannelTabs.ALBUMS);
|
||||
break;
|
||||
case "playlists":
|
||||
addNonVideosTab.accept(ChannelTabs.PLAYLISTS);
|
||||
break;
|
||||
|
|
|
@ -78,6 +78,8 @@ public class YoutubeChannelTabExtractor extends ChannelTabExtractor {
|
|||
return "EgZzaG9ydHPyBgUKA5oBAA%3D%3D";
|
||||
case ChannelTabs.LIVESTREAMS:
|
||||
return "EgdzdHJlYW1z8gYECgJ6AA%3D%3D";
|
||||
case ChannelTabs.ALBUMS:
|
||||
return "EghyZWxlYXNlc_IGBQoDsgEA";
|
||||
case ChannelTabs.PLAYLISTS:
|
||||
return "EglwbGF5bGlzdHPyBgQKAkIA";
|
||||
default:
|
||||
|
@ -304,7 +306,7 @@ public class YoutubeChannelTabExtractor extends ChannelTabExtractor {
|
|||
richItem.getObject("reelItemRenderer"));
|
||||
} else if (richItem.has("playlistRenderer")) {
|
||||
getCommitPlaylistConsumer(collector, channelIds,
|
||||
item.getObject("playlistRenderer"));
|
||||
richItem.getObject("playlistRenderer"));
|
||||
}
|
||||
} else if (item.has("gridVideoRenderer")) {
|
||||
getCommitVideoConsumer(collector, timeAgoParser, channelIds,
|
||||
|
|
|
@ -29,6 +29,8 @@ public final class YoutubeChannelTabLinkHandlerFactory extends ListLinkHandlerFa
|
|||
return "/shorts";
|
||||
case ChannelTabs.LIVESTREAMS:
|
||||
return "/streams";
|
||||
case ChannelTabs.ALBUMS:
|
||||
return "/releases";
|
||||
case ChannelTabs.PLAYLISTS:
|
||||
return "/playlists";
|
||||
default:
|
||||
|
@ -65,6 +67,7 @@ public final class YoutubeChannelTabLinkHandlerFactory extends ListLinkHandlerFa
|
|||
ChannelTabs.VIDEOS,
|
||||
ChannelTabs.SHORTS,
|
||||
ChannelTabs.LIVESTREAMS,
|
||||
ChannelTabs.ALBUMS,
|
||||
ChannelTabs.PLAYLISTS
|
||||
};
|
||||
}
|
||||
|
|
|
@ -112,6 +112,28 @@ class YoutubeChannelTabExtractorTest {
|
|||
@Override public boolean expectedHasMoreItems() { return true; }
|
||||
}
|
||||
|
||||
static class Albums extends DefaultListExtractorTest<ChannelTabExtractor> {
|
||||
private static YoutubeChannelTabExtractor extractor;
|
||||
|
||||
@BeforeAll
|
||||
static void setUp() throws IOException, ExtractionException {
|
||||
YoutubeTestsUtils.ensureStateless();
|
||||
NewPipe.init(DownloaderFactory.getDownloader(RESOURCE_PATH + "albums"));
|
||||
extractor = (YoutubeChannelTabExtractor) YouTube.getChannelTabExtractorFromId(
|
||||
"@Radiohead", ChannelTabs.ALBUMS);
|
||||
extractor.fetchPage();
|
||||
}
|
||||
|
||||
@Override public ChannelTabExtractor extractor() throws Exception { return extractor; }
|
||||
@Override public StreamingService expectedService() throws Exception { return YouTube; }
|
||||
@Override public String expectedName() throws Exception { return ChannelTabs.ALBUMS; }
|
||||
@Override public String expectedId() throws Exception { return "UCq19-LqvG35A-30oyAiPiqA"; }
|
||||
@Override public String expectedUrlContains() throws Exception { return "https://www.youtube.com/channel/UCq19-LqvG35A-30oyAiPiqA/releases"; }
|
||||
@Override public String expectedOriginalUrlContains() throws Exception { return "https://www.youtube.com/@Radiohead/releases"; }
|
||||
@Override public InfoItem.InfoType expectedInfoItemType() { return InfoItem.InfoType.PLAYLIST; }
|
||||
@Override public boolean expectedHasMoreItems() { return true; }
|
||||
}
|
||||
|
||||
|
||||
// TESTS FOR TABS OF AGE RESTRICTED CHANNELS
|
||||
// Fetching the tabs individually would use the standard tabs without fallback to
|
||||
|
|
Loading…
Reference in New Issue