summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-08-05 14:46:21 -0500
committerOmar Roth <omarroth@hotmail.com>2018-08-05 14:46:21 -0500
commit7d6bc671c2691be6d5f8d7fdbde2e3339b5f3937 (patch)
tree6fb6582a601df0347da038c987d154204a2ed20f /src
parenta29458e32f4a32aab9ab8c9d0b5e6fc7c4eb6d1e (diff)
downloadinvidious-7d6bc671c2691be6d5f8d7fdbde2e3339b5f3937.tar.gz
invidious-7d6bc671c2691be6d5f8d7fdbde2e3339b5f3937.tar.bz2
invidious-7d6bc671c2691be6d5f8d7fdbde2e3339b5f3937.zip
Fix searches where items don't have byline
Diffstat (limited to 'src')
-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]