diff --git a/src/parser/classes/comments/CommentsEntryPointHeader.ts b/src/parser/classes/comments/CommentsEntryPointHeader.ts index a191b0233..2f0700725 100644 --- a/src/parser/classes/comments/CommentsEntryPointHeader.ts +++ b/src/parser/classes/comments/CommentsEntryPointHeader.ts @@ -1,9 +1,10 @@ import Text from '../misc/Text.js'; import Thumbnail from '../misc/Thumbnail.js'; +import CommentsSimplebox from './CommentsSimplebox.js'; +import CommentsEntryPointTeaser from './CommentsEntryPointTeaser.js'; import { YTNode } from '../../helpers.js'; import type { RawNode } from '../../index.js'; import { Parser } from '../../index.js'; -import CommentsEntryPointTeaser from './CommentsEntryPointTeaser.js'; export default class CommentsEntryPointHeader extends YTNode { static type = 'CommentsEntryPointHeader'; @@ -12,7 +13,7 @@ export default class CommentsEntryPointHeader extends YTNode { comment_count?: Text; teaser_avatar?: Thumbnail[]; teaser_content?: Text; - content_renderer?: CommentsEntryPointTeaser | null; + content_renderer?: CommentsEntryPointTeaser | CommentsSimplebox | null; simplebox_placeholder?: Text; constructor(data: RawNode) { @@ -35,7 +36,7 @@ export default class CommentsEntryPointHeader extends YTNode { } if (Reflect.has(data, 'contentRenderer')) { - this.content_renderer = Parser.parseItem(data.contentRenderer, CommentsEntryPointTeaser); + this.content_renderer = Parser.parseItem(data.contentRenderer, [ CommentsEntryPointTeaser, CommentsSimplebox ]); } if (Reflect.has(data, 'simpleboxPlaceholder')) { diff --git a/src/parser/classes/comments/CommentsSimplebox.ts b/src/parser/classes/comments/CommentsSimplebox.ts new file mode 100644 index 000000000..c151d5e83 --- /dev/null +++ b/src/parser/classes/comments/CommentsSimplebox.ts @@ -0,0 +1,17 @@ +import { YTNode } from '../../helpers.js'; +import Text from '../misc/Text.js'; +import Thumbnail from '../misc/Thumbnail.js'; +import type { RawNode } from '../../index.js'; + +export default class CommentsSimplebox extends YTNode { + static type = 'CommentsSimplebox'; + + simplebox_avatar: Thumbnail[]; + simplebox_placeholder: Text; + + constructor(data: RawNode) { + super(); + this.simplebox_avatar = Thumbnail.fromResponse(data.simpleboxAvatar); + this.simplebox_placeholder = new Text(data.simpleboxPlaceholder); + } +} \ No newline at end of file diff --git a/src/parser/nodes.ts b/src/parser/nodes.ts index 2e3619256..1471e53ce 100644 --- a/src/parser/nodes.ts +++ b/src/parser/nodes.ts @@ -58,6 +58,7 @@ export { default as CommentsEntryPointHeader } from './classes/comments/Comments export { default as CommentsEntryPointTeaser } from './classes/comments/CommentsEntryPointTeaser.js'; export { default as CommentsHeader } from './classes/comments/CommentsHeader.js'; export { default as CommentSimplebox } from './classes/comments/CommentSimplebox.js'; +export { default as CommentsSimplebox } from './classes/comments/CommentsSimplebox.js'; export { default as CommentThread } from './classes/comments/CommentThread.js'; export { default as CreatorHeart } from './classes/comments/CreatorHeart.js'; export { default as EmojiPicker } from './classes/comments/EmojiPicker.js';