mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Try to redirect invalid video IDs
This commit is contained in:
parent
3ada6a9234
commit
e7cad23bb9
1 changed files with 8 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue