Sleep for 1-10 seconds after getting a channel's videos

This commit is contained in:
blank X 2021-04-17 21:17:32 +07:00
parent d2ae468427
commit fe1af6900a
Signed by: blankie
GPG Key ID: CC15FC822C7F61F5
1 changed files with 2 additions and 0 deletions

View File

@ -2,6 +2,7 @@ import re
import sys import sys
import time import time
import html import html
import random
import asyncio import asyncio
import logging import logging
import yaml import yaml
@ -160,6 +161,7 @@ async def main():
else: else:
logging.info('Handling %s', video_id) logging.info('Handling %s', video_id)
asyncio.create_task(handle_video(video_id, video_title)) asyncio.create_task(handle_video(video_id, video_title))
await asyncio.sleep(random.randint(1, 10))
if loadmode: if loadmode:
await save_seen_videos() await save_seen_videos()
break break