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

Commit

Permalink
fix(YouTube - Shorts components): Better filtering for disabled comme…
Browse files Browse the repository at this point in the history
…nt button
  • Loading branch information
anddea committed Jun 17, 2024
1 parent 3e823e2 commit 5cd6c0c
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ public ShortsButtonFilter() {
videoTitle, reelSoundMetadata, infoPanel, liveHeader
);

//
// Action buttons
//
//
// Action buttons
//
Expand Down Expand Up @@ -160,7 +157,7 @@ public ShortsButtonFilter() {
new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_TAGGED_PRODUCTS,
// Product buttons show pictures of the products, and does not have any unique icons to identify.
// Instead use a unique identifier found in the buffer.
// Instead, use a unique identifier found in the buffer.
"PAproduct_listZ"
),
new ByteArrayFilterGroup(
Expand Down Expand Up @@ -200,10 +197,10 @@ public boolean isFiltered(String path, @Nullable String identifier, String allVa
if (videoActionButtonGroupList.check(protobufBufferArray).isFiltered()) {
return super.isFiltered(path, identifier, allValue, protobufBufferArray, matchedGroup, contentType, contentIndex);
}

String protobufString = new String(protobufBufferArray);
if (shortsCommentDisabled.check(protobufBufferArray).isFiltered()) {
if (REEL_COMMENTS_DISABLED_PATTERN.matcher(new String(protobufBufferArray)).find()) {
return super.isFiltered(path, identifier, allValue, protobufBufferArray, matchedGroup, contentType, contentIndex);
}
return !REEL_COMMENTS_DISABLED_PATTERN.matcher(protobufString).find();
}
return false;
}
Expand Down

0 comments on commit 5cd6c0c

Please sign in to comment.