justfoolingaround / animdl

A highly efficient, fast, powerful and light-weight anime downloader and streamer for your favorite anime.
GNU General Public License v3.0
1.31k stars 108 forks source link

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

Open nattadasu opened 1 year ago

nattadasu commented 1 year ago

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:

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