Remove 'less' button in playlist descriptions

このコミットが含まれているのは:
Omar Roth 2018-09-13 21:00:39 -05:00
コミット 62ae836565
2個のファイルの変更8行の追加3行の削除

ファイルの表示

@ -119,13 +119,18 @@ end
def fetch_playlist(plid)
client = make_client(YT_URL)
response = client.get("/playlist?list=#{plid}&disable_polymer=1")
document = XML.parse_html(response.body)
body = response.body.gsub(<<-END_BUTTON
<button class="yt-uix-button yt-uix-button-size-default yt-uix-button-link yt-uix-expander-head playlist-description-expander yt-uix-inlineedit-ignore-edit" type="button" onclick=";return false;"><span class="yt-uix-button-content"> less <img alt="" src="/yts/img/pixel-vfl3z5WfW.gif">
</span></button>
END_BUTTON
, "")
document = XML.parse_html(body)
title = document.xpath_node(%q(//h1[@class="pl-header-title"])).not_nil!.content
title = title.strip(" \n")
description_html = document.xpath_node(%q(//span[@class="pl-header-description-text"]/div/div[1]))
description, description_html = html_to_content(description_html)
description_html, description = html_to_content(description_html)
anchor = document.xpath_node(%q(//ul[@class="pl-header-details"])).not_nil!
author = anchor.xpath_node(%q(.//li[1]/a)).not_nil!.content

ファイルの表示

@ -16,7 +16,7 @@
</div>
<div class="h-box">
<p><%= playlist.description %></p>
<p><%= playlist.description_html %></p>
</div>
<% videos.each_slice(4) do |slice| %>