mirror of
https://github.com/iv-org/invidious.git
synced 2024-11-09 15:02:14 +05:30
make_client: add YouTube headers on *.youtube.com
This commit is contained in:
parent
46c58bd84c
commit
6e39b9b303
@ -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
|
client.family = Socket::Family::INET if client.family == Socket::Family::UNSPEC
|
||||||
end
|
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.read_timeout = 10.seconds
|
||||||
client.connect_timeout = 10.seconds
|
client.connect_timeout = 10.seconds
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user