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

Workaround just FYI #12

Closed 573 closed 4 years ago

573 commented 4 years ago

To circumvent redownloading aborted downloads you can just add:

import os
import curlify as cy

and replace the two open(new_folder+final, 'wb').write(myfile.content) statements with:

os.popen("{}{}\"{}\"{}".format(cy.to_curl(myfile.request), " -o ", new_folder+final, " -C -").replace("'", "\""))

Assumes a working curl binary nonetheless on your system.

alexgand commented 4 years ago

Ok, thanks!