Skip to content

Commit

Permalink
make_client: add YouTube headers on *.youtube.com
Browse files Browse the repository at this point in the history
  • Loading branch information
syeopite committed Aug 25, 2024
1 parent 46c58bd commit 6e39b9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/invidious/yt_backend/connection_pool.cr
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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

Expand Down

0 comments on commit 6e39b9b

Please sign in to comment.