mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-08-14.git
synced 2024-08-15 00:53:20 +00:00
Use a dedicated endpoind for downloads
This allows us to not pass file name ("title") in the form data and to enforce some sanity checks
This commit is contained in:
parent
fe057c7873
commit
2f335b3d2c
5 changed files with 82 additions and 31 deletions
|
@ -236,6 +236,7 @@ before_all do |env|
|
|||
"/api/manifest/",
|
||||
"/videoplayback",
|
||||
"/latest_version",
|
||||
"/download",
|
||||
}.any? { |r| env.request.resource.starts_with? r }
|
||||
|
||||
if env.request.cookies.has_key? "SID"
|
||||
|
@ -348,6 +349,8 @@ end
|
|||
Invidious::Routing.get "/e/:id", Invidious::Routes::Watch, :redirect
|
||||
Invidious::Routing.get "/redirect", Invidious::Routes::Misc, :cross_instance_redirect
|
||||
|
||||
Invidious::Routing.post "/download", Invidious::Routes::Watch, :download
|
||||
|
||||
Invidious::Routing.get "/embed/", Invidious::Routes::Embed, :redirect
|
||||
Invidious::Routing.get "/embed/:id", Invidious::Routes::Embed, :show
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue