From 6ecbbd2b6a2a01d93c7016c6c4433284e9a35e18 Mon Sep 17 00:00:00 2001 From: sergiobuilds Date: Wed, 12 Aug 2026 01:16:17 +0900 Subject: [PATCH] Fix missing channel links for multi-creator related videos --- src/invidious/videos/parser.cr | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/invidious/videos/parser.cr b/src/invidious/videos/parser.cr index 8367fcd7..2f2f4273 100644 --- a/src/invidious/videos/parser.cr +++ b/src/invidious/videos/parser.cr @@ -19,14 +19,22 @@ module Invidious::Videos::Parser decode_length_seconds(box.as_s).to_s end - # Both have "short", so the "long" option shouldn't be required - channel_info = (related["shortBylineText"]? || related["longBylineText"]?) - .try &.dig?("runs", 0) + byline = related["shortBylineText"]? || related["longBylineText"]? - author = channel_info.try &.dig?("text") + author = extract_text(byline) author_verified = has_verified_badge?(related["ownerBadges"]?).to_s - ucid = channel_info.try { |ci| HelperExtractors.get_browse_id(ci) } + ucid = nil + runs = byline.try &.dig?("runs") + if runs && runs.as_a? + runs.as_a.each do |run| + id = HelperExtractors.get_browse_id(run) + if id && !id.to_s.empty? + ucid = id + break + end + end + end short_view_count = related.try do |r| HelperExtractors.get_short_view_count(r).to_s