feat(dl): live countdown for --slow delay

This commit is contained in:
imSp4rky
2026-05-18 13:33:46 -06:00
parent 684e56eb97
commit d2380cff97

View File

@@ -32,6 +32,7 @@ from rich.padding import Padding
from rich.panel import Panel
from rich.progress import BarColumn, Progress, SpinnerColumn, TaskID, TextColumn, TimeRemainingColumn
from rich.rule import Rule
from rich.spinner import Spinner
from rich.table import Table
from rich.text import Text
from rich.tree import Tree
@@ -1422,8 +1423,11 @@ class dl:
if slow and i != 0:
delay = random.randint(slow[0], slow[1])
with console.status(f"Delaying by {delay} seconds..."):
time.sleep(delay)
spinner = Spinner("dots", text=f"Delaying by {delay} seconds...")
with Live(Padding(spinner, (0, 5)), console=console, refresh_per_second=12.5, transient=True):
for remaining in range(delay, 0, -1):
spinner.update(text=f"Delaying by {remaining} seconds...")
time.sleep(1)
with console.status("Subscribing to events...", spinner="dots"):
events.reset()