summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-11-17 17:37:57 -0600
committerOmar Roth <omarroth@hotmail.com>2018-11-17 17:37:57 -0600
commit43961ef03515d3e5caf551f9536e9d24470582be (patch)
tree0dd4f838aa961cde29e10b87e4938e4d2ceeecea /src
parent16964ca6cefee233ea17ef341db411f22f7bad92 (diff)
downloadinvidious-43961ef03515d3e5caf551f9536e9d24470582be.tar.gz
invidious-43961ef03515d3e5caf551f9536e9d24470582be.tar.bz2
invidious-43961ef03515d3e5caf551f9536e9d24470582be.zip
Add 'region' parameter to captions and manifest endpoints
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 0ec5f5f2..69e90fcb 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -268,7 +268,7 @@ get "/watch" do |env|
env.params.query.delete_all("listen")
begin
- video = get_video(id, PG_DB, proxies)
+ video = get_video(id, PG_DB, proxies, params[:region])
rescue ex : VideoRedirect
next env.redirect "/watch?v=#{ex.message}"
rescue ex
@@ -409,7 +409,7 @@ get "/embed/:id" do |env|
params = process_video_params(env.params.query, nil)
begin
- video = get_video(id, PG_DB, proxies)
+ video = get_video(id, PG_DB, proxies, params[:region])
rescue ex : VideoRedirect
next env.redirect "/embed/#{ex.message}"
rescue ex
@@ -1983,10 +1983,11 @@ get "/api/v1/captions/:id" do |env|
env.response.content_type = "application/json"
id = env.params.url["id"]
+ region = env.params.query["region"]?
client = make_client(YT_URL)
begin
- video = get_video(id, PG_DB, proxies)
+ video = get_video(id, PG_DB, proxies, region)
rescue ex : VideoRedirect
next env.redirect "/api/v1/captions/#{ex.message}"
rescue ex
@@ -3100,10 +3101,11 @@ get "/api/manifest/dash/id/:id" do |env|
local = env.params.query["local"]?.try &.== "true"
id = env.params.url["id"]
+ region = env.params.query["region"]?
client = make_client(YT_URL)
begin
- video = get_video(id, PG_DB, proxies)
+ video = get_video(id, PG_DB, proxies, region)
rescue ex : VideoRedirect
next env.redirect "/api/manifest/dash/id/#{ex.message}"
rescue ex