summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-09-19 14:08:59 -0500
committerOmar Roth <omarroth@hotmail.com>2018-09-19 14:08:59 -0500
commitc166f46b7c6dc162e6804a66999fd915d8bf60c6 (patch)
treec50d14b183b7536a21035fff38f8245ce698a10e
parent4c8bb3b293c5742a9244d306f669bb1b824ee3ba (diff)
downloadinvidious-c166f46b7c6dc162e6804a66999fd915d8bf60c6.tar.gz
invidious-c166f46b7c6dc162e6804a66999fd915d8bf60c6.tar.bz2
invidious-c166f46b7c6dc162e6804a66999fd915d8bf60c6.zip
Add caption URL to video info
-rw-r--r--src/invidious.cr2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index dd36dfeb..1d0a8238 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -1794,6 +1794,7 @@ get "/api/v1/captions/:id" do |env|
json.object do
json.field "label", caption.name.simpleText
json.field "languageCode", caption.languageCode
+ json.field "url", "/api/v1/captions/#{id}?label=#{URI.escape(caption.name.simpleText)}"
end
end
end
@@ -2354,6 +2355,7 @@ get "/api/v1/videos/:id" do |env|
json.object do
json.field "label", caption.name.simpleText
json.field "languageCode", caption.languageCode
+ json.field "url", "/api/v1/captions/#{id}?label=#{URI.escape(caption.name.simpleText)}"
end
end
end