mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-30 02:32:56 +05:30
Add redirect for videos with no audio sources
This commit is contained in:
parent
716705aa15
commit
0cf86974dd
@ -419,6 +419,12 @@ get "/watch" do |env|
|
|||||||
video_streams = video.video_streams(adaptive_fmts)
|
video_streams = video.video_streams(adaptive_fmts)
|
||||||
audio_streams = video.audio_streams(adaptive_fmts)
|
audio_streams = video.audio_streams(adaptive_fmts)
|
||||||
|
|
||||||
|
# Older videos may not have audio sources available.
|
||||||
|
# We redirect here so they're not unplayable
|
||||||
|
if params.listen && audio_streams.empty?
|
||||||
|
next env.redirect "/watch?#{env.params.query}&listen=0"
|
||||||
|
end
|
||||||
|
|
||||||
captions = video.captions
|
captions = video.captions
|
||||||
|
|
||||||
preferred_captions = captions.select { |caption|
|
preferred_captions = captions.select { |caption|
|
||||||
|
Loading…
Reference in New Issue
Block a user