animdl icon indicating copy to clipboard operation
animdl copied to clipboard

KeyboardInterrupt Exception does not work instantly during episode download to cancel progress

Open nattadasu opened this issue 2 years ago • 0 comments

As the title suggest, during episode download, when user do Ctrl+C, the progress won't stop or at least prompt UNLESS the episode was successfully downloaded but an exception message: Exiting from the downloading context was thrown after. I think this behavior must be fixed for some use case where user has limited data plan (if user use tethered connection) or wish not to continue downloading the anime.

Reproducing

  1. Try to download an anime from any provider and optimally use range of episodes. In this example, we used allanime with following query:
    animdl download -r "27-72" "Xiao Lu He Xiao Lan"
    
  2. Select which anime that matches, we use option 2 (Xiao Lu He Xiao Lan)
  3. When animdl starts downloading the episode, start pressing/spamming Ctrl+C keystroke.
  4. Observe.

Expected behavior

Either:

  • A prompt message to cancel shown
  • Write a log that the episode download was cancelled, and abruptly stop the progress

Observed behavior

Episode kept being downloaded. Once reached 100%, an exception was thrown.

image

Notes

If user opted in --idm flag, a confirmation shown to stop the episode scraping.

image

Environment

  • Provider: allanime
  • Scraped page: https://allanime.to/anime/GuWjkbBFSFNxS5BKg
  • animdl version: v1.7.24
  • pipx version: v1.1.0
  • Python version: v3.11.2
  • OS: Windows 11 (Home) x86_64, 10.0.22621.2283 (22H2)
  • Terminal: Windows Terminal v1.17.11461.0
  • Shell: PowerShell v7.3.6

nattadasu avatar Sep 27 '23 19:09 nattadasu