Continue scan past empty browseId in parse_related_video (#5722)

get_browse_id returns "" (not nil) when no browseId is present, so the
previous  stopped on the first empty run and
never reached a later creator that did carry a channel id.

Now skip empty ids and keep scanning until a non-empty browseId is
found (fixes the Greptile P1: first byline run empty, later run has id).
This commit is contained in:
wrvnnull 2026-08-17 05:30:36 +08:00
parent bfb7f6a309
commit cc5beb5630

View File

@ -32,11 +32,16 @@ module Invidious::Videos::Parser
ucid = byline.try do |b| ucid = byline.try do |b|
runs = b.dig?("runs") runs = b.dig?("runs")
next nil unless runs next nil unless runs
found_id = nil
runs.as_a.each do |run| runs.as_a.each do |run|
if id = HelperExtractors.get_browse_id(run) id = HelperExtractors.get_browse_id(run)
break id # get_browse_id returns "" (not nil) when no browseId is present, so an
end # empty first run must not stop the scan. Only keep a non-empty id.
next if id.empty?
found_id = id
break
end end
found_id
end end
author_verified = has_verified_badge?(related["ownerBadges"]?).to_s author_verified = has_verified_badge?(related["ownerBadges"]?).to_s