fix(YouTube - Hide layout components): Fix "Hide video description attributes" (#5250)

This commit is contained in:
ILoveOpenSourceApplications
2025-06-25 00:17:46 +05:30
committed by GitHub
parent 957bece3e9
commit 978c24458b

View File

@@ -14,6 +14,9 @@ final class DescriptionComponentsFilter extends Filter {
private final StringFilterGroup macroMarkersCarousel; private final StringFilterGroup macroMarkersCarousel;
private final StringFilterGroup horizontalShelf;
private final ByteArrayFilterGroup cellVideoAttribute;
public DescriptionComponentsFilter() { public DescriptionComponentsFilter() {
exceptions.addPatterns( exceptions.addPatterns(
"compact_channel", "compact_channel",
@@ -35,8 +38,7 @@ final class DescriptionComponentsFilter extends Filter {
final StringFilterGroup attributesSection = new StringFilterGroup( final StringFilterGroup attributesSection = new StringFilterGroup(
Settings.HIDE_ATTRIBUTES_SECTION, Settings.HIDE_ATTRIBUTES_SECTION,
"gaming_section", // "gaming_section", "music_section"
"music_section",
"video_attributes_section" "video_attributes_section"
); );
@@ -76,15 +78,26 @@ final class DescriptionComponentsFilter extends Filter {
) )
); );
horizontalShelf = new StringFilterGroup(
Settings.HIDE_ATTRIBUTES_SECTION,
"horizontal_shelf.eml"
);
cellVideoAttribute = new ByteArrayFilterGroup(
null,
"cell_video_attribute"
);
addPathCallbacks( addPathCallbacks(
aiGeneratedVideoSummarySection, aiGeneratedVideoSummarySection,
askSection, askSection,
attributesSection, attributesSection,
infoCardsSection, infoCardsSection,
horizontalShelf,
howThisWasMadeSection, howThisWasMadeSection,
macroMarkersCarousel,
podcastSection, podcastSection,
transcriptSection, transcriptSection
macroMarkersCarousel
); );
} }
@@ -97,6 +110,10 @@ final class DescriptionComponentsFilter extends Filter {
return contentIndex == 0 && macroMarkersCarouselGroupList.check(protobufBufferArray).isFiltered(); return contentIndex == 0 && macroMarkersCarouselGroupList.check(protobufBufferArray).isFiltered();
} }
if (matchedGroup == horizontalShelf) {
return cellVideoAttribute.check(protobufBufferArray).isFiltered();
}
return true; return true;
} }
} }