This commit is contained in:
TeamMasse 2025-01-30 22:02:15 +01:00
parent 164d764d55
commit f602e857eb

View File

@ -15,10 +15,10 @@ module Invidious::Routes::ErrorRoutes
response = YT_POOL.client &.get(URI.parse(response.headers["Location"]).request_target) response = YT_POOL.client &.get(URI.parse(response.headers["Location"]).request_target)
end end
if response.body.empty? #if response.body.empty?
env.response.headers["Location"] = "/" # env.response.headers["Location"] = "/"
haltf env, status_code: 302 # haltf env, status_code: 302
end #end
html = XML.parse_html(response.body) html = XML.parse_html(response.body)
ucid = html.xpath_node(%q(//link[@rel="canonical"])).try &.["href"].split("/")[-1] ucid = html.xpath_node(%q(//link[@rel="canonical"])).try &.["href"].split("/")[-1]