Skip to content

Invidious is an alternative front-end to YouTube

API: handle related channels parsing exceptions

Samantaz Fox698a6f38863c
diff --git a/src/invidious/routes/api/v1/channels.cr b/src/invidious/routes/api/v1/channels.cr
index 83c6db04..c4d6643a 100644
--- a/src/invidious/routes/api/v1/channels.cr
+++ b/src/invidious/routes/api/v1/channels.cr
@@ -97,7 +97,11 @@ module Invidious::Routes::API::V1::Channels
json.field "relatedChannels" do
json.array do
# Fetch related channels
- related_channels = fetch_related_channels(channel)
+ begin
+ related_channels = fetch_related_channels(channel)
+ rescue ex
+ related_channels = [] of AboutRelatedChannel
+ end
related_channels.each do |related_channel|
json.object do