NoMod-Programming / PearsonEbookDownloader

Downloads E-Books "eText" from Pearson as a PDF file
MIT License
115 stars 34 forks source link

MemoryError for large ebooks #20

Closed JolianJorgomes closed 4 years ago

JolianJorgomes commented 4 years ago

Hello I have this problem, MemoryError == I think there is some problems with large ebooks "MemoryError", my ram computer is 2gig.

C:\Users\Administrator\Desktop\PearsonEbookDownloader-master>python downloader.p y 161493 Downloading book id 161493. Please open an issue on GitHub if this book id is in correct. Downloading metadata and eText information... Downloading pages to "C:\Users\ADMINI~1\AppData\Local\Temp\2\tmpak8x8575"... Assembling PDF... Adding bookmarks... Fixing metadata... Writing PDF... Traceback (most recent call last): File "downloader.py", line 225, in <module> main(sys.argv[1]) File "downloader.py", line 219, in main fileMerger.write(outFile) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 482, in write self._sweepIndirectReferences(externalReferenceMap, self._root) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 571, in _sweepIndirectReferences self._sweepIndirectReferences(externMap, realdata) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, value) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 571, in _sweepIndirectReferences self._sweepIndirectReferences(externMap, realdata) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, value) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 556, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, data[i]) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 571, in _sweepIndirectReferences self._sweepIndirectReferences(externMap, realdata) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, value) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 586, in _sweepIndirectReferences newobj = self._sweepIndirectReferences(externMap, newobj) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, value) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, value) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 586, in _sweepIndirectReferences newobj = self._sweepIndirectReferences(externMap, newobj) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, value) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 586, in _sweepIndirectReferences newobj = self._sweepIndirectReferences(externMap, newobj) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, value) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, value) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 586, in _sweepIndirectReferences newobj = self._sweepIndirectReferences(externMap, newobj) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, value) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 586, in _sweepIndirectReferences newobj = self._sweepIndirectReferences(externMap, newobj) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, value) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, value) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 586, in _sweepIndirectReferences newobj = self._sweepIndirectReferences(externMap, newobj) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 547, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, value) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 586, in _sweepIndirectReferences newobj = self._sweepIndirectReferences(externMap, newobj) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 556, in _sweepIndirectReferences value = self._sweepIndirectReferences(externMap, data[i]) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 577, in _sweepIndirectReferences newobj = data.pdf.getObject(data) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\pdf.py", line 1611, in getObject retval = readObject(self.stream, self) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\generic.py", line 66, in readObject return DictionaryObject.readFromStream(stream, pdf) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\generic.py", line 579, in readFromStream value = readObject(stream, pdf) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\generic.py", line 71, in readObject return ArrayObject.readFromStream(stream, pdf) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\generic.py", line 166, in readFromStream arr.append(readObject(stream, pdf)) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\generic.py", line 71, in readObject return ArrayObject.readFromStream(stream, pdf) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38-32\lib\sit e-packages\PyPDF2\generic.py", line 166, in readFromStream arr.append(readObject(stream, pdf)) MemoryError

NoMod-Programming commented 4 years ago

Unfortunately, there's not much I can do at the moment to reduce memory usage by the app, at least not without taking apart the PDF merger and seeing what I can do there (and that's a slippery slope). I'll do my best to look into that and see what I can do, but otherwise, feel free to shoot me an email (my email address is public), and we can look into other options for getting you your book.