Support adding video to playlist from watch page

This commit is contained in:
Omar Roth 2020-04-07 13:34:40 -05:00
parent 2e378da922
commit 3f97bebd69
No known key found for this signature in database
GPG key ID: B8254FB7EC3D37F2
7 changed files with 57 additions and 9 deletions

View file

@ -3131,9 +3131,7 @@ get "/feed/channel/:ucid" do |env|
rss = YT_POOL.client &.get("/feeds/videos.xml?channel_id=#{channel.ucid}").body
rss = XML.parse_html(rss)
videos = [] of SearchVideo
rss.xpath_nodes("//feed/entry").each do |entry|
videos = rss.xpath_nodes("//feed/entry").map do |entry|
video_id = entry.xpath_node("videoid").not_nil!.content
title = entry.xpath_node("title").not_nil!.content
@ -3145,7 +3143,7 @@ get "/feed/channel/:ucid" do |env|
description_html = entry.xpath_node("group/description").not_nil!.to_s
views = entry.xpath_node("group/community/statistics").not_nil!.["views"].to_i64
videos << SearchVideo.new(
SearchVideo.new(
title: title,
id: video_id,
author: author,