From 10ceda17688f1d2f181e54cc573719bd3e71d3eb Mon Sep 17 00:00:00 2001 From: basel Date: Fri, 3 Jul 2026 20:29:32 +0300 Subject: [PATCH] Fix: blocked channels not filtered from search results The applyBlocking() method only checked StreamInfoItem against the blocked channel list. ChannelInfoItem and PlaylistInfoItem were never filtered, allowing blocked channels and their playlists to appear in search results. Extended the channel filter check to also remove: - ChannelInfoItem (matched by getName()) - PlaylistInfoItem (matched by getUploaderName()) --- .../newpipe/extractor/InfoItemsCollector.java | 24 ++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/extractor/src/main/java/org/schabi/newpipe/extractor/InfoItemsCollector.java b/extractor/src/main/java/org/schabi/newpipe/extractor/InfoItemsCollector.java index bcd6c4a84..86e8024d1 100644 --- a/extractor/src/main/java/org/schabi/newpipe/extractor/InfoItemsCollector.java +++ b/extractor/src/main/java/org/schabi/newpipe/extractor/InfoItemsCollector.java @@ -1,7 +1,9 @@ package org.schabi.newpipe.extractor; +import org.schabi.newpipe.extractor.channel.ChannelInfoItem; import org.schabi.newpipe.extractor.exceptions.FoundAdException; import org.schabi.newpipe.extractor.exceptions.ParsingException; +import org.schabi.newpipe.extractor.playlist.PlaylistInfoItem; import org.schabi.newpipe.extractor.stream.StreamInfo; import org.schabi.newpipe.extractor.stream.StreamInfoItem; @@ -175,10 +177,26 @@ public void applyBlocking(FilterConfig filterConfig) { // Only check channels if we haven't already marked for removal if (!shouldRemove) { for (String channel : filterConfig.getChannels()) { - if (item instanceof StreamInfoItem && ((StreamInfoItem) item).getUploaderName() != null && - ((StreamInfoItem) item).getUploaderName().equals(channel)) { + // Filter videos by uploader name + if (item instanceof StreamInfoItem + && ((StreamInfoItem) item).getUploaderName() != null + && ((StreamInfoItem) item).getUploaderName().equals(channel)) { shouldRemove = true; - break; // No need to check other channels + break; + } + // Filter channel search results by channel name + if (item instanceof ChannelInfoItem + && item.getName() != null + && item.getName().equals(channel)) { + shouldRemove = true; + break; + } + // Filter playlists by uploader name + if (item instanceof PlaylistInfoItem + && ((PlaylistInfoItem) item).getUploaderName() != null + && ((PlaylistInfoItem) item).getUploaderName().equals(channel)) { + shouldRemove = true; + break; } } }