pull/5247/merge
Theo Luis Fischer 2025-10-17 18:08:37 +02:00 zatwierdzone przez GitHub
commit 724d7895d3
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -9,10 +9,13 @@ module Invidious::Routes::ErrorRoutes
item = md["id"]
# Check if item is branding URL e.g. https://youtube.com/gaming
response = YT_POOL.client &.get("/#{item}")
# Cookie to prevent redirects to the cookie consent page.
# Cookie values: CAE = Reject all, CAA = show the cookie banner, CAI = Accept all
headers = HTTP::Headers{"Cookie" => "SOCS=CAE"}
response = YT_POOL.client &.get("/#{item}", headers: headers)
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
if response.body.empty?