mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-27 15:08:31 +00:00
Merge 4d1f10a30d
into fd8dc93569
This commit is contained in:
commit
88aaec9c1c
@ -9,10 +9,12 @@ 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}")
|
||||
|
||||
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
|
||||
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?
|
||||
|
Loading…
Reference in New Issue
Block a user