diff --git a/devine/commands/dl.py b/devine/commands/dl.py index 09c0bee..530541b 100644 --- a/devine/commands/dl.py +++ b/devine/commands/dl.py @@ -473,19 +473,15 @@ class dl: ) for i, track in enumerate(title.tracks) )): - if download.cancelled(): - continue try: download.result() except Exception: # noqa self.DL_POOL_STOP.set() - pool.shutdown(wait=False, cancel_futures=True) self.log.error("Download worker threw an unhandled exception:") console.print_exception() return except KeyboardInterrupt: self.DL_POOL_STOP.set() - pool.shutdown(wait=False, cancel_futures=True) self.log.info("Received Keyboard Interrupt, stopping...") return diff --git a/devine/core/manifests/dash.py b/devine/core/manifests/dash.py index cacb7db..86ebde7 100644 --- a/devine/core/manifests/dash.py +++ b/devine/core/manifests/dash.py @@ -520,12 +520,9 @@ class DASH: for i, segment in enumerate(segments) )): finished_threads += 1 - if download.cancelled(): - continue e = download.exception() if e: state_event.set() - pool.shutdown(wait=False, cancel_futures=True) traceback.print_exception(e) log.error(f"Segment Download worker threw an unhandled exception: {e!r}") sys.exit(1) @@ -547,7 +544,6 @@ class DASH: download_sizes.clear() except KeyboardInterrupt: state_event.set() - pool.shutdown(wait=False, cancel_futures=True) log.info("Received Keyboard Interrupt, stopping...") return diff --git a/devine/core/manifests/hls.py b/devine/core/manifests/hls.py index 75c90f3..0c0b1ba 100644 --- a/devine/core/manifests/hls.py +++ b/devine/core/manifests/hls.py @@ -360,12 +360,9 @@ class HLS: for i, segment in enumerate(master.segments) )): finished_threads += 1 - if download.cancelled(): - continue e = download.exception() if e: state_event.set() - pool.shutdown(wait=False, cancel_futures=True) traceback.print_exception(e) log.error(f"Segment Download worker threw an unhandled exception: {e!r}") sys.exit(1) @@ -387,7 +384,6 @@ class HLS: download_sizes.clear() except KeyboardInterrupt: state_event.set() - pool.shutdown(wait=False, cancel_futures=True) log.info("Received Keyboard Interrupt, stopping...") return