From 6e04e743be274151825619c1d58175b59c3b0aa5 Mon Sep 17 00:00:00 2001 From: Luvi-1 Date: Sun, 23 Aug 2026 21:39:18 -0700 Subject: [PATCH] Fix channel links for related videos with multiple creators For collaboration videos, the first byline run is a plain text summary without a navigation endpoint. This caused the author name to render without a link and ucid to be empty. Use the first run that has a valid browse endpoint instead of always taking runs[0]. Fixes #5722 --- src/invidious/videos/parser.cr | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index 8367fcd78..3fc5e34eb 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -20,8 +20,15 @@ module Invidious::Videos::Parser end # Both have "short", so the "long" option shouldn't be required - channel_info = (related["shortBylineText"]? || related["longBylineText"]?) - .try &.dig?("runs", 0) + # Use the first run that has a valid browse endpoint. + # For collaboration videos, the first run is a plain text summary + # without a link, while subsequent runs contain the channel links. + byline_runs = (related["shortBylineText"]? || related["longBylineText"]?) + .try &.dig?("runs").try &.as_a + + channel_info = byline_runs.try &.find do |run| + run.dig?("navigationEndpoint", "browseEndpoint", "browseId") + end || byline_runs.try &.[0]? author = channel_info.try &.dig?("text") author_verified = has_verified_badge?(related["ownerBadges"]?).to_s