fix(YouTube): Support A/B Shorts layout for RYD and component hiding (#5081)
This commit is contained in:
@ -152,11 +152,15 @@ public class ReturnYouTubeDislikePatch {
|
||||
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);
|
||||
}
|
||||
|
||||
if (conversionContextString.contains("|shorts_like_button.eml")) {
|
||||
if (Utils.containsAny(conversionContextString,
|
||||
"|shorts_like_button.eml", "|reel_like_button.eml"
|
||||
)) {
|
||||
if (!Utils.containsNumber(original)) {
|
||||
Logger.printDebug(() -> "Replacing hidden likes count");
|
||||
return getShortsSpan(original, false);
|
||||
|
@ -143,12 +143,14 @@ public final class ShortsFilter extends Filter {
|
||||
|
||||
StringFilterGroup likeButton = new StringFilterGroup(
|
||||
Settings.HIDE_SHORTS_LIKE_BUTTON,
|
||||
"shorts_like_button.eml"
|
||||
"shorts_like_button.eml",
|
||||
"reel_like_button.eml"
|
||||
);
|
||||
|
||||
StringFilterGroup dislikeButton = new StringFilterGroup(
|
||||
Settings.HIDE_SHORTS_DISLIKE_BUTTON,
|
||||
"shorts_dislike_button.eml"
|
||||
"shorts_dislike_button.eml",
|
||||
"reel_dislike_button.eml"
|
||||
);
|
||||
|
||||
joinButton = new StringFilterGroup(
|
||||
@ -168,12 +170,13 @@ public final class ShortsFilter extends Filter {
|
||||
|
||||
shortsActionBar = new StringFilterGroup(
|
||||
null,
|
||||
"shorts_action_bar.eml"
|
||||
"shorts_action_bar.eml",
|
||||
"reel_action_bar.eml"
|
||||
);
|
||||
|
||||
actionButton = new StringFilterGroup(
|
||||
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"
|
||||
);
|
||||
|
||||
@ -195,15 +198,18 @@ public final class ShortsFilter extends Filter {
|
||||
videoActionButtonGroupList.addAll(
|
||||
new ByteArrayFilterGroup(
|
||||
Settings.HIDE_SHORTS_COMMENTS_BUTTON,
|
||||
"reel_comment_button"
|
||||
"reel_comment_button",
|
||||
"youtube_shorts_comment_outline"
|
||||
),
|
||||
new ByteArrayFilterGroup(
|
||||
Settings.HIDE_SHORTS_SHARE_BUTTON,
|
||||
"reel_share_button"
|
||||
"reel_share_button",
|
||||
"youtube_shorts_share_outline"
|
||||
),
|
||||
new ByteArrayFilterGroup(
|
||||
Settings.HIDE_SHORTS_REMIX_BUTTON,
|
||||
"reel_remix_button"
|
||||
"reel_remix_button",
|
||||
"youtube_shorts_remix_outline"
|
||||
)
|
||||
);
|
||||
|
||||
|
Reference in New Issue
Block a user