Merge 4d1f10a30d531531611154ff9f95f05859e30503 into 1ae0f45b0e5dca696986925a06ef4f4b4f43894b

This commit is contained in:
Theo Luis Fischer 2025-08-17 10:01:39 +00:00 committed by GitHub
commit ddbe4b7084
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,10 +9,12 @@ module Invidious::Routes::ErrorRoutes
item = md["id"] item = md["id"]
# Check if item is branding URL e.g. https://youtube.com/gaming # Check if item is branding URL e.g. https://youtube.com/gaming
response = YT_POOL.client &.get("/#{item}") headers = HTTP::Headers{
"Cookie" => "SOCS=CAE" # Cookies to prevent redirects to Cookie Consent Page CAE~Reject all, CAA~showing the cookie banner, CAI~Accept all
}
response = YT_POOL.client &.get("/#{item}", headers: headers)
if response.status_code == 301 if response.status_code == 301
response = YT_POOL.client &.get(URI.parse(response.headers["Location"]).request_target) response = YT_POOL.client &.get(URI.parse(response.headers["Location"]).request_target, headers: headers)
end end
if response.body.empty? if response.body.empty?