fix(YouTube): Support A/B Shorts layout for RYD and component hiding (#5081)

This commit is contained in:
alieRN
2025-06-01 09:59:09 +03:00
committed by GitHub
parent 7af0c6f2d2
commit 8ecacaad27
2 changed files with 19 additions and 9 deletions

View File

@ -152,11 +152,15 @@ public class ReturnYouTubeDislikePatch {
return original; // No need to check for Shorts in the context. return original; // No need to check for Shorts in the context.
} }
if (conversionContextString.contains("|shorts_dislike_button.eml")) { if (Utils.containsAny(conversionContextString,
"|shorts_dislike_button.eml", "|reel_dislike_button.eml"
)) {
return getShortsSpan(original, true); return getShortsSpan(original, true);
} }
if (conversionContextString.contains("|shorts_like_button.eml")) { if (Utils.containsAny(conversionContextString,
"|shorts_like_button.eml", "|reel_like_button.eml"
)) {
if (!Utils.containsNumber(original)) { if (!Utils.containsNumber(original)) {
Logger.printDebug(() -> "Replacing hidden likes count"); Logger.printDebug(() -> "Replacing hidden likes count");
return getShortsSpan(original, false); return getShortsSpan(original, false);

View File

@ -143,12 +143,14 @@ public final class ShortsFilter extends Filter {
StringFilterGroup likeButton = new StringFilterGroup( StringFilterGroup likeButton = new StringFilterGroup(
Settings.HIDE_SHORTS_LIKE_BUTTON, Settings.HIDE_SHORTS_LIKE_BUTTON,
"shorts_like_button.eml" "shorts_like_button.eml",
"reel_like_button.eml"
); );
StringFilterGroup dislikeButton = new StringFilterGroup( StringFilterGroup dislikeButton = new StringFilterGroup(
Settings.HIDE_SHORTS_DISLIKE_BUTTON, Settings.HIDE_SHORTS_DISLIKE_BUTTON,
"shorts_dislike_button.eml" "shorts_dislike_button.eml",
"reel_dislike_button.eml"
); );
joinButton = new StringFilterGroup( joinButton = new StringFilterGroup(
@ -168,12 +170,13 @@ public final class ShortsFilter extends Filter {
shortsActionBar = new StringFilterGroup( shortsActionBar = new StringFilterGroup(
null, null,
"shorts_action_bar.eml" "shorts_action_bar.eml",
"reel_action_bar.eml"
); );
actionButton = new StringFilterGroup( actionButton = new StringFilterGroup(
null, null,
// Can be simply 'button.eml' or 'shorts_video_action_button.eml' // Can be simply 'button.eml', 'shorts_video_action_button.eml' or 'reel_action_button.eml'
"button.eml" "button.eml"
); );
@ -195,15 +198,18 @@ public final class ShortsFilter extends Filter {
videoActionButtonGroupList.addAll( videoActionButtonGroupList.addAll(
new ByteArrayFilterGroup( new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_COMMENTS_BUTTON, Settings.HIDE_SHORTS_COMMENTS_BUTTON,
"reel_comment_button" "reel_comment_button",
"youtube_shorts_comment_outline"
), ),
new ByteArrayFilterGroup( new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_SHARE_BUTTON, Settings.HIDE_SHORTS_SHARE_BUTTON,
"reel_share_button" "reel_share_button",
"youtube_shorts_share_outline"
), ),
new ByteArrayFilterGroup( new ByteArrayFilterGroup(
Settings.HIDE_SHORTS_REMIX_BUTTON, Settings.HIDE_SHORTS_REMIX_BUTTON,
"reel_remix_button" "reel_remix_button",
"youtube_shorts_remix_outline"
) )
); );