Skip to content

Commit

Permalink
fix(YouTube - Hide shorts components): Hide the subscribe button when…
Browse files Browse the repository at this point in the history
… paused
  • Loading branch information
oSumAtrIX committed Oct 5, 2023
1 parent 1efd5c8 commit 6730aaf
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -16,6 +16,7 @@ public final class ShortsFilter extends Filter {
private final String REEL_CHANNEL_BAR_PATH = "reel_channel_bar.eml";

private final StringFilterGroup channelBar;
private final StringFilterGroup subscribeButton;
private final StringFilterGroup soundButton;
private final StringFilterGroup infoPanel;
private final StringFilterGroup shelfHeader;
Expand Down Expand Up @@ -53,7 +54,8 @@ public ShortsFilter() {
SettingsEnum.HIDE_SHORTS_JOIN_BUTTON,
"sponsor_button"
);
var subscribeButton = new StringFilterGroup(

subscribeButton = new StringFilterGroup(
SettingsEnum.HIDE_SHORTS_SUBSCRIBE_BUTTON,
"subscribe_button",
"shorts_paused_state"
Expand All @@ -63,6 +65,7 @@ public ShortsFilter() {
SettingsEnum.HIDE_SHORTS_CHANNEL_BAR,
REEL_CHANNEL_BAR_PATH
);

soundButton = new StringFilterGroup(
SettingsEnum.HIDE_SHORTS_SOUND_BUTTON,
"reel_pivot_button"
Expand Down Expand Up @@ -105,8 +108,11 @@ boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBuff
FilterGroupList matchedList, FilterGroup matchedGroup, int matchedIndex) {
if (matchedList == pathFilterGroupList) {
// Always filter if matched.
if (matchedGroup == soundButton || matchedGroup == infoPanel || matchedGroup == channelBar)
return super.isFiltered(identifier, path, protobufBufferArray, matchedList, matchedGroup, matchedIndex);
if (matchedGroup == soundButton ||
matchedGroup == infoPanel ||
matchedGroup == channelBar ||
matchedGroup == subscribeButton
) return super.isFiltered(identifier, path, protobufBufferArray, matchedList, matchedGroup, matchedIndex);

// Video action buttons (comment, share, remix) have the same path.
if (matchedGroup == videoActionButton) {
Expand Down

0 comments on commit 6730aaf

Please sign in to comment.