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

20 lines
681 B
TypeScript

import { YTNode } from '../helpers.js';
import Parser, { type RawNode } from '../index.js';
import NavigationEndpoint from './NavigationEndpoint.js';
export default class WatchCardHeroVideo extends YTNode {
static type = 'WatchCardHeroVideo';
endpoint: NavigationEndpoint;
call_to_action_button: YTNode;
hero_image: YTNode;
label: string;
constructor(data: RawNode) {
super();
this.endpoint = new NavigationEndpoint(data.navigationEndpoint);
this.call_to_action_button = Parser.parseItem(data.callToActionButton);
this.hero_image = Parser.parseItem(data.heroImage);
this.label = data.lengthText?.accessibility.accessibilityData.label || '';
}
}