Skip to content

Commit

Permalink
Improve playlist description extractor
Browse files Browse the repository at this point in the history
  • Loading branch information
omarroth committed Jan 5, 2019
1 parent cc00beb commit 4ae57cb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/invidious/playlists.cr
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,7 @@ def fetch_playlist(plid, locale)
raise translate(locale, "Invalid playlist.")
end

body = response.body.gsub(%(
<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>
), "")
body = response.body.gsub(/<button[^>]+><span[^>]+>\s*less\s*<img[^>]+>\n<\/span><\/button>/, "")
document = XML.parse_html(body)

title = document.xpath_node(%q(//h1[@class="pl-header-title"]))
Expand Down

0 comments on commit 4ae57cb

Please sign in to comment.