Fix redirect for livestreams
This commit is contained in:
parent
8c858a5953
commit
2a04a48b89
|
@ -489,7 +489,7 @@ get "/watch" do |env|
|
|||
|
||||
# Older videos may not have audio sources available.
|
||||
# We redirect here so they're not unplayable
|
||||
if audio_streams.empty?
|
||||
if audio_streams.empty? && !video.live_now
|
||||
if params.quality == "dash"
|
||||
env.params.query.delete_all("quality")
|
||||
env.params.query["quality"] = "medium"
|
||||
|
@ -729,14 +729,14 @@ get "/embed/:id" do |env|
|
|||
video_streams = video.video_streams(adaptive_fmts)
|
||||
audio_streams = video.audio_streams(adaptive_fmts)
|
||||
|
||||
if audio_streams.empty?
|
||||
if audio_streams.empty? && !video.live_now
|
||||
if params.quality == "dash"
|
||||
env.params.query.delete_all("quality")
|
||||
next env.redirect "/embed/#{video_id}?#{env.params.query}"
|
||||
next env.redirect "/embed/#{id}?#{env.params.query}"
|
||||
elsif params.listen
|
||||
env.params.query.delete_all("listen")
|
||||
env.params.query["listen"] = "0"
|
||||
next env.redirect "/embed/#{video_id}?#{env.params.query}"
|
||||
next env.redirect "/embed/#{id}?#{env.params.query}"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue