mirror of
https://github.com/iv-org/invidious.git
synced 2025-06-28 09:38:31 +00:00
parser: Add fallbacks for author and ucid detection.
This commit is contained in:
parent
30b593864b
commit
ed2827b25f
@ -446,6 +446,9 @@ def parse_video_info(video_id : String, player_response : Hash(String, JSON::Any
|
|||||||
subs_text = author_info["subscriberCountText"]?
|
subs_text = author_info["subscriberCountText"]?
|
||||||
.try { |t| t["simpleText"]? || t.dig?("runs", 0, "text") }
|
.try { |t| t["simpleText"]? || t.dig?("runs", 0, "text") }
|
||||||
.try &.as_s.split(" ", 2)[0]
|
.try &.as_s.split(" ", 2)[0]
|
||||||
|
|
||||||
|
author ||= author_info.dig?("title", "runs", 0, "text").try &.as_s
|
||||||
|
ucid ||= author_info.dig?("title", "runs", 0, "navigationEndpoint", "browseEndpoint", "browseId").try &.as_s
|
||||||
end
|
end
|
||||||
|
|
||||||
# Return data
|
# Return data
|
||||||
|
Loading…
Reference in New Issue
Block a user