handle API stop

This commit is contained in:
Simon
2025-07-10 10:18:04 +07:00
parent 8fbd94b120
commit f45214714c

View File

@@ -217,6 +217,9 @@ class PendingList(PendingIndex):
total = len(self.youtube_ids)
for idx, entry in enumerate(self.youtube_ids):
self._process_entry(entry, idx, total)
if self.task and self.task.is_stopped():
break
rand_sleep(self.config)
if not self.task:
continue
@@ -282,6 +285,9 @@ class PendingList(PendingIndex):
if video_id in self.to_skip:
continue
if self.task and self.task.is_stopped():
break
if self.flat:
if not video_data.get("channel"):
channel_name = channel_handler.json_data["channel_name"]
@@ -326,6 +332,9 @@ class PendingList(PendingIndex):
if video_id in self.to_skip:
continue
if self.task and self.task.is_stopped():
break
if self.flat:
if not video_data.get("channel"):
video_data["channel"] = playlist.youtube_meta["channel"]