From 51dd4fefd0df3272da5232a530ee375944a8264f Mon Sep 17 00:00:00 2001 From: Fijxu Date: Sun, 2 Aug 2026 03:48:25 -0400 Subject: [PATCH] fix: fix comments html rendering (#5862) Now the structure no longer has an array of author thumbnails, is a single URL: ```json "author": { "channelId": "UCiLGHgWdQvfl1G8BPgcO55w", "displayName": "@uber_nerd-l7r", "avatarThumbnailUrl": "https://yt3.ggpht.com/ee1_iFgiBvgKHUr3r0_qUVqUpGKhDZaePYq8Q4tIsyVS9L1oRHHJLcHtXrSxyS63AmvldKicbw=s88-c-k-c0x00ffffff-no-rj", "isVerified": false, "isCurrentUser": false, "isCreator": false, ``` --- src/invidious/comments/youtube.cr | 12 +----------- src/invidious/frontend/comments_youtube.cr | 2 +- 2 files changed, 2 insertions(+), 12 deletions(-) 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