feat(download.py): 新增文件下载延时处理

This commit is contained in:
JoeanAmier
2024-08-21 19:47:25 +08:00
parent 24c7a1eb3e
commit 15e412e6ae
4 changed files with 57 additions and 14 deletions

View File

@@ -1,3 +1,6 @@
from asyncio import sleep
from random import uniform
from rich import print
from rich.text import Text
@@ -24,3 +27,10 @@ def logging(log, text, style=INFO):
log.write(string)
else:
print(string)
async def sleep_time(
min_time: int = 1,
max_time: int = 3,
):
await sleep(uniform(min_time, max_time))