mirror of https://github.com/devine-dl/devine.git
Print a download cancelled message on CTRL+C
This commit is contained in:
parent
53c005f727
commit
ad1990cc42
|
@ -433,6 +433,7 @@ class dl:
|
||||||
if skip_dl:
|
if skip_dl:
|
||||||
self.log.info("Skipping Download...")
|
self.log.info("Skipping Download...")
|
||||||
else:
|
else:
|
||||||
|
try:
|
||||||
with Live(
|
with Live(
|
||||||
Padding(
|
Padding(
|
||||||
download_table,
|
download_table,
|
||||||
|
@ -442,7 +443,6 @@ class dl:
|
||||||
refresh_per_second=5
|
refresh_per_second=5
|
||||||
):
|
):
|
||||||
with ThreadPoolExecutor(workers) as pool:
|
with ThreadPoolExecutor(workers) as pool:
|
||||||
try:
|
|
||||||
for download in futures.as_completed((
|
for download in futures.as_completed((
|
||||||
pool.submit(
|
pool.submit(
|
||||||
self.download_track,
|
self.download_track,
|
||||||
|
@ -481,7 +481,10 @@ class dl:
|
||||||
console.print_exception()
|
console.print_exception()
|
||||||
return
|
return
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
self.log.info("Received Keyboard Interrupt, stopping...")
|
console.print(Padding(
|
||||||
|
":x: Download Cancelled...",
|
||||||
|
(0, 5, 1, 5)
|
||||||
|
))
|
||||||
return
|
return
|
||||||
|
|
||||||
video_track_n = 0
|
video_track_n = 0
|
||||||
|
|
Loading…
Reference in New Issue