mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 21:39:49 +00:00
add sleep_interval to queue.py (#832)
add sleep_interval to mitigate rate_limiting induced errors when adding videos to queue
This commit is contained in:
@@ -6,6 +6,7 @@ Functionality:
|
||||
|
||||
import json
|
||||
from datetime import datetime
|
||||
from time import sleep
|
||||
|
||||
from appsettings.src.config import AppConfig
|
||||
from common.src.es_connect import ElasticWrap, IndexPaginate
|
||||
@@ -245,7 +246,9 @@ class PendingList(PendingIndex):
|
||||
|
||||
total = len(self.missing_videos)
|
||||
videos_added = []
|
||||
sleep_interval = self.config["downloads"].get("sleep_interval", 0)
|
||||
for idx, (youtube_id, vid_type) in enumerate(self.missing_videos):
|
||||
sleep(sleep_interval)
|
||||
if self.task and self.task.is_stopped():
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user