summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-08-07 13:10:52 -0500
committerOmar Roth <omarroth@hotmail.com>2018-08-07 13:10:52 -0500
commita3a826e52cf163ce57c1ee62618894372947c3bc (patch)
treedc0e41f7545924fe8928525345684aa51233f6fa
parentce506d39285c432564412f03f41b2454ed645737 (diff)
downloadinvidious-a3a826e52cf163ce57c1ee62618894372947c3bc.tar.gz
invidious-a3a826e52cf163ce57c1ee62618894372947c3bc.tar.bz2
invidious-a3a826e52cf163ce57c1ee62618894372947c3bc.zip
Add redirect for local DASH urls
-rw-r--r--src/invidious.cr24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 6a7561b4..82cdbc2f 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -2535,6 +2535,15 @@ get "/api/v1/search" do |env|
response
end
+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_path
end
"<BaseURL>#{url}</BaseURL>"
@@ -2575,13 +2579,7 @@ get "/api/manifest/dash/id/:id" do |env|
if local
adaptive_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_path
end
end