mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2026-01-24 07:41:38 +00:00
API: make /api/v1/videos respect the 'local' parameter
This commit is contained in:
@@ -91,14 +91,8 @@ module Invidious::Routes::VideoPlayback
|
||||
env.response.headers["Access-Control-Allow-Origin"] = "*"
|
||||
|
||||
if location = resp.headers["Location"]?
|
||||
location = URI.parse(location)
|
||||
location = "#{location.request_target}&host=#{location.host}"
|
||||
|
||||
if region
|
||||
location += "®ion=#{region}"
|
||||
end
|
||||
|
||||
return env.redirect location
|
||||
url = Invidious::HttpServer::Utils.proxy_video_url(location, region: region)
|
||||
return env.redirect url
|
||||
end
|
||||
|
||||
IO.copy(resp.body_io, env.response)
|
||||
|
||||
Reference in New Issue
Block a user