mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Fix for videos that don't have 'captionTracks'
This commit is contained in:
parent
d2d5de55c1
commit
baf4e7984b
1 changed files with 2 additions and 1 deletions
|
@ -167,7 +167,8 @@ class Video
|
|||
|
||||
captions = [] of Caption
|
||||
if player_response["captions"]?
|
||||
caption_list = player_response["captions"]["playerCaptionsTracklistRenderer"]["captionTracks"].as_a
|
||||
caption_list = player_response["captions"]["playerCaptionsTracklistRenderer"]["captionTracks"]?.try &.as_a
|
||||
caption_list ||= [] of JSON::Any
|
||||
|
||||
caption_list.each do |caption|
|
||||
caption = Caption.from_json(caption.to_json)
|
||||
|
|
Loading…
Reference in a new issue