feat(YouTube - Hide Shorts components): Hide like and dislike buttons

This commit is contained in:
oSumAtrIX 2024-03-26 01:50:40 +01:00
parent b945e2f44b
commit 2a08e5a98e
No known key found for this signature in database
GPG Key ID: A9B3094ACDB604B4
2 changed files with 25 additions and 7 deletions

View File

@ -27,7 +27,7 @@ public final class ShortsFilter extends Filter {
private final StringFilterGroup infoPanel; private final StringFilterGroup infoPanel;
private final StringFilterGroup shelfHeader; private final StringFilterGroup shelfHeader;
private final StringFilterGroup videoActionButton; private final StringFilterGroup actionBar;
private final ByteArrayFilterGroupList videoActionButtonGroupList = new ByteArrayFilterGroupList(); private final ByteArrayFilterGroupList videoActionButtonGroupList = new ByteArrayFilterGroupList();
public ShortsFilter() { public ShortsFilter() {
@ -94,15 +94,25 @@ public final class ShortsFilter extends Filter {
"shorts_info_panel_overview" "shorts_info_panel_overview"
); );
videoActionButton = new StringFilterGroup( actionBar = new StringFilterGroup(
null, null,
"ContainerType|shorts_video_action_button" "shorts_action_bar"
); );
addPathCallbacks( addPathCallbacks(
shortsCompactFeedVideoPath, shortsCompactFeedVideoPath,
joinButton, subscribeButton, subscribeButtonPaused, joinButton, subscribeButton, subscribeButtonPaused,
channelBar, soundButton, infoPanel, videoActionButton channelBar, soundButton, infoPanel, actionBar
);
var shortsLikeButton = new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_LIKE_BUTTON,
"shorts_like_button"
);
var shortsDislikeButton = new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_DISLIKE_BUTTON,
"shorts_dislike_button"
); );
var shortsCommentButton = new ByteArrayFilterGroup( var shortsCommentButton = new ByteArrayFilterGroup(
@ -120,7 +130,13 @@ public final class ShortsFilter extends Filter {
"reel_remix_button" "reel_remix_button"
); );
videoActionButtonGroupList.addAll(shortsCommentButton, shortsShareButton, shortsRemixButton); videoActionButtonGroupList.addAll(
shortsLikeButton,
shortsDislikeButton,
shortsCommentButton,
shortsShareButton,
shortsRemixButton
);
} }
@Override @Override
@ -141,8 +157,8 @@ public final class ShortsFilter extends Filter {
return false; return false;
} }
// Video action buttons (comment, share, remix) have the same path. // Video action buttons (like, dislike, comment, share, remix) have the same path.
if (matchedGroup == videoActionButton) { if (matchedGroup == actionBar) {
if (videoActionButtonGroupList.check(protobufBufferArray).isFiltered()) return super.isFiltered( if (videoActionButtonGroupList.check(protobufBufferArray).isFiltered()) return super.isFiltered(
identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex
); );

View File

@ -141,6 +141,8 @@ public class Settings extends BaseSettings {
public static final BooleanSetting HIDE_SHORTS_SUBSCRIBE_BUTTON = new BooleanSetting("revanced_hide_shorts_subscribe_button", TRUE); public static final BooleanSetting HIDE_SHORTS_SUBSCRIBE_BUTTON = new BooleanSetting("revanced_hide_shorts_subscribe_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_SUBSCRIBE_BUTTON_PAUSED = new BooleanSetting("revanced_hide_shorts_subscribe_button_paused", FALSE); public static final BooleanSetting HIDE_SHORTS_SUBSCRIBE_BUTTON_PAUSED = new BooleanSetting("revanced_hide_shorts_subscribe_button_paused", FALSE);
public static final BooleanSetting HIDE_SHORTS_THANKS_BUTTON = new BooleanSetting("revanced_hide_shorts_thanks_button", TRUE); public static final BooleanSetting HIDE_SHORTS_THANKS_BUTTON = new BooleanSetting("revanced_hide_shorts_thanks_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_LIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_like_button", FALSE);
public static final BooleanSetting HIDE_SHORTS_DISLIKE_BUTTON = new BooleanSetting("revanced_hide_shorts_dislike_button", FALSE);
public static final BooleanSetting HIDE_SHORTS_COMMENTS_BUTTON = new BooleanSetting("revanced_hide_shorts_comments_button", FALSE); public static final BooleanSetting HIDE_SHORTS_COMMENTS_BUTTON = new BooleanSetting("revanced_hide_shorts_comments_button", FALSE);
public static final BooleanSetting HIDE_SHORTS_REMIX_BUTTON = new BooleanSetting("revanced_hide_shorts_remix_button", TRUE); public static final BooleanSetting HIDE_SHORTS_REMIX_BUTTON = new BooleanSetting("revanced_hide_shorts_remix_button", TRUE);
public static final BooleanSetting HIDE_SHORTS_SHARE_BUTTON = new BooleanSetting("revanced_hide_shorts_share_button", FALSE); public static final BooleanSetting HIDE_SHORTS_SHARE_BUTTON = new BooleanSetting("revanced_hide_shorts_share_button", FALSE);