fix(YouTube - Hide Shorts components): Shorts shelves are sometimes not hidden

Co-authored-by: inotia00 <108592928+inotia00@users.noreply.github.com>
This commit is contained in:
oSumAtrIX 2026-03-21 19:44:53 +01:00
parent e52114076e
commit 09bce22aeb
No known key found for this signature in database
GPG key ID: A9B3094ACDB604B4
7 changed files with 62 additions and 81 deletions

View file

@ -9,5 +9,13 @@ public final class ConversionContext {
StringBuilder patch_getPathBuilder();
String patch_getIdentifier();
default boolean isHomeFeedOrRelatedVideo() {
return toString().contains("horizontalCollectionSwipeProtector=null");
}
default boolean isSubscriptionOrLibrary() {
return toString().contains("heightConstraint=null");
}
}
}

View file

@ -26,18 +26,12 @@ import java.util.List;
public abstract class Filter {
public enum FilterContentType {
CONTEXT,
IDENTIFIER,
PATH,
ACCESSIBILITY,
PROTOBUFFER
}
/**
* Context callbacks. Do not add to this instance,
* and instead use {@link #addContextCallbacks(StringFilterGroup...)}.
*/
protected final List<StringFilterGroup> contextCallbacks = new ArrayList<>();
/**
* Identifier callbacks. Do not add to this instance,
* and instead use {@link #addIdentifierCallbacks(StringFilterGroup...)}.
@ -49,14 +43,6 @@ public abstract class Filter {
*/
public final List<StringFilterGroup> pathCallbacks = new ArrayList<>();
/**
* Adds callbacks to {@link #isFiltered(ContextInterface, String, String, String, byte[], StringFilterGroup, FilterContentType, int)}
* if any of the groups are found.
*/
protected final void addContextCallbacks(StringFilterGroup... groups) {
contextCallbacks.addAll(Arrays.asList(groups));
}
/**
* Adds callbacks to {@link #isFiltered(ContextInterface, String, String, String, byte[], StringFilterGroup, FilterContentType, int)}
* if any of the groups are found.