Script to download your Laterza DiBook books to pdf for offline use. This only works with books that are available as PDFs online.
- Node >= 14.0
- Java installed (or if you are on linux you can install pdftk from your package manager, just make sure it's version 3 or above, also known as
pdftk-java
) - A modern browser (Chrome, Firefox, Edge, etc.)
- Download the source code from here or click the above green button
Code
and clickDownload Zip
- Extract the zip file in a new folder and open it
- Open the folder in a terminal
- If you are on Windows 11, just right click and press
Open with Windows Terminal
- If you are on Windows 10, hold
shift
on your keyboard and right click on a white space, then pressOpen command window here
- If you are on Windows 11, just right click and press
- Type in the terminal:
npm i
- Optional for linux users that can install pdftk from their package manager, go to https://gitlab.com/pdftk-java/pdftk and under
Pre-built binaries
, click onStandalone jar
, then copy the downloaded file to the script directory
-
Open the folder of the script in a terminal (same way as installation) and run the script with node typing:
node .
- if you are a linux user add the
--useSystemExecutable
flag
- if you are a linux user add the
-
In a browser, login into your DiBook Laterza account, and open the book you'd like to download
-
Open the dev tools (
f12
works) and open theApplication
tab if you are using a chromium based browser orStorage
if you are using firefox, then selectLocal Storage
>https://www.dibooklaterza.it
and copy the value of thejwtToken
entry -
Paste this value into the terminal wen asked for the
jwtToken
-
Enter the ISBN of the book you want to download (you can copy it from the url of the book you've opened)
-
Wait, the book will be downloaded and saved to the script' directory
Remember that you are responsible for what you are doing on the internet and even tho this script exists it might not be legal in your country to create personal backups of books.
I may or may not update this script depending on my needs, but I'm open to pull requests ecc.
This software uses the MIT License