mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-21 13:31:36 +00:00
* tests: improve coverage * refactor: clean up nodes * chore: lint * feat(parser): ignore `BrandVideoShelf` Seems to be used for ads. * feat(parser): ignore `BrandVideoSingleton` too
20 lines
681 B
TypeScript
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 || '';
|
|
}
|
|
} |