mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-06-19 12:31:17 +00:00
feat(parser): add ChannelAgeGate node
This commit is contained in:
30
src/parser/classes/ChannelAgeGate.ts
Normal file
30
src/parser/classes/ChannelAgeGate.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Parser } from '../index.js';
|
||||
import Button from './Button.js';
|
||||
import Text from './misc/Text.js';
|
||||
import Thumbnail from './misc/Thumbnail.js';
|
||||
|
||||
import { YTNode } from '../helpers.js';
|
||||
import type { RawNode } from '../index.js';
|
||||
|
||||
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<Button>(data.signInButton, Button);
|
||||
this.secondary_text = new Text(data.secondaryText);
|
||||
}
|
||||
}
|
||||
|
||||
export default ChannelAgeGate;
|
||||
Reference in New Issue
Block a user