Q:

Downloading multiple pdf files with bash

I’d like to download from https://hebrewbooks.org/ all free available books, using a simple script.
Every book (52,000 of them) has a unique numeric number assigned. For example: 
https://hebrewbooks.org/1 
https://hebrewbooks.org/3 
https://hebrewbooks.org/52000
But many numbers have been skipped or have been removed.
Usually a visitor would click on the download button which returns: (book number 52000)
https://download.hebrewbooks.org/downloadhandler.ashx?req=52000
Or (for book number 1)
https://download.hebrewbooks.org/downloadhandler.ashx?req=1
I would like to download all files to a local disk without having to request each file individually in a browser etc.
I know this can been achieved with a simple script (even a bash script).
Could anyone advise me where to look or where find a similar problem that’s been solved.
Edit: I forgot an important question. How do I get the script to change the name for each downloaded file from the I’d number (such as 42000) to the metadata included in each file?

A:

As mentioned, wget would be a good tool to use. Maybe try using it in a loop?
#! /bin/bash

#iterate 52,000 times
for i in {1..52000}; do

  sleep 1s
  wget [local path] "https://download.hebrewbooks.org/downloader.ashx?req=${i}" 

  # $i is the current iteration, therefore collecting all 52,000

done

edit: Just realized someone commented this on the main question, but I'll leave this here for anyone who doesn't see them like me.

