diff --git a/pypdl/downloader.py b/pypdl/downloader.py index ba2df98..8f090ef 100644 --- a/pypdl/downloader.py +++ b/pypdl/downloader.py @@ -68,6 +68,7 @@ async def worker( if self.curr == size: self.completed = True else: - raise Exception( - f"Incorrect segment size: expected {size} bytes, received {self.curr} bytes" - ) + if not self.interrupt.is_set(): + raise Exception( + f"Incorrect segment size: expected {size} bytes, received {self.curr} bytes" + )