mirror of
https://github.com/iv-org/invidious.git
synced 2026-08-16 21:10:53 -05:00
Merge 873acd3ff18e17e77eb1e6133f9b686812766e49 into d10f2a48021f1768f2d6ff3bd1b9f3de4e0b2d22
This commit is contained in:
commit
a1925b4bdc
@ -156,6 +156,22 @@ private module Parsers
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# A livestream no longer necessarily carries a "LIVE" entry in `badges`.
|
||||||
|
# On the trending feed — which is the livestreams feed since YouTube
|
||||||
|
# removed the aggregated trending page — `badges` is absent altogether and
|
||||||
|
# the only marker is the thumbnail's time-status overlay, which carries
|
||||||
|
# `{"style": "LIVE", "text": {"simpleText": "LIVE"}}` in place of a duration.
|
||||||
|
#
|
||||||
|
# Without this, every item on that feed is serialised as
|
||||||
|
# `liveNow: false`, directly contradicting `/api/v1/videos` for the same
|
||||||
|
# video id. (`length_seconds` needs no equivalent fix: the overlay text is
|
||||||
|
# "LIVE", which `decode_length_seconds` already reduces to 0 — correct for
|
||||||
|
# a stream with no fixed duration.)
|
||||||
|
is_live_overlay = item_contents["thumbnailOverlays"]?.try &.as_a.any? do |overlay|
|
||||||
|
overlay.dig?("thumbnailOverlayTimeStatusRenderer", "style").try &.as_s == "LIVE"
|
||||||
|
end
|
||||||
|
badges |= VideoBadges::LiveNow if is_live_overlay
|
||||||
|
|
||||||
SearchVideo.new({
|
SearchVideo.new({
|
||||||
title: title,
|
title: title,
|
||||||
id: video_id,
|
id: video_id,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user