mirror of
https://github.com/iv-org/invidious.git
synced 2025-11-22 09:25:32 +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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user