|
|
@ -14,8 +14,9 @@ def add_yt_headers(request)
|
|
|
|
request.headers["Accept-Charset"] ||= "ISO-8859-1,utf-8;q=0.7,*;q=0.7"
|
|
|
|
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"] ||= "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
|
|
|
|
request.headers["Accept-Language"] ||= "en-us,en;q=0.5"
|
|
|
|
request.headers["Accept-Language"] ||= "en-us,en;q=0.5"
|
|
|
|
|
|
|
|
|
|
|
|
# Preserve original cookies and add new YT consent cookie for EU servers
|
|
|
|
# Preserve original cookies and add new YT consent cookie for EU servers
|
|
|
|
request.headers["Cookie"] = "#{request.headers["cookie"]?}; CONSENT=YES+"
|
|
|
|
request.headers["Cookie"] = "#{request.headers["cookie"]?}; CONSENT=PENDING+#{Random.rand(100..999)}"
|
|
|
|
if !CONFIG.cookies.empty?
|
|
|
|
if !CONFIG.cookies.empty?
|
|
|
|
request.headers["Cookie"] = "#{(CONFIG.cookies.map { |c| "#{c.name}=#{c.value}" }).join("; ")}; #{request.headers["cookie"]?}"
|
|
|
|
request.headers["Cookie"] = "#{(CONFIG.cookies.map { |c| "#{c.name}=#{c.value}" }).join("; ")}; #{request.headers["cookie"]?}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|