diff --git a/src/invidious/routes/api/manifest.cr b/src/invidious/routes/api/manifest.cr index 834c76de..c353ea75 100644 --- a/src/invidious/routes/api/manifest.cr +++ b/src/invidious/routes/api/manifest.cr @@ -56,7 +56,7 @@ module Invidious::Routes::API::Manifest end audio_streams.reject! do |z| - z if z["audioTrack"]["audioIsDefault"].as_bool == false + z if z.dig?("audioTrack", "audioIsDefault") == false end manifest = XML.build(indent: " ", encoding: "UTF-8") do |xml| diff --git a/src/invidious/routes/watch.cr b/src/invidious/routes/watch.cr index 25f349a2..2d2050dd 100644 --- a/src/invidious/routes/watch.cr +++ b/src/invidious/routes/watch.cr @@ -153,11 +153,9 @@ module Invidious::Routes::Watch end audio_streams.reject! do |z| - z if z["audioTrack"]["audioIsDefault"].as_bool == false + z if z.dig?("audioTrack", "audioIsDefault") == false end - pp audio_streams - # Older videos may not have audio sources available. # We redirect here so they're not unplayable if audio_streams.empty? && !video.live_now