Add administrator option to disable proxying

This commit is contained in:
Omar Roth 2019-07-07 09:07:53 -05:00
parent 5fd3ed782f
commit 2cc25b1e6e
No known key found for this signature in database
GPG key ID: B8254FB7EC3D37F2
6 changed files with 46 additions and 9 deletions

View file

@ -4667,6 +4667,12 @@ get "/videoplayback" do |env|
end
if url.includes? "&file=seg.ts"
if CONFIG.disabled?("livestreams")
env.response.status_code = 403
error_message = "Administrator has disabled this endpoint."
next templated "error"
end
begin
client = make_client(URI.parse(host), region)
client.get(url, headers) do |response|
@ -4694,6 +4700,13 @@ get "/videoplayback" do |env|
rescue ex
end
else
if query_params["title"]? && CONFIG.disabled?("downloads") ||
CONFIG.disabled?("dash")
env.response.status_code = 403
error_message = "Administrator has disabled this endpoint."
next templated "error"
end
content_length = nil
first_chunk = true
range_start, range_end = parse_range(env.request.headers["Range"]?)