make_client: add YouTube headers on *.youtube.com
This commit is contained in:
parent
82bd79bb0f
commit
6078232bbe
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue