|
|
@ -121,20 +121,16 @@ class VideoInfo
|
|
|
|
)
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
macro templated(filename)
|
|
|
|
macro templated(filename)
|
|
|
|
render "src/views/#{{{filename}}}.ecr", "src/views/layout.ecr"
|
|
|
|
render "src/views/#{{{filename}}}.ecr", "src/views/layout.ecr"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
context = OpenSSL::SSL::Context::Client.insecure
|
|
|
|
context = OpenSSL::SSL::Context::Client.insecure
|
|
|
|
client = HTTP::Client.new("www.youtube.com", 443, context)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
video_id = "Vufba_ZcoR0"
|
|
|
|
|
|
|
|
video_info = client.get("/get_video_info?video_id=#{video_id}&el=info&ps=default&eurl=&gl=US&hl=en").body
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
p VideoInfo.from_json(video_info)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# client = HTTP::Client.new("www.youtube.com", 443, context)
|
|
|
|
|
|
|
|
# video_id = "Vufba_ZcoR0"
|
|
|
|
|
|
|
|
# video_info = client.get("/get_video_info?video_id=#{video_id}&el=info&ps=default&eurl=&gl=US&hl=en").body
|
|
|
|
|
|
|
|
# p VideoInfo.from_json(video_info)
|
|
|
|
|
|
|
|
|
|
|
|
get "/" do |env|
|
|
|
|
get "/" do |env|
|
|
|
|
templated "index"
|
|
|
|
templated "index"
|