diff --git a/src/parser/ytkids/Channel.ts b/src/parser/ytkids/Channel.ts index 290fd271..b3b1ecf8 100644 --- a/src/parser/ytkids/Channel.ts +++ b/src/parser/ytkids/Channel.ts @@ -2,6 +2,7 @@ import Feed from '../../core/mixins/Feed.js'; import C4TabbedHeader from '../classes/C4TabbedHeader.js'; import ItemSection from '../classes/ItemSection.js'; import { ItemSectionContinuation } from '../index.js'; +import NavigationEndpoint from '../classes/NavigationEndpoint.js'; import type { IBrowseResponse } from '../types/index.js'; import type { ApiResponse, Actions } from '../../core/index.js'; @@ -17,15 +18,22 @@ export default class Channel extends Feed { } /** - * Retrieves next batch of videos. + * Retrieves next batch of content. */ async getContinuation(): Promise { - const response = await this.actions.execute('/browse', { - continuation: this.contents?.continuation, - client: 'YTKIDS' + if (!this.contents) + throw new Error('No continuation available.'); + + const continuation_request = new NavigationEndpoint({ + continuationCommand: { + token: this.contents.continuation, + request: 'CONTINUATION_REQUEST_TYPE_BROWSE' + } }); + + const continuation_response = await continuation_request.call(this.actions, { client: 'YTKIDS' }); - return new Channel(this.actions, response); + return new Channel(this.actions, continuation_response); } get has_continuation(): boolean {