Invidious is an alternative front-end to YouTube
Add redirect for local DASH urls
Omar Rotha3a826e52cf1
diff --git a/src/invidious.cr b/src/invidious.crindex 6a7561b4..82cdbc2f 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -2535,6 +2535,15 @@ get "/api/v1/search" do |env|responseend+get "/api/manifest/dash/id/videoplayback" do |env|+ env.redirect "/videoplayback?#{env.params.query}"+end++get "/api/manifest/dash/id/videoplayback/*" do |env|+ puts env.request.path+ env.redirect env.request.path.lchop("/api/manifest/dash/id")+end+get "/api/manifest/dash/id/:id" do |env|env.response.headers.add("Access-Control-Allow-Origin", "*")env.response.content_type = "application/dash+xml"@@ -2557,12 +2566,7 @@ get "/api/manifest/dash/id/:id" do |env|url = url.rchop("</BaseURL>")if local- if Kemal.config.ssl || CONFIG.https_only- scheme = "https://"- end- scheme ||= "http://"-- url = scheme + env.request.headers["Host"] + URI.parse(url).full_path+ url = URI.parse(url).full_pathend"<BaseURL>#{url}</BaseURL>"@@ -2575,13 +2579,7 @@ get "/api/manifest/dash/id/:id" do |env|if localadaptive_fmts.each do |fmt|- if Kemal.config.ssl || CONFIG.https_only- scheme = "https://"- else- scheme = "http://"- end-- fmt["url"] = scheme + env.request.headers["Host"] + URI.parse(fmt["url"]).full_path+ fmt["url"] = URI.parse(fmt["url"]).full_pathendend