|
|
@ -151,11 +151,13 @@ get "/watch" do |env|
|
|
|
|
fmt_stream << HTTP::Params.parse(string)
|
|
|
|
fmt_stream << HTTP::Params.parse(string)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if fmt_stream[0]?
|
|
|
|
if fmt_stream[0]["s"]?
|
|
|
|
if fmt_stream[0]["s"]?
|
|
|
|
fmt_stream.each do |fmt|
|
|
|
|
fmt_stream.each do |fmt|
|
|
|
|
fmt["url"] = "#{fmt["url"]}&signature=#{decrypt_signature(fmt["s"])}"
|
|
|
|
fmt["url"] = "#{fmt["url"]}&signature=#{decrypt_signature(fmt["s"])}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
# We want lowest quality first
|
|
|
|
# We want lowest quality first
|
|
|
|
fmt_stream.reverse!
|
|
|
|
fmt_stream.reverse!
|
|
|
@ -167,11 +169,13 @@ get "/watch" do |env|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if adaptive_fmts[0]?
|
|
|
|
if adaptive_fmts[0]["s"]?
|
|
|
|
if adaptive_fmts[0]["s"]?
|
|
|
|
adaptive_fmts.each do |fmt|
|
|
|
|
adaptive_fmts.each do |fmt|
|
|
|
|
fmt["url"] = "#{fmt["url"]}&signature=#{decrypt_signature(fmt["s"])}"
|
|
|
|
fmt["url"] = "#{fmt["url"]}&signature=#{decrypt_signature(fmt["s"])}"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
rvs = [] of Hash(String, String)
|
|
|
|
rvs = [] of Hash(String, String)
|
|
|
|
if video.info.has_key?("rvs")
|
|
|
|
if video.info.has_key?("rvs")
|
|
|
|