diff --git a/src/parser/classes/NavigationEndpoint.ts b/src/parser/classes/NavigationEndpoint.ts index cf51c3e7..05226c37 100644 --- a/src/parser/classes/NavigationEndpoint.ts +++ b/src/parser/classes/NavigationEndpoint.ts @@ -1,6 +1,6 @@ import type Actions from '../../core/Actions.js'; import type { ApiResponse } from '../../core/Actions.js'; -import { type SuperParsedResult, YTNode } from '../helpers.js'; +import { YTNode } from '../helpers.js'; import Parser, { type RawNode } from '../index.js'; import type { IParsedResponse } from '../types/ParsedResponse.js'; import CreatePlaylistDialog from './CreatePlaylistDialog.js'; @@ -9,7 +9,7 @@ export default class NavigationEndpoint extends YTNode { static type = 'NavigationEndpoint'; payload; - dialog?: CreatePlaylistDialog | SuperParsedResult | null; + dialog?: CreatePlaylistDialog | YTNode | null; metadata: { url?: string; @@ -32,8 +32,8 @@ export default class NavigationEndpoint extends YTNode { this.payload = name ? Reflect.get(data, name) : {}; - if (Reflect.has(this.payload, 'dialog')) { - this.dialog = Parser.parse(this.payload.dialog); + if (Reflect.has(this.payload, 'dialog') || Reflect.has(this.payload, 'content')) { + this.dialog = Parser.parseItem(this.payload.dialog || this.payload.content); } if (data?.serviceEndpoint) { diff --git a/src/parser/classes/comments/Comment.ts b/src/parser/classes/comments/Comment.ts index a24118d3..ab98fb07 100644 --- a/src/parser/classes/comments/Comment.ts +++ b/src/parser/classes/comments/Comment.ts @@ -13,7 +13,6 @@ import SponsorCommentBadge from './SponsorCommentBadge.js'; import Proto from '../../../proto/index.js'; import { InnertubeError } from '../../../utils/Utils.js'; -import type { SuperParsedResult} from '../../helpers.js'; import { YTNode } from '../../helpers.js'; import type Actions from '../../../core/Actions.js'; @@ -131,8 +130,8 @@ export default class Comment extends YTNode { if (!button.endpoint?.dialog) throw new InnertubeError('Reply button endpoint did not have a dialog.'); - const dialog = button.endpoint.dialog as SuperParsedResult; - const dialog_button = dialog.item().as(CommentReplyDialog).reply_button; + const dialog = button.endpoint.dialog.as(CommentReplyDialog); + const dialog_button = dialog.reply_button; if (!dialog_button) throw new InnertubeError('Reply button was not found in the dialog.', { comment_id: this.comment_id });