mirror of
https://github.com/iv-org/invidious.git
synced 2026-09-26 11:35:27 -05:00
Merge dc7df893ee2ef101f843fd5d1b02a093483d5879 into c88230067b7a3abbb569ac0938bf8d897c8340be
This commit is contained in:
commit
702d5d3e86
@ -195,7 +195,22 @@ def fetch_channel(ucid, pull_all_videos : Bool)
|
||||
})
|
||||
|
||||
LOGGER.trace("fetch_channel: #{ucid} : Downloading channel videos page")
|
||||
|
||||
# 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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user