summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-03-25 16:33:46 -0500
committerOmar Roth <omarroth@hotmail.com>2019-03-25 17:09:53 -0500
commitc15790f230ae9d7da13fd894de54eb73772ce7ea (patch)
treecbcf56399daf6bd3ba09b51762bfa98bde43b8b9 /src
parent13924a83537040e6101f17dc07f8197edb12eab4 (diff)
downloadinvidious-c15790f230ae9d7da13fd894de54eb73772ce7ea.tar.gz
invidious-c15790f230ae9d7da13fd894de54eb73772ce7ea.tar.bz2
invidious-c15790f230ae9d7da13fd894de54eb73772ce7ea.zip
Use user preferences in embedded videos
Diffstat (limited to 'src')
-rw-r--r--src/invidious.cr6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 6824ec74..b5823513 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -447,6 +447,10 @@ get "/embed/:id" do |env|
locale = LOCALES[env.get("preferences").as(Preferences).locale]?
id = env.params.url["id"]
+ if env.get? "preferences"
+ preferences = env.get("preferences").as(Preferences)
+ end
+
if id.includes?("%20") || id.includes?("+") || env.params.query.to_s.includes?("%20") || env.params.query.to_s.includes?("+")
id = env.params.url["id"].gsub("%20", "").delete("+")
@@ -469,7 +473,7 @@ get "/embed/:id" do |env|
next env.redirect url
end
- params = process_video_params(env.params.query, nil)
+ params = process_video_params(env.params.query, preferences)
begin
video = get_video(id, PG_DB, proxies, region: params[:region])