2
0
mirror of https://github.com/TeamNewPipe/NewPipeExtractor synced 2025-08-22 18:07:47 +00:00

Merge pull request #1350 from Stypox/fix-search-filtered-lockup

This commit is contained in:
Stypox 2025-07-28 16:09:58 +02:00 committed by GitHub
commit 260ba4749a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -232,34 +232,34 @@ public class YoutubeSearchExtractor extends SearchExtractor {
throw new NothingFoundException( throw new NothingFoundException(
getTextFromObject(item.getObject("backgroundPromoRenderer") getTextFromObject(item.getObject("backgroundPromoRenderer")
.getObject("bodyText"))); .getObject("bodyText")));
} else if (extractVideoResults && item.has("videoRenderer")) { } else if (item.has("videoRenderer") && extractVideoResults) {
collector.commit(new YoutubeStreamInfoItemExtractor( collector.commit(new YoutubeStreamInfoItemExtractor(
item.getObject("videoRenderer"), timeAgoParser)); item.getObject("videoRenderer"), timeAgoParser));
} else if (extractChannelResults && item.has("channelRenderer")) { } else if (item.has("channelRenderer") && extractChannelResults) {
collector.commit(new YoutubeChannelInfoItemExtractor( collector.commit(new YoutubeChannelInfoItemExtractor(
item.getObject("channelRenderer"))); item.getObject("channelRenderer")));
} else if (extractPlaylistResults) { } else if (item.has("playlistRenderer") && extractPlaylistResults) {
if (item.has("playlistRenderer")) {
collector.commit(new YoutubePlaylistInfoItemExtractor( collector.commit(new YoutubePlaylistInfoItemExtractor(
item.getObject("playlistRenderer"))); item.getObject("playlistRenderer")));
} else if (item.has("showRenderer")) { } else if (item.has("showRenderer") && extractPlaylistResults) {
collector.commit(new YoutubeShowRendererInfoItemExtractor( collector.commit(new YoutubeShowRendererInfoItemExtractor(
item.getObject("showRenderer"))); item.getObject("showRenderer")));
} else if (item.has("lockupViewModel")) { } else if (item.has("lockupViewModel")) {
final JsonObject lockupViewModel = item.getObject("lockupViewModel"); final JsonObject lockupViewModel = item.getObject("lockupViewModel");
final String contentType = lockupViewModel.getString("contentType"); 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)) { || "LOCKUP_CONTENT_TYPE_PODCAST".equals(contentType))
&& extractPlaylistResults) {
collector.commit( collector.commit(
new YoutubeMixOrPlaylistLockupInfoItemExtractor(lockupViewModel)); new YoutubeMixOrPlaylistLockupInfoItemExtractor(lockupViewModel));
} else if ("LOCKUP_CONTENT_TYPE_VIDEO".equals(contentType)) { } else if ("LOCKUP_CONTENT_TYPE_VIDEO".equals(contentType)
&& extractVideoResults) {
collector.commit(new YoutubeStreamInfoItemLockupExtractor( collector.commit(new YoutubeStreamInfoItemLockupExtractor(
lockupViewModel, timeAgoParser)); lockupViewModel, timeAgoParser));
} }
} }
} }
} }
}
@Nullable @Nullable
private Page getNextPageFrom(final JsonObject continuationItemRenderer) { private Page getNextPageFrom(final JsonObject continuationItemRenderer) {