From 47b5d79ec7610517439e477d4a5768780ff186ed Mon Sep 17 00:00:00 2001 From: Fijxu Date: Sun, 2 Aug 2026 21:09:15 -0400 Subject: [PATCH] fix: also fix comments community posts. (#5874) Community posts comments still preserve the old author thumbnails format that has an Array of thumbnails. I forgot to check that as I had no idea `comments_youtube.cr` was also used for community posts comments ```json "authorThumbnail": { "thumbnails": [ { "url": "//yt3.googleusercontent.com/ytc/AIdro_m9CJFVl3bEWvGnNnN4G9ErBO2lTpKePWCjx_FQtLWaDww=s32-c-k-c0x00ffffff-no-rj-mo", "width": 32, "height": 32 }, { "url": "//yt3.googleusercontent.com/ytc/AIdro_m9CJFVl3bEWvGnNnN4G9ErBO2lTpKePWCjx_FQtLWaDww=s48-c-k-c0x00ffffff-no-rj-mo", "width": 48, "height": 48 }, { "url": "//yt3.googleusercontent.com/ytc/AIdro_m9CJFVl3bEWvGnNnN4G9ErBO2lTpKePWCjx_FQtLWaDww=s76-c-k-c0x00ffffff-no-rj-mo", "width": 76, "height": 76 } ], "accessibility": { "accessibilityData": { "label": "SomeOrdinaryGamers" } } }, ``` --- src/invidious/frontend/comments_youtube.cr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/invidious/frontend/comments_youtube.cr b/src/invidious/frontend/comments_youtube.cr index 8d16976a..809f0789 100644 --- a/src/invidious/frontend/comments_youtube.cr +++ b/src/invidious/frontend/comments_youtube.cr @@ -44,7 +44,11 @@ module Invidious::Frontend::Comments end if !thin_mode - author_thumbnail = "/ggpht#{URI.parse(child["authorThumbnail"].as_s).request_target}" + if child_author_thumbnail = child["authorThumbnail"]?.try &.as_s + author_thumbnail = "/ggpht#{URI.parse(child_author_thumbnail).request_target}" + else + author_thumbnail = "/ggpht#{URI.parse(child["authorThumbnails"][-1]["url"].as_s).request_target}" + end else author_thumbnail = "" end