mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-26 08:42:08 +05:30
invidious companion always used so always add CSP and redirect latest_version
This commit is contained in:
parent
1f51edd0b9
commit
7a070fa710
@ -201,7 +201,7 @@ module Invidious::Routes::Embed
|
||||
return env.redirect url
|
||||
end
|
||||
|
||||
if (!CONFIG.invidious_companion.empty? && (preferences.local || preferences.quality == "dash"))
|
||||
if (!CONFIG.invidious_companion.empty?)
|
||||
env.response.headers["Content-Security-Policy"] =
|
||||
env.response.headers["Content-Security-Policy"]
|
||||
.gsub("media-src", "media-src " + video.invidious_companion.not_nil!["baseUrl"].as_s)
|
||||
|
@ -190,7 +190,7 @@ module Invidious::Routes::Watch
|
||||
captions: video.captions
|
||||
)
|
||||
|
||||
if (!CONFIG.invidious_companion.empty? && (preferences.local || preferences.quality == "dash"))
|
||||
if (!CONFIG.invidious_companion.empty?)
|
||||
env.response.headers["Content-Security-Policy"] =
|
||||
env.response.headers["Content-Security-Policy"]
|
||||
.gsub("media-src", "media-src " + video.invidious_companion.not_nil!["baseUrl"].as_s)
|
||||
|
@ -22,7 +22,7 @@
|
||||
audio_streams.each_with_index do |fmt, i|
|
||||
src_url = "/latest_version?id=#{video.id}&itag=#{fmt["itag"]}"
|
||||
src_url += "&local=true" if params.local
|
||||
src_url = video.invidious_companion.not_nil!["baseUrl"].as_s + src_url if (!CONFIG.invidious_companion.empty? && params.local)
|
||||
src_url = video.invidious_companion.not_nil!["baseUrl"].as_s + src_url if (!CONFIG.invidious_companion.empty?)
|
||||
|
||||
bitrate = fmt["bitrate"]
|
||||
mimetype = HTML.escape(fmt["mimeType"].as_s)
|
||||
@ -48,7 +48,7 @@
|
||||
fmt_stream.each_with_index do |fmt, i|
|
||||
src_url = "/latest_version?id=#{video.id}&itag=#{fmt["itag"]}"
|
||||
src_url += "&local=true" if params.local
|
||||
src_url = video.invidious_companion.not_nil!["baseUrl"].as_s + src_url if (!CONFIG.invidious_companion.empty? && params.local)
|
||||
src_url = video.invidious_companion.not_nil!["baseUrl"].as_s + src_url if (!CONFIG.invidious_companion.empty?)
|
||||
|
||||
quality = fmt["quality"]
|
||||
mimetype = HTML.escape(fmt["mimeType"].as_s)
|
||||
|
Loading…
Reference in New Issue
Block a user