diff options
| author | Omar Roth <omarroth@hotmail.com> | 2018-07-22 11:41:08 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@hotmail.com> | 2018-07-22 11:41:08 -0500 |
| commit | f4160f937ca3b8ade6937864bb277d01cea21422 (patch) | |
| tree | 5491756d23d6c9ff71b6a979c39eb6dd34256e6b /src | |
| parent | 0b0e56504a11a9fbe4a2a38fe99cb687870fca1c (diff) | |
| download | invidious-f4160f937ca3b8ade6937864bb277d01cea21422.tar.gz invidious-f4160f937ca3b8ade6937864bb277d01cea21422.tar.bz2 invidious-f4160f937ca3b8ade6937864bb277d01cea21422.zip | |
Add fix for videos that don't have captions
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious.cr | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 5a0853f4..c4791976 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -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") |
