mirror of
https://github.com/iv-org/invidious.git
synced 2026-10-25 22:39:14 -05:00
chore: Update headers sent to innertube in JSON requests
This commit is contained in:
parent
34173a3d84
commit
2c7533c370
@ -580,10 +580,18 @@ module YoutubeAPI
|
|||||||
# Query parameters
|
# Query parameters
|
||||||
url = "#{endpoint}?prettyPrint=false"
|
url = "#{endpoint}?prettyPrint=false"
|
||||||
|
|
||||||
|
# true if logged in into a Google account on Youtube, therefore
|
||||||
|
# we set it to true if the instance has cookies enabled.
|
||||||
|
logged_in = if !CONFIG.cookies.empty?
|
||||||
|
true
|
||||||
|
else
|
||||||
|
false
|
||||||
|
end
|
||||||
|
|
||||||
headers = HTTP::Headers{
|
headers = HTTP::Headers{
|
||||||
"Content-Type" => "application/json; charset=UTF-8",
|
"Content-Type" => "application/json",
|
||||||
"Accept-Encoding" => "gzip, deflate",
|
"Accept-Encoding" => "gzip, deflate",
|
||||||
"x-goog-api-format-version" => "2",
|
"x-youtube-bootstrap-logged-in" => logged_in,
|
||||||
"x-youtube-client-name" => client_config.name_proto,
|
"x-youtube-client-name" => client_config.name_proto,
|
||||||
"x-youtube-client-version" => client_config.version,
|
"x-youtube-client-version" => client_config.version,
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user