diff --git a/src/parser/classes/HashtagTile.ts b/src/parser/classes/HashtagTile.ts new file mode 100644 index 00000000..a6ff207c --- /dev/null +++ b/src/parser/classes/HashtagTile.ts @@ -0,0 +1,28 @@ +import { YTNode } from '../helpers.js'; +import type { RawNode } from '../index.js'; +import { Thumbnail } from '../misc.js'; +import NavigationEndpoint from './NavigationEndpoint.js'; +import Text from './misc/Text.js'; + +export default class HashtagTile extends YTNode { + static type = 'HashtagTile'; + + hashtag: Text; + hashtag_info_text: Text; + hashtag_thumbnail: Thumbnail[]; + endpoint: NavigationEndpoint; + hashtag_background_color: number; + hashtag_video_count: Text; + hashtag_channel_count: Text; + + constructor(data: RawNode) { + super(); + this.hashtag = new Text(data.hashtag); + this.hashtag_info_text = new Text(data.hashtagInfoText); + this.hashtag_thumbnail = Thumbnail.fromResponse(data.hashtagThumbnail); + this.endpoint = new NavigationEndpoint(data.onTapCommand); + this.hashtag_background_color = data.hashtagBackgroundColor; + this.hashtag_video_count = new Text(data.hashtagVideoCount); + this.hashtag_channel_count = new Text(data.hashtagChannelCount); + } +} \ No newline at end of file diff --git a/src/parser/nodes.ts b/src/parser/nodes.ts index d13c67f2..2e361925 100644 --- a/src/parser/nodes.ts +++ b/src/parser/nodes.ts @@ -115,6 +115,7 @@ export { default as GuideEntry } from './classes/GuideEntry.js'; export { default as GuideSection } from './classes/GuideSection.js'; export { default as GuideSubscriptionsSection } from './classes/GuideSubscriptionsSection.js'; export { default as HashtagHeader } from './classes/HashtagHeader.js'; +export { default as HashtagTile } from './classes/HashtagTile.js'; export { default as Heatmap } from './classes/Heatmap.js'; export { default as HeatMarker } from './classes/HeatMarker.js'; export { default as HeroPlaylistThumbnail } from './classes/HeroPlaylistThumbnail.js';