mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2023-06-08.git
synced 2024-08-15 00:53:38 +00:00
Add YouTube-Client headers to HTTP requests
This commit is contained in:
parent
f5c7bbfda8
commit
dad885c051
1 changed files with 10 additions and 0 deletions
|
@ -86,6 +86,16 @@ class HTTPClient < HTTP::Client
|
|||
|
||||
return opts
|
||||
end
|
||||
|
||||
def exec(request)
|
||||
if self.host == "www.youtube.com"
|
||||
request.headers["x-youtube-client-name"] = "1"
|
||||
request.headers["x-youtube-client-version"] = "2.20180719"
|
||||
request.headers["user-agent"] = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36"
|
||||
end
|
||||
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
def get_proxies(country_code = "US")
|
||||
|
|
Loading…
Reference in a new issue