From fe1af6900aacc2b14b551ea19d6099b5ad19740f Mon Sep 17 00:00:00 2001 From: blank X Date: Sat, 17 Apr 2021 21:17:32 +0700 Subject: [PATCH] Sleep for 1-10 seconds after getting a channel's videos --- ytnotifier.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ytnotifier.py b/ytnotifier.py index c23ba5c..ec2ad1b 100644 --- a/ytnotifier.py +++ b/ytnotifier.py @@ -2,6 +2,7 @@ import re import sys import time import html +import random import asyncio import logging import yaml @@ -160,6 +161,7 @@ async def main(): else: logging.info('Handling %s', video_id) asyncio.create_task(handle_video(video_id, video_title)) + await asyncio.sleep(random.randint(1, 10)) if loadmode: await save_seen_videos() break