From 864af0274a41dfa1dbff6631bb3b2dc5ad9a6887 Mon Sep 17 00:00:00 2001 From: csjad Date: Sat, 19 Sep 2026 11:30:31 +0800 Subject: [PATCH] Video parser: scan every byline run for the channel id Multi-creator (collab) videos split the byline into several runs and the channel link is not always attached to the first one. parse_related_video only inspected runs[0], so ucid ended up empty and the related-video card was rendered without an author hyperlink. Scan every byline run for a browse id; behaviour for videos whose first run already carries the link is unchanged. Fixes #5722 --- src/invidious/videos/parser.cr | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index 8367fcd78..5511f53be 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -28,6 +28,15 @@ module Invidious::Videos::Parser ucid = channel_info.try { |ci| HelperExtractors.get_browse_id(ci) } + # Multi-creator ("collab") videos split the byline into several runs and + # the channel link isn't always attached to the first one, which left + # ucid empty and the related-video card without an author hyperlink (#5722). + # Scan every byline run for a browse id instead of only the first one. + if ucid.try(&.empty?) && (byline_runs = (related["shortBylineText"]? || related["longBylineText"]?) + .try &.dig?("runs").try &.as_a) + ucid = byline_runs.map { |run| HelperExtractors.get_browse_id(run) }.find { |id| !id.empty? } + end + short_view_count = related.try do |r| HelperExtractors.get_short_view_count(r).to_s end