From 45d687c4e1403a718d8a73b44117b69bf22a0c4c Mon Sep 17 00:00:00 2001 From: syeopite Date: Sun, 11 Apr 2021 22:09:46 -0700 Subject: [PATCH] Preserve url params in video aliases --- src/invidious/routes/watch.cr | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/invidious/routes/watch.cr b/src/invidious/routes/watch.cr index 4f6e9598..d0338882 100644 --- a/src/invidious/routes/watch.cr +++ b/src/invidious/routes/watch.cr @@ -189,6 +189,11 @@ class Invidious::Routes::Watch < Invidious::Routes::BaseRoute end def redirect(env) - return env.redirect "/watch?v=#{env.params.url["id"]}" + url = "/watch?v=#{env.params.url["id"]}" + if env.params.query.size > 0 + url += "&#{env.params.query}" + end + + return env.redirect url end end