From dc7df893ee2ef101f843fd5d1b02a093483d5879 Mon Sep 17 00:00:00 2001 From: The Wiesel <106014757+Sommerwiesel@users.noreply.github.com> Date: Mon, 14 Sep 2026 10:28:36 +0200 Subject: [PATCH] Fix topic channels bug on sub updates --- src/invidious/channels/channels.cr | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/invidious/channels/channels.cr b/src/invidious/channels/channels.cr index 64f0484df..81488737e 100644 --- a/src/invidious/channels/channels.cr +++ b/src/invidious/channels/channels.cr @@ -195,7 +195,22 @@ def fetch_channel(ucid, pull_all_videos : Bool) }) LOGGER.trace("fetch_channel: #{ucid} : Downloading channel videos page") - videos, continuation = IV::Channel::Tabs.get_videos(channel) + + # Auto-generated ("- Topic") channels have no regular videos tab and InnerTube + # answers 500 for them. Letting that abort fetch_channel throws away the RSS + # feed fetched above, even though the tab result is only used to enrich RSS + # entries with length_seconds/live_now/premiere_timestamp, each of which + # already falls back to a default below. Degrade instead of failing, so a + # channel we can still read via RSS does not stall RefreshChannelsJob. + videos_tab_available = true + begin + videos, continuation = IV::Channel::Tabs.get_videos(channel) + rescue ex + LOGGER.debug("fetch_channel: #{ucid} : videos tab unavailable (#{ex.message}), continuing with RSS only") + videos = [] of SearchItem + continuation = nil + videos_tab_available = false + end LOGGER.trace("fetch_channel: #{ucid} : Extracting videos from channel RSS feed") rss.xpath_nodes("//default:feed/default:entry", namespaces).each do |entry| @@ -255,7 +270,7 @@ def fetch_channel(ucid, pull_all_videos : Bool) end end - if pull_all_videos + if pull_all_videos && videos_tab_available loop do # Keep fetching videos using the continuation token retrieved earlier videos, continuation = IV::Channel::Tabs.get_videos(channel, continuation: continuation)