If a download is interrupted, unfinished files will prevent a new download
awegmann opened this issue · comments
Andreas Wegmann commented
Problem:
If you interrupt the application while downloading files (for example with CTRL-C), the unfinished downloads will stay in the destination directory. If you start the download again, the script will find a file with the expected name, but can not recognize, that this is not a fully downloaded ebook or code file.
Solution:
Start the download with a temporary file and after the file is fully downloaded, rename the file to the destination file name. If an exception occurs, clean up the temporary file.