Skip to content
This repository was archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
fix(YouTube - Shorts components): Hide Use this sound button doesn'…
Browse files Browse the repository at this point in the history
…t work
  • Loading branch information
inotia00 authored and Francesco146 committed Sep 1, 2024
1 parent 7ee5630 commit e7285fd
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public final class ShortsButtonFilter extends Filter {
private final StringFilterGroup subscribeButton;
private final StringFilterGroup joinButton;
private final StringFilterGroup pausedOverlayButtons;
private final StringFilterGroup metaPanelButton;
private final ByteArrayFilterGroupList pausedOverlayButtonsGroupList = new ByteArrayFilterGroupList();

private final ByteArrayFilterGroup shortsCommentDisabled;
Expand Down Expand Up @@ -86,6 +87,11 @@ public ShortsButtonFilter() {
"reel_player_disclosure.eml"
);

metaPanelButton = new StringFilterGroup(
null,
"|ContainerType|button.eml|"
);

joinButton = new StringFilterGroup(
Settings.HIDE_SHORTS_JOIN_BUTTON,
"sponsor_button"
Expand All @@ -107,7 +113,7 @@ public ShortsButtonFilter() {
);

addPathCallbacks(
suggestedAction, actionBar, joinButton, subscribeButton,
suggestedAction, actionBar, joinButton, subscribeButton, metaPanelButton,
paidPromotionButton, pausedOverlayButtons, channelBar, fullVideoLinkLabel,
videoTitle, reelSoundMetadata, infoPanel, liveHeader
);
Expand Down Expand Up @@ -203,6 +209,13 @@ public boolean isFiltered(String path, @Nullable String identifier, String allVa
return false;
}

if (matchedGroup == metaPanelButton) {
if (path.startsWith(REEL_METAPANEL_PATH) && useThisSoundButton.check(protobufBufferArray).isFiltered()) {
return super.isFiltered(path, identifier, allValue, protobufBufferArray, matchedGroup, contentType, contentIndex);
}
return false;
}

// Video action buttons (like, dislike, comment, share, remix) have the same path.
if (matchedGroup == actionBar) {
// If the Comment button is hidden, there is no need to check {@code REEL_COMMENTS_DISABLED_PATTERN}.
Expand Down

0 comments on commit e7285fd

Please sign in to comment.