Files
YouTube.js/src/parser/classes/PlaylistInfoCardContent.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

24 lines
772 B
TypeScript

import Text from './misc/Text.js';
import Thumbnail from './misc/Thumbnail.js';
import NavigationEndpoint from './NavigationEndpoint.js';
import { YTNode } from '../helpers.js';
import type { RawNode } from '../index.js';
export default class PlaylistInfoCardContent extends YTNode {
static type = 'PlaylistInfoCardContent';
title: Text;
thumbnails: Thumbnail[];
video_count: Text;
channel_name: Text;
endpoint: NavigationEndpoint;
constructor(data: RawNode) {
super();
this.title = new Text(data.playlistTitle);
this.thumbnails = Thumbnail.fromResponse(data.thumbnail);
this.video_count = new Text(data.playlistVideoCount);
this.channel_name = new Text(data.channelName);
this.endpoint = new NavigationEndpoint(data.action);
}
}