proxify HLS by its host header
All checks were successful
Invidious CI / build (push) Successful in 5m0s

This commit is contained in:
Fijxu 2024-12-15 18:52:04 -03:00
parent b1278a4853
commit 336b590ea2
Signed by: Fijxu
GPG key ID: 32C1DDF333EDA6A4

View file

@ -224,7 +224,7 @@ module Invidious::Routes::API::Manifest
if !proxy.empty?
"#{proxy}/videoplayback?#{raw_params}"
else
"#{HOST_URL}/videoplayback?#{raw_params}"
"#{env.request.headers["Host"]}/videoplayback?#{raw_params}"
end
end
end
@ -248,7 +248,7 @@ module Invidious::Routes::API::Manifest
manifest = response.body
if local
manifest = manifest.gsub("https://www.youtube.com", HOST_URL)
manifest = manifest.gsub("https://www.youtube.com", env.request.headers["Host"])
manifest = manifest.gsub("index.m3u8", "index.m3u8?local=true")
end