diff --git a/src/invidious.cr b/src/invidious.cr index 0a0233451..310aca045 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -173,6 +173,10 @@ end get "/watch" do |env| if env.params.query["v"]? id = env.params.query["v"] + + if id.size > 11 + next env.redirect "/watch?v=#{id[0, 11]}" + end else next env.redirect "/" end @@ -355,6 +359,10 @@ end get "/embed/:id" do |env| if env.params.url["id"]? id = env.params.url["id"] + + if id.size > 11 + next env.redirect "/embed/#{id[0, 11]}" + end else next env.redirect "/" end