summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOmar Roth <omarroth@hotmail.com>2019-01-31 08:48:44 -0600
committerOmar Roth <omarroth@hotmail.com>2019-01-31 08:48:44 -0600
commit9e73e3b15326bfac7c94a2cd997f742abbe66305 (patch)
tree4c75ce5c8d84c54cff95996f3bf52e38a640076f /src
parent1e214aae7cedbb0770312e3eb2901216d27e6da7 (diff)
downloadinvidious-9e73e3b15326bfac7c94a2cd997f742abbe66305.tar.gz
invidious-9e73e3b15326bfac7c94a2cd997f742abbe66305.tar.bz2
invidious-9e73e3b15326bfac7c94a2cd997f742abbe66305.zip
Add errorcode for invalid video IDs
Diffstat (limited to 'src')
-rw-r--r--src/invidious/videos.cr4
1 files changed, 4 insertions, 0 deletions
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"]