Print a download cancelled message on CTRL+C

This commit is contained in:
rlaphoenix 2023-02-28 17:03:25 +00:00
parent 53c005f727
commit ad1990cc42
1 changed files with 16 additions and 13 deletions

View File

@ -433,6 +433,7 @@ class dl:
if skip_dl:
self.log.info("Skipping Download...")
else:
try:
with Live(
Padding(
download_table,
@ -442,7 +443,6 @@ class dl:
refresh_per_second=5
):
with ThreadPoolExecutor(workers) as pool:
try:
for download in futures.as_completed((
pool.submit(
self.download_track,
@ -481,7 +481,10 @@ class dl:
console.print_exception()
return
except KeyboardInterrupt:
self.log.info("Received Keyboard Interrupt, stopping...")
console.print(Padding(
":x: Download Cancelled...",
(0, 5, 1, 5)
))
return
video_track_n = 0