Add 'region' parameter for bypassing region locks

This commit is contained in:
Omar Roth
2018-11-17 17:33:30 -06:00
parent 879586d7f5
commit 16964ca6ce
3 changed files with 28 additions and 12 deletions

View File

@@ -2215,9 +2215,10 @@ get "/api/v1/videos/:id" do |env|
env.response.content_type = "application/json"
id = env.params.url["id"]
region = env.params.query["region"]?
begin
video = get_video(id, PG_DB, proxies)
video = get_video(id, PG_DB, proxies, region)
rescue ex : VideoRedirect
next env.redirect "/api/v1/videos/#{ex.message}"
rescue ex