From 2aa23ac2aa04dc05adee8cd215e4878de163bfb6 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 15 Jul 2022 22:34:01 -0700 Subject: [PATCH] Do all the non-rss refreshes last. --- ycdl/ycdldb.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ycdl/ycdldb.py b/ycdl/ycdldb.py index 6de457c..aa873fa 100644 --- a/ycdl/ycdldb.py +++ b/ycdl/ycdldb.py @@ -114,6 +114,8 @@ class YCDLDBChannelMixin: ''' excs = [] + need_traditional = [] + def traditional(channel): try: channel.refresh(rss_assisted=False) @@ -131,11 +133,11 @@ class YCDLDBChannelMixin: yield from new_ids except (exceptions.NoVideos, exceptions.RSSAssistFailed) as exc: log.debug( - 'RSS assist for %s failed "%s", using traditional refresh.', + 'RSS assist for %s failed "%s", adding to traditional queue.', channel.id, exc.error_message ) - traditional(channel) + need_traditional.append(channel) video_ids = lazychain.LazyChain() @@ -153,6 +155,10 @@ class YCDLDBChannelMixin: for video in self.youtube.get_videos(video_ids): self.ingest_video(video) + for channel in need_traditional: + log.debug('Using traditional refresh for %s.', channel.id) + traditional(channel) + return excs @worms.atomic