Leone25 / bSmart-downloader

Download your books from bSmart as offline pdf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Errore durante il download di due libri

DJLeleX opened this issue · comments

Please input book id:99763
Downloading pages
....
Progress 6.05%
C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\pdf-lib\cjs\api\PDFDocument.js:28
_this.catalog.Pages().traverse(function (node, ref) {
^

TypeError: _this.catalog.Pages is not a function
at PDFDocument.computePages [as populate] (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\pdf-lib\cjs\api\PDFDocument.js:28:27)
at Cache.access (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\pdf-lib\cjs\utils\Cache.js:13:31)
at PDFDocument.getPages (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\pdf-lib\cjs\api\PDFDocument.js:479:31)
at PDFDocument. (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\pdf-lib\cjs\api\PDFDocument.js:648:43)
at step (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\tslib\tslib.js:141:27)
at Object.next (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\tslib\tslib.js:122:57)
at fulfilled (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\tslib\tslib.js:112:62)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.17.1


Please input book id:101081
Downloading pages
....
Progress 66.87%
C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\pdf-lib\cjs\api\PDFDocument.js:28
_this.catalog.Pages().traverse(function (node, ref) {
^

TypeError: _this.catalog.Pages is not a function
at PDFDocument.computePages [as populate] (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\pdf-lib\cjs\api\PDFDocument.js:28:27)
at Cache.access (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\pdf-lib\cjs\utils\Cache.js:13:31)
at PDFDocument.getPages (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\pdf-lib\cjs\api\PDFDocument.js:479:31)
at PDFDocument. (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\pdf-lib\cjs\api\PDFDocument.js:648:43)
at step (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\tslib\tslib.js:141:27)
at Object.next (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\tslib\tslib.js:122:57)
at fulfilled (C:\Users\DJLeleX\Downloads\bSmart-downloader-main\bSmart-downloader-main\node_modules\tslib\tslib.js:112:62)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v18.17.1

Non so se eri a conoscenza di questo problema. Questi due libri non vengono scaricati neanche con altri downloader (ad esempio https://github.com/FelixFrog/pdfgrabber)

Ok ho visto i tuoi link al issue #16 dove suggerisci una soluzione, che però per me non funziona..

edit: corretto typo

commented

in che modo non ti funziona il metodo alternativo?

"commentando linea 109, 110, 111, 118 (essenzialmente devi aggiungere // all'inizio di ogni riga), e scommentare linea 107 (rimuovere gli //) e poi eseguire nuovamente lo script."

Se faccio questi commenti, lo script non funziona più...

commented

hai creato la cartella temp nella stessa cartella dello script?

Certo!
Il fatto è che lo script non ha senso se commento quelle linee di codice.. anche perché ad esempio la riga 107 non è commentata..
Penso che il numero di righe da commentare/rimuovere il commento sia cambiato da quando hai modificato il codice..

EDIT: le righe da commentare/rimuovere il commento sono ora: 104 da rimuovere il commento e 106,107,108 da commentare

o quantomeno per il momento non sta dando errori

EDIT 2:
confermo che ora riesca a scaricare le singole pagine, però con le istruzioni per i comandi da termianle al #16 non riesce a creare un pdf unico, restituisce errore ad ogni pagina:

Error: Failed to open PDF file:
numero_pagina.pdf
Error: Unable to find file.

commented

hmmm si probabilmente ho cambiato il codice nel frattempo

quando hai eseguito il comando che ti da il merge.js hai cambiato la cartella con cd temp?

commented

Ho deciso di fare un aggiornamento, se scarichi di nuovo tutto puoi eseguire node index.js --pdftk e dovrebbe fare tutto da solo

Ti confermo che avevo eseguito tutto correttamente, anche spostarmi nella cartella temp prima di eseguire il comando merge.js.

Comunque grazie mille per il supporto e per l'aggiornamento, ora funziona alla perfezione!