diff options
| author | Omar Roth <omarroth@protonmail.com> | 2019-08-16 20:06:21 -0500 |
|---|---|---|
| committer | Omar Roth <omarroth@protonmail.com> | 2019-08-16 20:06:21 -0500 |
| commit | 2b94975345a3bdd085a99081de521d1c5d3ada48 (patch) | |
| tree | 50c4a7dbbeba582f9ebbe998615bb69f92a70686 /src | |
| parent | e6b4e1268945777c5d07dfca4362a1af23f6d970 (diff) | |
| download | invidious-2b94975345a3bdd085a99081de521d1c5d3ada48.tar.gz invidious-2b94975345a3bdd085a99081de521d1c5d3ada48.tar.bz2 invidious-2b94975345a3bdd085a99081de521d1c5d3ada48.zip | |
Fix playlist_thumbnail extractor
Diffstat (limited to 'src')
| -rw-r--r-- | src/invidious.cr | 5 | ||||
| -rw-r--r-- | src/invidious/helpers/helpers.cr | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/invidious.cr b/src/invidious.cr index 21d6544d..2fa1d66f 100644 --- a/src/invidious.cr +++ b/src/invidious.cr @@ -3003,7 +3003,7 @@ get "/user/:user/about" do |env| env.redirect "/channel/#{user}" end -get "/channel:ucid/about" do |env| +get "/channel/:ucid/about" do |env| ucid = env.params.url["ucid"] env.redirect "/channel/#{ucid}" end @@ -3107,8 +3107,7 @@ get "/channel/:ucid/playlists" do |env| end items, continuation = fetch_channel_playlists(channel.ucid, channel.author, channel.auto_generated, continuation, sort_by) - items.select! { |item| item.is_a?(SearchPlaylist) && !item.videos.empty? } - items = items.map { |item| item.as(SearchPlaylist) } + items = items.select { |item| item.is_a?(SearchPlaylist) }.map { |item| item.as(SearchPlaylist) } items.each { |item| item.author = "" } env.set "search", "channel:#{channel.ucid} " diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index e018e567..1b232072 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -397,8 +397,8 @@ def extract_items(nodeset, ucid = nil, author_name = nil) ) end - playlist_thumbnail = node.xpath_node(%q(.//div/span/img)).try &.["data-thumb"]? - playlist_thumbnail ||= node.xpath_node(%q(.//div/span/img)).try &.["src"] + playlist_thumbnail = node.xpath_node(%q(.//span/img)).try &.["data-thumb"]? + playlist_thumbnail ||= node.xpath_node(%q(.//span/img)).try &.["src"] items << SearchPlaylist.new( title, |
