Giter Site home page Giter Site logo

digi4school-pdf's Introduction

digi4school-pdf

Welcome to digi4school-pdf! This script lets you download your books from digi4school.

Requirements

  1. Node.JS & NPM (test with node --version and npm --version)
  2. Java 8+ (test with java --version)

Installation

  1. Clone this repository using HTTPS or Git.
  2. Run npm install in the root directory of the project.

Usage

To download a book, open a new terminal window in the root directory of the project and execute the script by typing npm start. Now, you have to provide the URL of the book to download as well as your login credentials for digi4school.

Paste the URL of your book: https://a.digi4school.at/ebook/0000/
Username/Email: [email protected]
Password: ********

You can see the progress of the download in the console and when the PDF-file has been generated, you can use a file explorer to navigate to the subdirectory book/ to find your generated PDF-file.

Disclaimer

This project is for educational purposes only and it's illegal to download and/or use the generated PDF-files.

digi4school-pdf's People

Contributors

laurensk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

chris040506

digi4school-pdf's Issues

Download of book failed

Hi,
many thanks for this great script.

But for some books we got the following error (other books are ok):

(node:31643) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'forEach' of undefined at Function.<anonymous> (/home/xxxx/digi4school-pdf/dist/D4SAuthHelper.js:63:33) at Generator.next (<anonymous>) at /home/xxxx/digi4school-pdf/dist/D4SAuthHelper.js:8:71 at new Promise (<anonymous>) at __awaiter (/home/xxxx/digi4school-pdf/dist/D4SAuthHelper.js:4:12) at Request._callback (/home/xxxx/digi4school-pdf/dist/D4SAuthHelper.js:59:38) at Request.self.callback (/home/xxxx/digi4school-pdf/node_modules/request/request.js:185:22) at Request.emit (events.js:314:20) at Request.<anonymous> (/home/xxxx/digi4school-pdf/node_modules/request/request.js:1154:10) at Request.emit (events.js:314:20) (node:31643) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:31643) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Thank you

Not generating all Pages

Somehow the script dosen't generate all Pages.
It should be 284 Pages -
image

but the script breaks before finishing with no Traceback. The only information is Source is not an Array
image

I tried to find the error by myself but i wasn't able to find it.

Can't download Book

Hey Thanks for providing this Script.

If we try to download a book, we get following Error:

(node:11960) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'split' of undefined
    at Function.<anonymous> (c:\Users\thoma\Downloads\digi4school\dist\D4SBookProperties.js:49:53)
    at Generator.next (<anonymous>)
    at c:\Users\thoma\Downloads\digi4school\dist\D4SBookProperties.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (c:\Users\thoma\Downloads\digi4school\dist\D4SBookProperties.js:4:12)
    at Request._callback (c:\Users\thoma\Downloads\digi4school\dist\D4SBookProperties.js:27:26)
    at Request.self.callback (c:\Users\thoma\Downloads\digi4school\node_modules\request\request.js:185:22)
    at Request.emit (events.js:315:20)
    at Request.<anonymous> (c:\Users\thoma\Downloads\digi4school\node_modules\request\request.js:1154:10)
    at Request.emit (events.js:315:20)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:11960) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11960) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Any Hints?

File does not exist

After downloading all pages, it happened to me that the mergePdfs() function was called to early.

image

The problem was that the last pdf file hasn't been saved to the system yet (most likely svg-to-pdf uses an async function to save files). I resolved the problem by setting a timeout before calling the mergePdfs() function.

setTimeout(this.mergePdfs, 3000);
This would replace line 281

Unfortunately I am not allowed to push my changes and create a pull request, otherwise I would have done that, instead of creating a new issue.

Hope it helps!
Ciao Lukas

Download does not work with newer editions of books

When I use the Addin on Chrome it works fine for older editions of a book. All the newer books (2021) does not work anymore. The download seems to stuck already at page 0.
Any idea, what the problem could be? If it would help, I can send you a code from a new edition of a book (where it does not work anymore). Pls. let me know.

Crashes while downloading

When using the program as described the following error crashes the program every time:

(node:17808) UnhandledPromiseRejectionWarning: TypeError: Cannot read property '
split' of undefined
at Function. (C:\Users\Christian\Documents\digi4school-pdf\dist\D
4SBookProperties.js:49:53)
at Generator.next ()
at C:\Users\Christian\Documents\digi4school-pdf\dist\D4SBookProperties.js:8:
71
at new Promise ()
at __awaiter (C:\Users\Christian\Documents\digi4school-pdf\dist\D4SBookPrope
rties.js:4:12)
at Request.callback (C:\Users\Christian\Documents\digi4school-pdf\dist\D4SB
ookProperties.js:27:26)
at Request.self.callback (C:\Users\Christian\Documents\digi4school-pdf\node

modules\request\request.js:185:22)
at Request.emit (events.js:314:20)
at Request. (C:\Users\Christian\Documents\digi4school-pdf\node_mo
dules\request\request.js:1154:10)
at Request.emit (events.js:314:20)
(Use node --trace-warnings ... to show where the warning was created)
(node:17808) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This
error originated either by throwing inside of an async function without a catch
block, or by rejecting a promise which was not handled with .catch(). To termin
ate the node process on unhandled promise rejection, use the CLI flag --unhandl ed-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejecti
ons_mode). (rejection id: 1)
(node:17808) [DEP0018] DeprecationWarning: Unhandled promise rejections are depr
ecated. In the future, promise rejections that are not handled will terminate th
e Node.js process with a non-zero exit code.

Running this on Windows 10 and all of the Requirements are installed.

Maybe there's a workaround or something.

Best Regards
Christian

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.