Skip to content

Commit

Permalink
feat(CommentView): Parse some extra tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
LuanRT committed Jan 21, 2025
1 parent 0802cb8 commit 32125c7
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/parser/classes/comments/CommentView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,18 @@ export default class CommentView extends YTNode {
public content?: Text;
public published_time?: string;
public author_is_channel_owner?: boolean;
public creator_thumbnail_url?: string;
public like_button_a11y?: string;
public like_count?: string;
public like_count_liked?: string;
public like_count_a11y?: string;
public like_active_tooltip?: string;
public like_inactive_tooltip?: string;
public dislike_active_tooltip?: string;
public dislike_inactive_tooltip?: string;
public heart_active_tooltip?: string;
public reply_count?: string;
public reply_count_a11y?: string;
public is_member?: boolean;
public member_badge?: MemberBadge;
public author?: Author;
Expand Down Expand Up @@ -72,8 +82,18 @@ export default class CommentView extends YTNode {
this.content = Text.fromAttributed(comment.properties.content);
this.published_time = comment.properties.publishedTime;
this.author_is_channel_owner = !!comment.author.isCreator;

this.creator_thumbnail_url = comment.toolbar.creatorThumbnailUrl;

this.like_count = comment.toolbar.likeCountNotliked ? comment.toolbar.likeCountNotliked : '0';
this.like_count_liked = comment.toolbar.likeCountLiked ? comment.toolbar.likeCountLiked : '0';
this.like_count_a11y = comment.toolbar.likeCountA11y;
this.like_active_tooltip = comment.toolbar.likeActiveTooltip;
this.like_inactive_tooltip = comment.toolbar.likeInactiveTooltip;
this.dislike_active_tooltip = comment.toolbar.dislikeActiveTooltip;
this.dislike_inactive_tooltip = comment.toolbar.dislikeInactiveTooltip;
this.like_button_a11y = comment.toolbar.likeButtonA11y;
this.heart_active_tooltip = comment.toolbar.heartActiveTooltip;
this.reply_count_a11y = comment.toolbar.replyCountA11y;
this.reply_count = comment.toolbar.replyCount ? comment.toolbar.replyCount : '0';

this.is_member = !!comment.author.sponsorBadgeUrl;
Expand Down

0 comments on commit 32125c7

Please sign in to comment.