diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelTabExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelTabExtractor.java index 9d2a9e947..1a1f7fbbb 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelTabExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeChannelTabExtractor.java @@ -313,9 +313,14 @@ public class YoutubeChannelTabExtractor extends ChannelTabExtractor { .getArray("items"), channelVerifiedStatus, channelName, channelUrl); } else if (item.has("lockupViewModel")) { final JsonObject lockupViewModel = item.getObject("lockupViewModel"); - if ("LOCKUP_CONTENT_TYPE_PLAYLIST".equals(lockupViewModel.getString("contentType"))) { + final String contentType = lockupViewModel.getString("contentType"); + if ("LOCKUP_CONTENT_TYPE_PLAYLIST".equals(contentType) + || "LOCKUP_CONTENT_TYPE_PODCAST".equals(contentType)) { commitPlaylistLockup(collector, lockupViewModel, channelVerifiedStatus, channelName, channelUrl); + } else if ("LOCKUP_CONTENT_TYPE_VIDEO".equals(contentType)) { + commitVideoLockup(collector, timeAgoParser, lockupViewModel, channelVerifiedStatus, + channelName, channelUrl); } } else if (item.has("continuationItemRenderer")) { return Optional.ofNullable(item.getObject("continuationItemRenderer")); @@ -372,6 +377,31 @@ public class YoutubeChannelTabExtractor extends ChannelTabExtractor { }); } + private static void commitVideoLockup(@Nonnull final MultiInfoItemsCollector collector, + @Nonnull final TimeAgoParser timeAgoParser, + @Nonnull final JsonObject lockupViewModel, + @Nonnull final VerifiedStatus channelVerifiedStatus, + @Nullable final String channelName, + @Nullable final String channelUrl) { + collector.commit( + new YoutubeStreamInfoItemLockupExtractor(lockupViewModel, timeAgoParser) { + @Override + public String getUploaderName() throws ParsingException { + return isNullOrEmpty(channelName) ? super.getUploaderName() : channelName; + } + + @Override + public String getUploaderUrl() throws ParsingException { + return isNullOrEmpty(channelUrl) ? super.getUploaderName() : channelUrl; + } + + @Override + public boolean isUploaderVerified() { + return channelVerifiedStatus == VerifiedStatus.VERIFIED; + } + }); + } + private void commitPlaylistLockup(@Nonnull final MultiInfoItemsCollector collector, @Nonnull final JsonObject playlistLockupViewModel, @Nonnull final VerifiedStatus channelVerifiedStatus, diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeSearchExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeSearchExtractor.java index f10db0bc8..4b59c8582 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeSearchExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeSearchExtractor.java @@ -247,10 +247,14 @@ public class YoutubeSearchExtractor extends SearchExtractor { item.getObject("showRenderer"))); } else if (item.has("lockupViewModel")) { final JsonObject lockupViewModel = item.getObject("lockupViewModel"); - if ("LOCKUP_CONTENT_TYPE_PLAYLIST".equals( - lockupViewModel.getString("contentType"))) { + final String contentType = lockupViewModel.getString("contentType"); + if ("LOCKUP_CONTENT_TYPE_PLAYLIST".equals(contentType) + || "LOCKUP_CONTENT_TYPE_PODCAST".equals(contentType)) { collector.commit( new YoutubeMixOrPlaylistLockupInfoItemExtractor(lockupViewModel)); + } else if ("LOCKUP_CONTENT_TYPE_VIDEO".equals(contentType)) { + collector.commit(new YoutubeStreamInfoItemLockupExtractor( + lockupViewModel, timeAgoParser)); } } } diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java index 96e445b15..b2b3dc270 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/services/youtube/extractors/YoutubeStreamExtractor.java @@ -760,7 +760,8 @@ public class YoutubeStreamExtractor extends StreamExtractor { } else if (result.has("lockupViewModel")) { final JsonObject lockupViewModel = result.getObject("lockupViewModel"); final String contentType = lockupViewModel.getString("contentType"); - if ("LOCKUP_CONTENT_TYPE_PLAYLIST".equals(contentType)) { + if ("LOCKUP_CONTENT_TYPE_PLAYLIST".equals(contentType) + || "LOCKUP_CONTENT_TYPE_PODCAST".equals(contentType)) { return new YoutubeMixOrPlaylistLockupInfoItemExtractor( lockupViewModel); } else if ("LOCKUP_CONTENT_TYPE_VIDEO".equals(contentType)) {