mirror of
https://github.com/iv-org/invidious.git
synced 2025-09-20 17:26:29 -05:00
Update src/invidious/routes/errors.cr
Co-authored-by: Samantaz Fox <coding@samantaz.fr>
This commit is contained in:
parent
4d1f10a30d
commit
b91fd7a491
@ -9,9 +9,10 @@ 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
|
||||||
headers = HTTP::Headers{
|
# Cookie to prevent redirects to the cookie consent page.
|
||||||
"Cookie" => "SOCS=CAE" # Cookies to prevent redirects to Cookie Consent Page CAE~Reject all, CAA~showing the cookie banner, CAI~Accept all
|
# 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)
|
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, headers: headers)
|
response = YT_POOL.client &.get(URI.parse(response.headers["Location"]).request_target, headers: headers)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user