From 6078232bbe69c7e07ed4094162078d04539b65ab Mon Sep 17 00:00:00 2001 From: syeopite Date: Sat, 24 Aug 2024 19:41:39 -0700 Subject: [PATCH] make_client: add YouTube headers on *.youtube.com --- src/invidious/yt_backend/connection_pool.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/invidious/yt_backend/connection_pool.cr b/src/invidious/yt_backend/connection_pool.cr index 18ce2d38..dc5e4936 100644 --- a/src/invidious/yt_backend/connection_pool.cr +++ b/src/invidious/yt_backend/connection_pool.cr @@ -47,7 +47,7 @@ def make_client(url : URI, region = nil, force_resolve : Bool = false, force_you client.family = Socket::Family::INET if client.family == Socket::Family::UNSPEC end - client.before_request { |r| add_yt_headers(r) } if url.host == "www.youtube.com" || force_youtube_headers + client.before_request { |r| add_yt_headers(r) } if url.host.try &.ends_with?("youtube.com") || force_youtube_headers client.read_timeout = 10.seconds client.connect_timeout = 10.seconds