From 9e73e3b15326bfac7c94a2cd997f742abbe66305 Mon Sep 17 00:00:00 2001 From: Omar Roth Date: Thu, 31 Jan 2019 08:48:44 -0600 Subject: [PATCH] Add errorcode for invalid video IDs --- src/invidious/videos.cr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/invidious/videos.cr b/src/invidious/videos.cr index ec911e3f..6298fa4e 100644 --- a/src/invidious/videos.cr +++ b/src/invidious/videos.cr @@ -633,6 +633,10 @@ def fetch_video(id, proxies, region) end end + if info["errorcode"]?.try &.== "2" + raise "Video unavailable." + end + title = info["title"] author = info["author"] ucid = info["ucid"]