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.65k stars 366 forks source link

If both pdf and epub are available, download only pdf #48

Closed prkandel closed 4 years ago

prkandel commented 4 years ago

I noticed that there are several books which have both pdf and epub available. The current script downloads both, creating a lot of duplicate files. It would be nice to only download pdf if epub and pdf both are available.

sinnytk commented 4 years ago

A simple mode variable along with a check whether to download PDF + EPUB or only PDF(if available.)

I can work on this if that's ok?

@alexgand

prkandel commented 4 years ago

Yeah, the change should be simple. Sounds good to me.

alexgand commented 4 years ago

@sinnytk yes, please, but make it simple.

sinnytk commented 4 years ago

@alexgand These are the different modes that I came up with. What do you reckon would be a better implementation, using command line arguments or asking for mode as input from the user?

0, download both (EPUB and PDF)
1, download PDF only (if not available, skip)
2, download EPUB only (if not available, skip)
3, prefer PDF (otherwise download EPUB)
4, prefer EPUB (otherwise download PDF)
chaosAD commented 4 years ago

Have a look at my PR #54, I have included command-line options to select PDF only, EPUB, only, or both.

alexgand commented 4 years ago

Implemented in PR #57, please try the new code, it is now much better!