change accept header globally - set it the same as youtube

This commit is contained in:
Emilien Devos 2024-08-15 18:53:46 +02:00
parent ddd232a3a5
commit 13a8e9d425
2 changed files with 1 additions and 3 deletions

View File

@ -3,7 +3,7 @@ def add_yt_headers(request)
request.headers["User-Agent"] ||= "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
request.headers["Accept-Charset"] ||= "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
request.headers["Accept"] ||= "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
request.headers["Accept"] ||= "*"
request.headers["Accept-Language"] ||= "en-us,en;q=0.5"
# Preserve original cookies and add new YT consent cookie for EU servers

View File

@ -665,8 +665,6 @@ module YoutubeAPI
"x-goog-api-format-version" => "2",
"x-youtube-client-name" => client_config.name_proto,
"x-youtube-client-version" => client_config.version,
"accept" => "*",
"accept-language" => "*",
}
if user_agent = client_config.user_agent