Skip to content

Commit 5dd02ed

Browse files
Use separate String filter
1 parent 2251cfe commit 5dd02ed

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ final class DescriptionComponentsFilter extends Filter {
1313
private final ByteArrayFilterGroupList macroMarkersCarouselGroupList = new ByteArrayFilterGroupList();
1414

1515
private final StringFilterGroup macroMarkersCarousel;
16+
private final StringFilterGroup attributesSection;
17+
private final ByteArrayFilterGroup cellVideoAttribute;
1618

1719
public DescriptionComponentsFilter() {
1820
exceptions.addPatterns(
@@ -33,13 +35,18 @@ public DescriptionComponentsFilter() {
3335
"youchat_entrypoint.eml"
3436
);
3537

36-
final StringFilterGroup attributesSection = new StringFilterGroup(
38+
attributesSection = new StringFilterGroup(
3739
Settings.HIDE_ATTRIBUTES_SECTION,
38-
"gaming_section",
39-
"music_section",
40+
// "gaming_section", "music_section"
41+
"horizontal_shelf.eml"
4042
"video_attributes_section"
4143
);
4244

45+
cellVideoAttribute = new ByteArrayFilterGroup(
46+
null,
47+
"cell_video_attribute"
48+
);
49+
4350
final StringFilterGroup infoCardsSection = new StringFilterGroup(
4451
Settings.HIDE_INFO_CARDS_SECTION,
4552
"infocards_section"
@@ -97,6 +104,10 @@ boolean isFiltered(@Nullable String identifier, String path, byte[] protobufBuff
97104
return contentIndex == 0 && macroMarkersCarouselGroupList.check(protobufBufferArray).isFiltered();
98105
}
99106

107+
if (matchedGroup == attributesSection) {
108+
return cellVideoAttribute.check(protobufBufferArray).isFiltered();
109+
}
110+
100111
return true;
101112
}
102113
}

0 commit comments

Comments
 (0)