summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2018-08-16 09:05:48 -0500
committerOmar Roth <omarroth@hotmail.com>2018-08-16 09:05:48 -0500
commitbce01cba3265dcad5837acb2d8cafb84ad3fba0a (patch)
tree64292d74f913696acccd06839c8ec7b5aadd3c7e /src
parentec399f5f7bc192c645633bcaf62899ec097f0435 (diff)
downloadinvidious-bce01cba3265dcad5837acb2d8cafb84ad3fba0a.tar.gz
invidious-bce01cba3265dcad5837acb2d8cafb84ad3fba0a.tar.bz2
invidious-bce01cba3265dcad5837acb2d8cafb84ad3fba0a.zip
Add fix for videos without metadata
Diffstat (limited to 'src')
-rw-r--r--src/invidious/helpers/helpers.cr4
1 files changed, 3 insertions, 1 deletions
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