summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/invidious/search.cr5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/invidious/search.cr b/src/invidious/search.cr
index 6b6d3f57..1b1afbfb 100644
--- a/src/invidious/search.cr
+++ b/src/invidious/search.cr
@@ -35,7 +35,10 @@ def search(query, page = 1, search_params = build_search_params(content_type: "v
title = anchor.content.strip
video_id = anchor["href"].lchop("/watch?v=")
- anchor = node.xpath_node(%q(.//div[contains(@class, "yt-lockup-byline")]/a)).not_nil!
+ anchor = node.xpath_node(%q(.//div[contains(@class, "yt-lockup-byline")]/a))
+ if !anchor
+ next
+ end
author = anchor.content
author_url = anchor["href"]
ucid = author_url.split("/")[-1]