Sleep for 1-10 seconds after getting a channel's videos
This commit is contained in:
parent
d2ae468427
commit
fe1af6900a
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue