summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/invidious.cr2
-rw-r--r--src/invidious/helpers/helpers.cr5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index bdd00b0f..1cb1ca7e 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -2645,6 +2645,7 @@ get "/api/v1/channels/search/:ucid" do |env|
json.field "authorId", item.ucid
json.field "authorUrl", "/channel/#{item.ucid}"
+ json.field "videoCount", item.video_count
json.field "videos" do
json.array do
item.videos.each do |video|
@@ -2765,6 +2766,7 @@ get "/api/v1/search" do |env|
json.field "authorId", item.ucid
json.field "authorUrl", "/channel/#{item.ucid}"
+ json.field "videoCount", item.video_count
json.field "videos" do
json.array do
item.videos.each do |video|
diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr
index e1fc4d52..7449a435 100644
--- a/src/invidious/helpers/helpers.cr
+++ b/src/invidious/helpers/helpers.cr
@@ -238,7 +238,10 @@ def extract_items(nodeset, ucid = nil)
when .includes? "yt-lockup-playlist"
plid = HTTP::Params.parse(URI.parse(id).query.not_nil!)["list"]
- anchor = node.xpath_node(%q(.//ul[@class="yt-lockup-meta-info"]/li/a))
+ anchor = node.xpath_node(%q(.//div[contains(@class, "yt-lockup-meta")]/a))
+ if !anchor
+ anchor = node.xpath_node(%q(.//ul[@class="yt-lockup-meta-info"]/li/a))
+ end
if anchor
video_count = anchor.content.match(/View full playlist \((?<count>\d+)/).try &.["count"].to_i?
end