Skip to content

Commit

Permalink
feat(parser): Add HashtagTile (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChunkyProgrammer committed Jul 16, 2023
1 parent 8c688ef commit ae2557d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/parser/classes/HashtagTile.ts
Original file line number Diff line number Diff line change
@@ -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);
}
}
1 change: 1 addition & 0 deletions src/parser/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit ae2557d

Please sign in to comment.