From f18d812eb80c1d1cdedd88cd0062f6c480596e77 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 27 Mar 2025 21:13:13 +0100 Subject: [PATCH] delay playlist extraction --- backend/channel/src/index.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/channel/src/index.py b/backend/channel/src/index.py index 77d8cf27..6d03ed92 100644 --- a/backend/channel/src/index.py +++ b/backend/channel/src/index.py @@ -10,6 +10,7 @@ from datetime import datetime from common.src.env_settings import EnvironmentSettings from common.src.es_connect import ElasticWrap, IndexPaginate +from common.src.helper import rand_sleep from common.src.index_generic import YouTubeItem from download.src.thumbnails import ThumbManager from download.src.yt_dlp_base import YtWrap @@ -251,6 +252,7 @@ class YoutubeChannel(YouTubeItem): self._index_single_playlist(playlist) print("add playlist: " + playlist[1]) + rand_sleep(self.config) def _notify_single_playlist(self, idx, total): """send notification""" @@ -287,6 +289,7 @@ class YoutubeChannel(YouTubeItem): obs = {"skip_download": True, "extract_flat": True} playlists = YtWrap(obs, self.config).extract(url) if not playlists: + self.all_playlists = [] return all_entries = [(i["id"], i["title"]) for i in playlists["entries"]]