From e2c83e8fd7eac1d0ad94db1a57771c20972def7e Mon Sep 17 00:00:00 2001 From: Martin Kibera Date: Tue, 28 Jul 2026 18:58:54 +0300 Subject: [PATCH] Implement fallback for empty author_id Add logic to extract channel ID for collaboration videos with empty author ID. --- src/invidious/yt_backend/extractors.cr | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/invidious/yt_backend/extractors.cr b/src/invidious/yt_backend/extractors.cr index b2226e74d..352be511b 100644 --- a/src/invidious/yt_backend/extractors.cr +++ b/src/invidious/yt_backend/extractors.cr @@ -84,6 +84,15 @@ private module Parsers author_id = author_fallback.id end + # When ucid is still empty (e.g. collaboration videos with a composite + # channel name and no navigation endpoint), extract the first creator's + # channel ID from the channelThumbnailSupportedRenderers navigationEndpoint. + if author_id.empty? + if channel_id = item_contents.dig?("channelThumbnailSupportedRenderers", "channelThumbnailWithLinkRenderer", "navigationEndpoint", "browseEndpoint", "browseId").try &.as_s + author_id = channel_id + end + end + author_thumbnail = item_contents.dig?("channelThumbnailSupportedRenderers", "channelThumbnailWithLinkRenderer", "thumbnail", "thumbnails", 0, "url").try &.as_s author_verified = has_verified_badge?(item_contents["ownerBadges"]?)