From 1cdf701c8403db6b681a26ecb1df2daa51add454 Mon Sep 17 00:00:00 2001 From: LuanRT Date: Thu, 16 Feb 2023 07:07:34 -0300 Subject: [PATCH] feat(parser): add `ChannelAgeGate` node --- src/parser/classes/ChannelAgeGate.ts | 30 ++++++++++++++++++++++++++++ src/parser/map.ts | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 src/parser/classes/ChannelAgeGate.ts diff --git a/src/parser/classes/ChannelAgeGate.ts b/src/parser/classes/ChannelAgeGate.ts new file mode 100644 index 000000000..9cf0a558e --- /dev/null +++ b/src/parser/classes/ChannelAgeGate.ts @@ -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