mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Add fix for videos that don't have captions
This commit is contained in:
parent
0b0e56504a
commit
f4160f937c
1 changed files with 2 additions and 3 deletions
|
@ -353,10 +353,9 @@ get "/watch" do |env|
|
|||
|
||||
player_response = JSON.parse(video.info["player_response"])
|
||||
if player_response["captions"]?
|
||||
captions = player_response["captions"]["playerCaptionsTracklistRenderer"]["captionTracks"].as_a
|
||||
else
|
||||
captions = [] of JSON::Any
|
||||
captions = player_response["captions"]["playerCaptionsTracklistRenderer"]["captionTracks"]?.try &.as_a
|
||||
end
|
||||
captions ||= [] of JSON::Any
|
||||
|
||||
rvs = [] of Hash(String, String)
|
||||
if video.info.has_key?("rvs")
|
||||
|
|
Loading…
Reference in a new issue