Coder Social home page Coder Social logo

azalea / springer_free_books Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alexgand/springer_free_books

0.0 1.0 0.0 120 KB

Python script to download all Springer books released for free during the 2020 COVID-19 quarantine

License: GNU General Public License v3.0

Python 89.60% Dockerfile 1.96% Batchfile 8.44%

springer_free_books's Introduction

Python script to download all Springer books released for free during the 2020 COVID-19 quarantine

Usage

Note: If you want just one or two specific books, get the excel file here and manually download those or use the script to help you download (see Download book selectively sub-section). It took about 4 hours to complete the 409 english books (14 GB, both PDF and EPUB) on my machine.

By default the script stores the books in ./downloads subfolder according to the subject ("English Package Name" column of the excel file).

Download all books (PDF and EPUB)

Use the following command to download all PDF and EPUB books to the default download folder ./downloads

python3 main.py

To download them to a subfolder of your choice, say books

python3 main.py -f ./books

You can download to an absolute path, say C:/ebooks/springer/

python3 main.py -f C:/ebooks/springer/

Download all books of specific format

To download all PDF books only, run

python3 main.py --pdf

or all EPUB books only

python3 main.py --epub

Download only specific book categories

You can download selective books by categories. Make sure category name with space(s) is enclosed in double quotation marks, like so

python3 main.py -c Enginnering "CoMpuTer sciEnCe"

The category name is case-insensitive.

Download book selectively

You can download books by indices (refer to the excel file for the titles)

python3 main.py -i 2 345 70 90 0 213

Verbose mode

If you need to know what you are downloading, enable the verbose mode with -v option

python3 main.py -v -c "Behavioral science and psychology" "chaos AD" UFO "Life science" -i 2 34 400

You will get the following summary before the downloading starts

                                          Book Title               English Package Name
2                                  All of Statistics         Mathematics and Statistics
34                            Essential Astrophysics              Physics and Astronomy
37       International Perspectives on Psychotherapy  Behavioral Science and Psychology
40                         Applied Behavior Analysis  Behavioral Science and Psychology
70                          Psychology of Perception  Behavioral Science and Psychology
95             Handbook of Consumer Finance Research  Behavioral Science and Psychology
311       Clinical Methods in Medical Family Therapy  Behavioral Science and Psychology
313                           Motivation and Action   Behavioral Science and Psychology
381                          Perceptual Organization  Behavioral Science and Psychology
396  Evidence-Based Practice in Clinical Social Work  Behavioral Science and Psychology
397                 Foundations of Behavioral Health  Behavioral Science and Psychology
398                      Social Psychology in Action  Behavioral Science and Psychology
400             A Course in Rasch Measurement Theory                          Education

13 titles ready to be downloaded...
The following invalid book categories will be ignored:
 1. chaos AD
 2. UFO
 3. Life science

Running in a virtual environment (Bash commands):

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
python3 main.py

Virtual environment on Windows (auto-detects Python version):

Just double-click the run_VirtualEnv.bat file from Windows Explorer, or type-in its name at the command-line and press ENTER. Do install Python first, either from python.org or from the Microsoft Store for Windows 10.

Virtual environment on Windows (Python 3.x):

python -m venv .venv
.venv\Scripts\activate.bat
pip install -r requirements.txt
python main.py

Virtual environment on Windows (Python 2.7.x):

python -m virtualenv .venv
.venv\Scripts\activate.bat
pip install -r requirements2x.txt
python main.py

Source:

Thanks Springer!

Docker container to do all the work

Considering you cloned the repo in a folder, as:

cd \home\[user]\workspace`
git clone https://github.com/alexgand/springer_free_books.git
cd springer_free_books
mkdir downloads

You can run the scripts like that:

docker build . -t springer-image
docker run --rm -v [local_download_folder]:/app/downloads springer-image

and the downloads will be at [local_download_folder].

Troubleshooting

On macOS, if the script produces a [SSL: CERTIFICATE_VERIFY_FAILED] error, then security certificates may need to be installed. Instructions for doing so can be found here. If that doesn't work, see alternate instructions here.

springer_free_books's People

Contributors

alexgand avatar alexgv99 avatar bananabr avatar birbilis avatar cclauss avatar chaosad avatar dovyski avatar haeckelk avatar ivel91 avatar joshdabosh avatar jqueguiner avatar jstnmchl avatar justinallennz avatar lecafard avatar marlonchalegre avatar parthagar avatar pjungermann avatar rholais avatar spiritsree avatar viidix avatar vikashkothary avatar vspur avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.