alexgand / springer_free_books

Python script to download all Springer books released for free during the 2020 COVID-19 quarantine
GNU General Public License v3.0
1.64k stars 366 forks source link

Fixed issue of missing EPUB and added command-line options #54

Closed chaosAD closed 4 years ago

chaosAD commented 4 years ago

The last inclusion of try-except code messed up with Crtl-C and Ctrl-Break. Also, by checking only the existence of a PDF file to skip the download causes the EPUB to be skipped as well, which is undesirable. This patch fixes those. However, it runs slower even though all books have been downloaded, but much faster than the original one. This is because some books do not have EPUB and the script will probe since those books are non-existence on the local drive, thus taking up more time.

I also included a simple command-line options to choose either to download PDF only or EPUB only. It will download both book formats if no option is given. There is an option to choose where to store all the downloaded files. By default the download folder is ./downloads.

As a side note, if you choose to download PDF only and provided that you have all the books on your drive, it runs as fast as Dovyski's modification because it will not probe for the missing EPUBs.

chaosAD commented 4 years ago

Hi Alex, by the default the download folder is ./downloads if user does not provide one. Also, I have updated the README.MD on the usage. Please have a look.