diff --git a/src/parser/classes/EngagementPanelSectionList.ts b/src/parser/classes/EngagementPanelSectionList.ts index 70c572ee0..c69d194f9 100644 --- a/src/parser/classes/EngagementPanelSectionList.ts +++ b/src/parser/classes/EngagementPanelSectionList.ts @@ -7,12 +7,13 @@ import MacroMarkersList from './MacroMarkersList.js'; import ProductList from './ProductList.js'; import SectionList from './SectionList.js'; import StructuredDescriptionContent from './StructuredDescriptionContent.js'; +import VideoAttributeView from './VideoAttributeView.js'; export default class EngagementPanelSectionList extends YTNode { static type = 'EngagementPanelSectionList'; header: EngagementPanelTitleHeader | null; - content: SectionList | ContinuationItem | ClipSection | StructuredDescriptionContent | MacroMarkersList | ProductList | null; + content: VideoAttributeView | SectionList | ContinuationItem | ClipSection | StructuredDescriptionContent | MacroMarkersList | ProductList | null; target_id?: string; panel_identifier?: string; visibility?: string; @@ -20,7 +21,7 @@ export default class EngagementPanelSectionList extends YTNode { constructor(data: RawNode) { super(); this.header = Parser.parseItem(data.header, EngagementPanelTitleHeader); - this.content = Parser.parseItem(data.content, [ SectionList, ContinuationItem, ClipSection, StructuredDescriptionContent, MacroMarkersList, ProductList ]); + this.content = Parser.parseItem(data.content, [ VideoAttributeView, SectionList, ContinuationItem, ClipSection, StructuredDescriptionContent, MacroMarkersList, ProductList ]); this.panel_identifier = data.panelIdentifier; this.target_id = data.targetId; this.visibility = data.visibility; diff --git a/src/parser/classes/HorizontalCardList.ts b/src/parser/classes/HorizontalCardList.ts index cee9dce04..3621d0a14 100644 --- a/src/parser/classes/HorizontalCardList.ts +++ b/src/parser/classes/HorizontalCardList.ts @@ -5,18 +5,19 @@ import Button from './Button.js'; import MacroMarkersListItem from './MacroMarkersListItem.js'; import GameCard from './GameCard.js'; import VideoCard from './VideoCard.js'; +import VideoAttributeView from './VideoAttributeView.js'; export default class HorizontalCardList extends YTNode { static type = 'HorizontalCardList'; - cards: ObservedArray; + cards: ObservedArray; header: YTNode; previous_button: Button | null; next_button: Button | null; constructor(data: RawNode) { super(); - this.cards = Parser.parseArray(data.cards, [ SearchRefinementCard, MacroMarkersListItem, GameCard, VideoCard ]); + this.cards = Parser.parseArray(data.cards, [ VideoAttributeView, SearchRefinementCard, MacroMarkersListItem, GameCard, VideoCard ]); this.header = Parser.parseItem(data.header); this.previous_button = Parser.parseItem(data.previousButton, Button); this.next_button = Parser.parseItem(data.nextButton, Button); diff --git a/src/parser/classes/VideoAttributeView.ts b/src/parser/classes/VideoAttributeView.ts new file mode 100644 index 000000000..8f8fe8170 --- /dev/null +++ b/src/parser/classes/VideoAttributeView.ts @@ -0,0 +1,42 @@ +import { YTNode } from '../helpers.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; + +import ContentPreviewImageView from './ContentPreviewImageView.js'; +import { Parser } from '../index.js'; + +import type { RawNode } from '../types/index.js'; + +export default class VideoAttributeView extends YTNode { + static type = 'VideoAttributeView'; + + image: ContentPreviewImageView | null; + image_style: string; + title: string; + subtitle: string; + secondary_subtitle: { + content: string + }; + orientation: string; + sizing_rule: string; + overflow_menu_on_tap: { + innertube_command: NavigationEndpoint + }; + overflow_menu_a11y_label: string; + + constructor(data: RawNode) { + super(); + this.image = Parser.parseItem(data.image, ContentPreviewImageView); + this.image_style = data.imageStyle; + this.title = data.title; + this.subtitle = data.subtitle; + this.secondary_subtitle = { + content: data.secondarySubtitle.content + }; + this.orientation = data.orientation; + this.sizing_rule = data.sizingRule; + this.overflow_menu_on_tap = { + innertube_command: new NavigationEndpoint(data.overflowMenuOnTap.innertubeCommand) + }; + this.overflow_menu_a11y_label = data.overflowMenuA11yLabel; + } +} \ No newline at end of file diff --git a/src/parser/nodes.ts b/src/parser/nodes.ts index 00b099290..0cfb0d8fa 100644 --- a/src/parser/nodes.ts +++ b/src/parser/nodes.ts @@ -380,6 +380,7 @@ export { default as UpsellDialog } from './classes/UpsellDialog.js'; export { default as VerticalList } from './classes/VerticalList.js'; export { default as VerticalWatchCardList } from './classes/VerticalWatchCardList.js'; export { default as Video } from './classes/Video.js'; +export { default as VideoAttributeView } from './classes/VideoAttributeView.js'; export { default as VideoCard } from './classes/VideoCard.js'; export { default as VideoDescriptionCourseSection } from './classes/VideoDescriptionCourseSection.js'; export { default as VideoDescriptionHeader } from './classes/VideoDescriptionHeader.js';