mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Preserve original cookies
This commit is contained in:
parent
c4c2e01213
commit
20b961c1c8
1 changed files with 2 additions and 1 deletions
|
@ -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…
Reference in a new issue