From bce01cba3265dcad5837acb2d8cafb84ad3fba0a Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Thu, 16 Aug 2018 09:05:48 -0500 Subject: [PATCH] Add fix for videos without metadata --- src/invidious/helpers/helpers.cr | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/invidious/helpers/helpers.cr b/src/invidious/helpers/helpers.cr index 8204fe11..7104e1e9 100644 --- a/src/invidious/helpers/helpers.cr +++ b/src/invidious/helpers/helpers.cr @@ -328,7 +328,9 @@ def extract_videos(nodeset, ucid = nil) end metadata = node.xpath_nodes(%q(.//div[contains(@class,"yt-lockup-meta")]/ul/li)) - if metadata.size == 1 + if metadata.size == 0 + next + elsif metadata.size == 1 # Scheduled livestream if metadata[0].content.starts_with? "Starts" view_count = 0_i64