mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Add route to redirect to another instance
This commit is contained in:
parent
5b47438b71
commit
31fa3dfd59
2 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue