diff --git a/src/invidious/comments.cr b/src/invidious/comments.cr index e6d74d1da..0bad5b2eb 100644 --- a/src/invidious/comments.cr +++ b/src/invidious/comments.cr @@ -158,7 +158,7 @@ def fetch_youtube_comments(id, continuation, proxies, format, locale) comment_count = body["header"]["commentsHeaderRenderer"]["countText"]["simpleText"].as_s.delete("Comments,").to_i json.field "commentCount", comment_count end - + json.field "videoId", id json.field "comments" do @@ -213,7 +213,7 @@ def fetch_youtube_comments(id, continuation, proxies, format, locale) published_text = node_comment["publishedTimeText"]["runs"][0]["text"].as_s published = decode_date(published_text.rchop(" (edited)")) - + if published_text.includes?(" (edited)") json.field "isEdited", true else @@ -227,7 +227,7 @@ def fetch_youtube_comments(id, continuation, proxies, format, locale) json.field "likeCount", node_comment["likeCount"] json.field "commentId", node_comment["commentId"] json.field "authorIsChannelOwner", node_comment["authorIsChannelOwner"] - + if node_comment["actionButtons"]["commentActionButtonsRenderer"]["creatorHeart"]? hearth_data = node_comment["actionButtons"]["commentActionButtonsRenderer"]["creatorHeart"]["creatorHeartRenderer"]["creatorThumbnail"] json.field "creatorHeart" do @@ -349,18 +349,19 @@ def template_youtube_comments(comments, locale) #{child["author"]}

#{child["contentHtml"]}

- #{translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64)))} #{child["isEdited"] == true ? translate(locale, "(edited)") : ""} + #{translate(locale, "`x` ago", recode_date(Time.unix(child["published"].as_i64)))} #{child["isEdited"] == true ? translate(locale, "(edited)") : ""} | [YT] | #{number_with_separator(child["likeCount"])} END_HTML - + if child["creatorHeart"]? + creator_thumbnail = "/ggpht#{URI.parse(child["creatorHeart"]["creatorThumbnail"].as_s).full_path}" html += <<-END_HTML
- +
🖤
@@ -368,7 +369,7 @@ def template_youtube_comments(comments, locale) END_HTML end - + html += <<-END_HTML

#{replies_html}