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

27 lines
828 B
TypeScript

import { YTNode } from '../helpers.js';
import type { RawNode } from '../index.js';
import { Parser } from '../index.js';
import Button from './Button.js';
import Text from './misc/Text.js';
import Thumbnail from './misc/Thumbnail.js';
export default class ChannelAgeGate extends YTNode {
static type = 'ChannelAgeGate';
channel_title: string;
avatar: Thumbnail[];
header: Text;
main_text: Text;
sign_in_button: Button | null;
secondary_text: Text;
constructor(data: RawNode) {
super();
this.channel_title = data.channelTitle;
this.avatar = Thumbnail.fromResponse(data.avatar);
this.header = new Text(data.header);
this.main_text = new Text(data.mainText);
this.sign_in_button = Parser.parseItem(data.signInButton, Button);
this.secondary_text = new Text(data.secondaryText);
}
}