Skip to content

Invidious is an alternative front-end to YouTube

fix: fix comments html rendering (#5862)

Fijxu51dd4fefd0df
diff --git a/src/invidious/comments/youtube.cr b/src/invidious/comments/youtube.cr
index 78a569ab..415c327c 100644
--- a/src/invidious/comments/youtube.cr
+++ b/src/invidious/comments/youtube.cr
@@ -155,17 +155,7 @@ module Invidious::Comments
json.field "authorUrl", "/channel/#{comment_author["channelId"].as_s}"
json.field "author", comment_author["displayName"].as_s
json.field "verified", comment_author["isVerified"].as_bool
- json.field "authorThumbnails" do
- json.array do
- comment_mutation.dig?("payload", "commentEntityPayload", "avatar", "image", "sources").try &.as_a.each do |thumbnail|
- json.object do
- json.field "url", thumbnail["url"]
- json.field "width", thumbnail["width"]
- json.field "height", thumbnail["height"]
- end
- end
- end
- end
+ json.field "authorThumbnail", comment_author["avatarThumbnailUrl"].as_s
json.field "authorIsChannelOwner", comment_author["isCreator"].as_bool
json.field "isSponsor", (comment_author["sponsorBadgeUrl"]? != nil)
diff --git a/src/invidious/frontend/comments_youtube.cr b/src/invidious/frontend/comments_youtube.cr
index 89d3caef..8d16976a 100644
--- a/src/invidious/frontend/comments_youtube.cr
+++ b/src/invidious/frontend/comments_youtube.cr
@@ -44,7 +44,7 @@ module Invidious::Frontend::Comments
end
if !thin_mode
- author_thumbnail = "/ggpht#{URI.parse(child["authorThumbnails"][-1]["url"].as_s).request_target}"
+ author_thumbnail = "/ggpht#{URI.parse(child["authorThumbnail"].as_s).request_target}"
else
author_thumbnail = ""
end