mirror of
https://github.com/iv-org/invidious.git
synced 2025-11-23 18:05:32 +00:00
Add route to redirect to another instance
This commit is contained in:
@@ -35,4 +35,10 @@ class Invidious::Routes::Misc < Invidious::Routes::BaseRoute
|
||||
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
|
||||
rendered "licenses"
|
||||
end
|
||||
|
||||
def cross_instance_redirect(env)
|
||||
id = env.params.query["id"]
|
||||
instance_url = fetch_random_instance
|
||||
env.redirect "https://#{instance_url}/watch?v=#{id}"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user