mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-12-29 02:51:25 +00:00
feat: Detect videoplayback proxy from invidious-companion and add it to the CSP header
This commit is contained in:
17
src/invidious/helpers/backend_info.cr
Normal file
17
src/invidious/helpers/backend_info.cr
Normal file
@@ -0,0 +1,17 @@
|
||||
module BackendInfo
|
||||
extend self
|
||||
@@exvpp_url : String = ""
|
||||
|
||||
def get_videoplayback_proxy
|
||||
begin
|
||||
response = HTTP::Client.get "#{CONFIG.invidious_companion.sample.private_url}/info"
|
||||
exvpp_url = JSON.parse(response.body)["external_videoplayback_proxy"].to_s
|
||||
@@exvpp_url = exvpp_url
|
||||
rescue
|
||||
end
|
||||
end
|
||||
|
||||
def get_exvpp
|
||||
return @@exvpp_url
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user