Merge pull request #1973 from syeopite/fixcomments

Preserve all original cookies when adding the consent cookie.
pull/1980/head
TheFrenchGhosty 4 years ago committed by GitHub
commit cb378c1754
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,7 +9,8 @@ def add_yt_headers(request)
return if request.resource.starts_with? "/sorry/index" return if request.resource.starts_with? "/sorry/index"
request.headers["x-youtube-client-name"] ||= "1" request.headers["x-youtube-client-name"] ||= "1"
request.headers["x-youtube-client-version"] ||= "2.20200609" request.headers["x-youtube-client-version"] ||= "2.20200609"
request.headers["cookie"] = "CONSENT=YES+" # 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+"
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

Loading…
Cancel
Save