From 13a8e9d425d645d154d71def350883095e354f2d Mon Sep 17 00:00:00 2001 From: Emilien Devos <4016501+unixfox@users.noreply.github.com> Date: Thu, 15 Aug 2024 18:53:46 +0200 Subject: [PATCH] change accept header globally - set it the same as youtube --- src/invidious/yt_backend/connection_pool.cr | 2 +- src/invidious/yt_backend/youtube_api.cr | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/invidious/yt_backend/connection_pool.cr b/src/invidious/yt_backend/connection_pool.cr index 0ac785e6..268eea94 100644 --- a/src/invidious/yt_backend/connection_pool.cr +++ b/src/invidious/yt_backend/connection_pool.cr @@ -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 diff --git a/src/invidious/yt_backend/youtube_api.cr b/src/invidious/yt_backend/youtube_api.cr index 67df393e..7b47a9bb 100644 --- a/src/invidious/yt_backend/youtube_api.cr +++ b/src/invidious/yt_backend/youtube_api.cr @@ -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