Skip to content

Commit 2f22d45

Browse files
fix(YouTube - Hide layout components): Fix "Hide video description attributes" (#5250)
1 parent b399ecb commit 2f22d45

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/components/DescriptionComponentsFilter.java

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ final class DescriptionComponentsFilter extends Filter {
1414

1515
private final StringFilterGroup macroMarkersCarousel;
1616

17+
private final StringFilterGroup horizontalShelf;
18+
private final ByteArrayFilterGroup cellVideoAttribute;
19+
1720
public DescriptionComponentsFilter() {
1821
exceptions.addPatterns(
1922
"compact_channel",
@@ -35,8 +38,7 @@ public DescriptionComponentsFilter() {
3538

3639
final StringFilterGroup attributesSection = new StringFilterGroup(
3740
Settings.HIDE_ATTRIBUTES_SECTION,
38-
"gaming_section",
39-
"music_section",
41+
// "gaming_section", "music_section"
4042
"video_attributes_section"
4143
);
4244

@@ -76,15 +78,26 @@ public DescriptionComponentsFilter() {
7678
)
7779
);
7880

81+
horizontalShelf = new StringFilterGroup(
82+
Settings.HIDE_ATTRIBUTES_SECTION,
83+
"horizontal_shelf.eml"
84+
);
85+
86+
cellVideoAttribute = new ByteArrayFilterGroup(
87+
null,
88+
"cell_video_attribute"
89+
);
90+
7991
addPathCallbacks(
8092
aiGeneratedVideoSummarySection,
8193
askSection,
8294
attributesSection,
8395
infoCardsSection,
96+
horizontalShelf,
8497
howThisWasMadeSection,
98+
macroMarkersCarousel,
8599
podcastSection,
86-
transcriptSection,
87-
macroMarkersCarousel
100+
transcriptSection
88101
);
89102
}
90103

@@ -97,6 +110,10 @@ boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBuff
97110
return contentIndex == 0 && macroMarkersCarouselGroupList.check(protobufBufferArray).isFiltered();
98111
}
99112

113+
if (matchedGroup == horizontalShelf) {
114+
return cellVideoAttribute.check(protobufBufferArray).isFiltered();
115+
}
116+
100117
return true;
101118
}
102119
}

0 commit comments

Comments
 (0)