Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -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;
}
}
}
Expand Down