Files
YouTube.js/src/parser/classes/WatchNextEndScreen.ts
LuanRT 257bd475a0 refactor: clean up parser and tests (#387)
* tests: improve coverage

* refactor: clean up nodes

* chore: lint

* feat(parser): ignore `BrandVideoShelf`

Seems to be used for ads.

* feat(parser): ignore `BrandVideoSingleton` too
2023-04-23 06:37:33 -03:00

18 lines
620 B
TypeScript

import { YTNode, type ObservedArray } from '../helpers.js';
import Parser, { type RawNode } from '../index.js';
import EndScreenPlaylist from './EndScreenPlaylist.js';
import EndScreenVideo from './EndScreenVideo.js';
import Text from './misc/Text.js';
export default class WatchNextEndScreen extends YTNode {
static type = 'WatchNextEndScreen';
results: ObservedArray<EndScreenVideo | EndScreenPlaylist>;
title: string;
constructor(data: RawNode) {
super();
this.results = Parser.parseArray(data.results, [ EndScreenVideo, EndScreenPlaylist ]);
this.title = new Text(data.title).toString();
}
}