mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-27 18:40:21 +05:30
crystal handle decompression already by itself
This commit is contained in:
parent
b51770dbdb
commit
bb2e3b2a3e
@ -251,16 +251,16 @@ class Config
|
||||
end
|
||||
{% end %}
|
||||
|
||||
if !CONFIG.invidious_companion.empty?
|
||||
if !config.invidious_companion.empty?
|
||||
# invidious_companion and signature_server can't work together
|
||||
if CONFIG.signature_server
|
||||
if config.signature_server
|
||||
puts "Config: You can not run inv_sig_helper and invidious_companion at the same time."
|
||||
exit(1)
|
||||
end
|
||||
if CONFIG.invidious_companion_key.empty?
|
||||
if config.invidious_companion_key.empty?
|
||||
puts "Config: Please configure a key if you are using invidious companion."
|
||||
exit(1)
|
||||
elsif CONFIG.invidious_companion_key == "CHANGE_ME!!"
|
||||
elsif config.invidious_companion_key == "CHANGE_ME!!"
|
||||
puts "Config: The value of 'invidious_companion_key' needs to be changed!!"
|
||||
exit(1)
|
||||
end
|
||||
|
@ -685,7 +685,6 @@ module YoutubeAPI
|
||||
) : Hash(String, JSON::Any)
|
||||
headers = HTTP::Headers{
|
||||
"Content-Type" => "application/json; charset=UTF-8",
|
||||
"Accept-Encoding" => "gzip",
|
||||
"Authorization" => "Bearer " + CONFIG.invidious_companion_key,
|
||||
}
|
||||
|
||||
@ -698,7 +697,7 @@ module YoutubeAPI
|
||||
begin
|
||||
response = make_client(CONFIG.invidious_companion.sample,
|
||||
&.post(endpoint, headers: headers, body: data.to_json))
|
||||
body = self._decompress(response.body_io, response.headers["Content-Encoding"]?)
|
||||
body = response.body
|
||||
if (response.status_code != 200)
|
||||
raise Exception.new("Error while communicating with Invidious companion: \
|
||||
status code: " + response.status_code.to_s + " and body: " + body)
|
||||
|
Loading…
Reference in New Issue
Block a user