summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@protonmail.com>2019-10-20 12:48:11 -0400
committerOmar Roth <omarroth@protonmail.com>2019-10-20 12:48:55 -0400
commit2a04a48b891835ce3d68ff883c7b88a6b2e37508 (patch)
tree9fd6cd48c0c3b9fc28dcab84a3d9b6e30a792114
parent8c858a59532bb4c06b1ce9812ec03c0c4d335a81 (diff)
downloadinvidious-2a04a48b891835ce3d68ff883c7b88a6b2e37508.tar.gz
invidious-2a04a48b891835ce3d68ff883c7b88a6b2e37508.tar.bz2
invidious-2a04a48b891835ce3d68ff883c7b88a6b2e37508.zip
Fix redirect for livestreams
-rw-r--r--src/invidious.cr8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 8cb1cedf..215619af 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -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