diff --git a/src/invidious/routes/misc.cr b/src/invidious/routes/misc.cr index c14e0e54..13fc65bb 100644 --- a/src/invidious/routes/misc.cr +++ b/src/invidious/routes/misc.cr @@ -38,12 +38,7 @@ class Invidious::Routes::Misc < Invidious::Routes::BaseRoute def cross_instance_redirect(env) instance_url = fetch_random_instance - if env.params.query["id"]? - id = env.params.query["id"] - env.redirect "https://#{instance_url}/watch?v=#{id}" - elsif env.params.query["q"]? - query, page = env.params.query["q"], env.params.query["page"] - env.redirect "https://#{instance_url}/search?q=#{query}&page=#{page}" - end + referer = get_referer(env) + env.redirect "https://#{instance_url}#{referer}" end end diff --git a/src/invidious/views/components/item.ecr b/src/invidious/views/components/item.ecr index 0e379e8e..532de6ac 100644 --- a/src/invidious/views/components/item.ecr +++ b/src/invidious/views/components/item.ecr @@ -148,7 +148,7 @@ " href="/watch?v=<%= item.id %>&listen=1"> - " href="/redirect?id=<%= item.id %>&listen=1"> + " href="/redirect?referer=<%= env.get?("current_page") %>"> diff --git a/src/invidious/views/search.ecr b/src/invidious/views/search.ecr index fdb9205c..db0a8d56 100644 --- a/src/invidious/views/search.ecr +++ b/src/invidious/views/search.ecr @@ -5,7 +5,7 @@ <% if count == 0 %>
- <%= translate(locale, "Switch Invidious Instance") %> + "><%= translate(locale, "Switch Invidious Instance") %>