Vary user-agent

pull/850/head
Omar Roth 5 years ago
parent 6930570fa2
commit e05a25d701
No known key found for this signature in database
GPG Key ID: B8254FB7EC3D37F2

@ -95,7 +95,10 @@ class HTTPClient < HTTP::Client
if self.host == "www.youtube.com" if self.host == "www.youtube.com"
request.headers["x-youtube-client-name"] ||= "1" request.headers["x-youtube-client-name"] ||= "1"
request.headers["x-youtube-client-version"] ||= "1.20180719" request.headers["x-youtube-client-version"] ||= "1.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" request.headers["user-agent"] ||= random_user_agent
request.headers["accept-charset"] ||= "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
request.headers["accept"] ||= "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
request.headers["accept-language"] ||= "en-us,en;q=0.5"
end end
super super

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save