Add view counter, likes/dislikes, rating, and HTML parser
parent
131b92b381
commit
31a3e1bb3a
@ -1,16 +1,19 @@
|
|||||||
<h1><%= URI.unescape(video_info["title"].to_s,true) %></h1>
|
<% title = URI.unescape(video_info["title"].as(String), true) %>
|
||||||
<video style="width: 100%" poster="<%= video_info["iurlmq"] %>" controls>
|
<h1><%= title %></h1>
|
||||||
<% adaptive_fmt.each do |fmt| %>
|
<video style="width: 100%" poster="<%= video_info["iurlhq720"] %>" controls>
|
||||||
<% fmt_type = fmt["type"].to_s.split(";")[0] %>
|
<% video_info["adaptive_fmts"].as(Hash).each do |key, value| %>
|
||||||
<% if fmt_type.starts_with?("audio") %>
|
<% url = value["url"] %>
|
||||||
<source src="<%= fmt["url"] %>" type="<%= fmt_type %>">
|
<% type = value["type"].to_s.split(";")[0] %>
|
||||||
|
<% if type.starts_with?("audio") %>
|
||||||
|
<source src="<%= url %>" type="<%= type %>">
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</video>
|
</video>
|
||||||
|
|
||||||
|
|
||||||
<div class="pure-g">
|
<div class="pure-g">
|
||||||
<div class="pure-u-1 pure-u-md-1-5"></div>
|
<div class="pure-u-1 pure-u-md-1-5"></div>
|
||||||
<div class="pure-u-1 pure-u-md-3-5"></div>
|
<div class="pure-u-1 pure-u-md-3-5"></div>
|
||||||
<div class="pure-u-1 pure-u-md-1-5"></div>
|
<div class="pure-u-1 pure-u-md-1-5">
|
||||||
|
<p>Views : <%= video_info["view_count"] %></p>
|
||||||
|
<p>Rating : <%= video_info["avg_rating"] %></p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
@ -1,15 +1,20 @@
|
|||||||
<h1><%= URI.unescape(video_info["title"].to_s,true) %></h1>
|
<% title = URI.unescape(video_info["title"].as(String), true) %>
|
||||||
<video style="width: 100%" poster="<%= video_info["iurlmq"] %>" controls>
|
<h1><%= title %></h1>
|
||||||
<% fmt_stream.each do |fmt| %>
|
<video style="width: 100%" poster="<%= video_info["iurl"] %>" controls>
|
||||||
<source src="<%= fmt["url"] %>" type="<%= fmt["type"].to_s.split(";")[0] %>">
|
<% video_info["url_encoded_fmt_stream_map"].as(Hash).each do |key, value| %>
|
||||||
<% end %>
|
<% url = value["url"] %>
|
||||||
|
<% type = value["type"]["0"].to_s.split(";")[0] %>
|
||||||
|
<source src="<%= url %>" type="<%= type %>">
|
||||||
|
<% end %>
|
||||||
</video>
|
</video>
|
||||||
<div class="pure-g">
|
<div class="pure-g">
|
||||||
<div class="pure-u-1 pure-u-md-1-5"></div>
|
<div class="pure-u-1 pure-u-md-1-5">
|
||||||
<div class="pure-u-1 pure-u-md-3-5">
|
<p>Likes: <%= likes %></p>
|
||||||
<% fmt_stream.each do |fmt| %>
|
<p>Dislikes: <%= dislikes %></p>
|
||||||
<p><%= fmt["quality"] %></p>
|
</div>
|
||||||
<% end %>
|
<div class="pure-u-1 pure-u-md-3-5"></div>
|
||||||
</div>
|
<div class="pure-u-1 pure-u-md-1-5">
|
||||||
<div class="pure-u-1 pure-u-md-1-5"></div>
|
<p>Views : <%= video_info["view_count"] %></p>
|
||||||
|
<p>Rating : <%= video_info["avg_rating"] %></p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
Loading…
Reference in New Issue