Invidious is an alternative front-end to YouTube
Fix proxying live DASH streams (#4589)
absidue2c1400c41e32
diff --git a/src/invidious/routes/video_playback.cr b/src/invidious/routes/video_playback.crindex b1c788c2..083087a9 100644--- a/src/invidious/routes/video_playback.cr+++ b/src/invidious/routes/video_playback.cr@@ -21,7 +21,7 @@ module Invidious::Routes::VideoPlaybackend# Sanity check, to avoid being used as an open proxy- if !host.matches?(/[\w-]+.googlevideo.com/)+ if !host.matches?(/[\w-]+\.(?:googlevideo|c\.youtube)\.com/)return error_template(400, "Invalid \"host\" parameter.")end@@ -37,7 +37,8 @@ module Invidious::Routes::VideoPlayback# See: https://github.com/iv-org/invidious/issues/3302range_header = env.request.headers["Range"]?- if range_header.nil?+ sq = query_params["sq"]?+ if range_header.nil? && sq.nil?range_for_head = query_params["range"]? || "0-640"headers["Range"] = "bytes=#{range_for_head}"end