mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-25 07:42:11 +00:00
feat(parser): Add VideoAttributesSectionView node (#732)
This commit is contained in:
@@ -8,6 +8,7 @@ import VideoDescriptionMusicSection from './VideoDescriptionMusicSection.js';
|
||||
import VideoDescriptionTranscriptSection from './VideoDescriptionTranscriptSection.js';
|
||||
import VideoDescriptionCourseSection from './VideoDescriptionCourseSection.js';
|
||||
import ReelShelf from './ReelShelf.js';
|
||||
import VideoAttributesSectionView from './VideoAttributesSectionView.js';
|
||||
|
||||
export default class StructuredDescriptionContent extends YTNode {
|
||||
static type = 'StructuredDescriptionContent';
|
||||
@@ -15,7 +16,7 @@ export default class StructuredDescriptionContent extends YTNode {
|
||||
items: ObservedArray<
|
||||
VideoDescriptionHeader | ExpandableVideoDescriptionBody | VideoDescriptionMusicSection |
|
||||
VideoDescriptionInfocardsSection | VideoDescriptionTranscriptSection | VideoDescriptionTranscriptSection |
|
||||
VideoDescriptionCourseSection | HorizontalCardList | ReelShelf
|
||||
VideoDescriptionCourseSection | HorizontalCardList | ReelShelf | VideoAttributesSectionView
|
||||
>;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
@@ -23,7 +24,7 @@ export default class StructuredDescriptionContent extends YTNode {
|
||||
this.items = Parser.parseArray(data.items, [
|
||||
VideoDescriptionHeader, ExpandableVideoDescriptionBody, VideoDescriptionMusicSection,
|
||||
VideoDescriptionInfocardsSection, VideoDescriptionCourseSection, VideoDescriptionTranscriptSection,
|
||||
VideoDescriptionTranscriptSection, HorizontalCardList, ReelShelf
|
||||
VideoDescriptionTranscriptSection, HorizontalCardList, ReelShelf, VideoAttributesSectionView
|
||||
]);
|
||||
}
|
||||
}
|
||||
24
src/parser/classes/VideoAttributesSectionView.ts
Normal file
24
src/parser/classes/VideoAttributesSectionView.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { Parser, type RawNode } from '../index.js';
|
||||
import { YTNode, type ObservedArray } from '../helpers.js';
|
||||
|
||||
import ButtonView from './ButtonView.js';
|
||||
import VideoAttributeView from './VideoAttributeView.js';
|
||||
|
||||
export default class VideoAttributesSectionView extends YTNode {
|
||||
static type = 'VideoAttributesSectionView';
|
||||
|
||||
header_title: string;
|
||||
header_subtitle: string;
|
||||
video_attributes: ObservedArray<VideoAttributeView>;
|
||||
previous_button: ButtonView | null;
|
||||
next_button: ButtonView | null;
|
||||
|
||||
constructor(data: RawNode) {
|
||||
super();
|
||||
this.header_title = data.headerTitle;
|
||||
this.header_subtitle = data.headerSubtitle;
|
||||
this.video_attributes = Parser.parseArray(data.videoAttributeViewModels, VideoAttributeView);
|
||||
this.previous_button = Parser.parseItem(data.previousButton, ButtonView);
|
||||
this.next_button = Parser.parseItem(data.nextButton, ButtonView);
|
||||
}
|
||||
}
|
||||
@@ -415,6 +415,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 VideoAttributesSectionView } from './classes/VideoAttributesSectionView.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';
|
||||
|
||||
Reference in New Issue
Block a user