|
|
@ -2722,6 +2722,11 @@ get "/api/v1/captions/:id" do |env|
|
|
|
|
END_CUE
|
|
|
|
END_CUE
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if title = env.params.query["title"]?
|
|
|
|
|
|
|
|
# https://blog.fastmail.com/2011/06/24/download-non-english-filenames/
|
|
|
|
|
|
|
|
env.response.headers["Content-Disposition"] = "attachment; filename=\"#{URI.escape(title)}\"; filename*=UTF-8''#{URI.escape(title)}"
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
webvtt
|
|
|
|
webvtt
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
@ -4214,11 +4219,18 @@ end
|
|
|
|
get "/latest_version" do |env|
|
|
|
|
get "/latest_version" do |env|
|
|
|
|
if env.params.query["download_widget"]?
|
|
|
|
if env.params.query["download_widget"]?
|
|
|
|
download_widget = JSON.parse(env.params.query["download_widget"])
|
|
|
|
download_widget = JSON.parse(env.params.query["download_widget"])
|
|
|
|
|
|
|
|
|
|
|
|
id = download_widget["id"].as_s
|
|
|
|
id = download_widget["id"].as_s
|
|
|
|
itag = download_widget["itag"].as_s
|
|
|
|
|
|
|
|
title = download_widget["title"].as_s
|
|
|
|
title = download_widget["title"].as_s
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if label = download_widget["label"]?
|
|
|
|
|
|
|
|
env.redirect "/api/v1/captions/#{id}?label=#{label}&title=#{title}"
|
|
|
|
|
|
|
|
next
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
itag = download_widget["itag"].as_s
|
|
|
|
local = "true"
|
|
|
|
local = "true"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
id ||= env.params.query["id"]?
|
|
|
|
id ||= env.params.query["id"]?
|
|
|
|
itag ||= env.params.query["itag"]?
|
|
|
|
itag ||= env.params.query["itag"]?
|
|
|
|