mirror of
https://github.com/revanced/revanced-integrations.git
synced 2024-11-08 05:07:02 +01:00
feat(YouTube - Hide Shorts components): Hide like and dislike buttons
This commit is contained in:
parent
b945e2f44b
commit
2a08e5a98e
@ -27,7 +27,7 @@ public final class ShortsFilter extends Filter {
|
||||
private final StringFilterGroup infoPanel;
|
||||
private final StringFilterGroup shelfHeader;
|
||||
|
||||
private final StringFilterGroup videoActionButton;
|
||||
private final StringFilterGroup actionBar;
|
||||
private final ByteArrayFilterGroupList videoActionButtonGroupList = new ByteArrayFilterGroupList();
|
||||
|
||||
public ShortsFilter() {
|
||||
@ -94,15 +94,25 @@ public final class ShortsFilter extends Filter {
|
||||
"shorts_info_panel_overview"
|
||||
);
|
||||
|
||||
videoActionButton = new StringFilterGroup(
|
||||
actionBar = new StringFilterGroup(
|
||||
null,
|
||||
"ContainerType|shorts_video_action_button"
|
||||
"shorts_action_bar"
|
||||
);
|
||||
|
||||
addPathCallbacks(
|
||||
shortsCompactFeedVideoPath,
|
||||
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(
|
||||
@ -120,7 +130,13 @@ public final class ShortsFilter extends Filter {
|
||||
"reel_remix_button"
|
||||
);
|
||||
|
||||
videoActionButtonGroupList.addAll(shortsCommentButton, shortsShareButton, shortsRemixButton);
|
||||
videoActionButtonGroupList.addAll(
|
||||
shortsLikeButton,
|
||||
shortsDislikeButton,
|
||||
shortsCommentButton,
|
||||
shortsShareButton,
|
||||
shortsRemixButton
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -141,8 +157,8 @@ public final class ShortsFilter extends Filter {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Video action buttons (comment, share, remix) have the same path.
|
||||
if (matchedGroup == videoActionButton) {
|
||||
// Video action buttons (like, dislike, comment, share, remix) have the same path.
|
||||
if (matchedGroup == actionBar) {
|
||||
if (videoActionButtonGroupList.check(protobufBufferArray).isFiltered()) return super.isFiltered(
|
||||
identifier, path, protobufBufferArray, matchedGroup, contentType, contentIndex
|
||||
);
|
||||
|
@ -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_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_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_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);
|
||||
|
Loading…
Reference in New Issue
Block a user