pdfgrabber icon indicating copy to clipboard operation
pdfgrabber copied to clipboard

Pearson Reader+: `StopIteration` at Extracting epub

Open BigB84 opened this issue 1 year ago • 4 comments

Hi!

Thanks so much for this tool!

I encouraged an error while downloading coursebook from Pearson Reader+

Environment Info

  • OS: ArchLinux
  • python: 3.11.6
  • run from venv with requirements installed by pip
  • MuPDF and chromium installed from arch repo
  • This happens in d6e5631 commit latest at the time of writing issue (and at least one previous)
Select a book or a comma-separated list of books: 0
Extracting epub ━━━━━━━━━━━━╺━━━━━━━━━━━━━━━━━━━━━━━━━━━  31% -:--:--
Traceback (most recent call last):
  File "pdfgrabber/main.py", line 271, in <module>
    main()
  File "pdfgrabber/main.py", line 253, in main
    downloadbook()
  File "pdfgrabber/main.py", line 174, in downloadbook
    pdfpath = utils.downloadbook(service, token, bookid, books[bookid], progressfun)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pdfgrabber/utils.py", line 42, in downloadbook
    pdf = service.downloadbook(token, bookid, data, progress)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pdfgrabber/services/prs.py", line 364, in downloadbook
    pdf = downloadrplusepub(data["url"], data["pwd"], progress)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pdfgrabber/services/prs.py", line 321, in downloadrplusepub
    tocitem = next(i for i in tocfile.find("xhtml:body", ns).findall("xhtml:nav", ns) if i.get("{http://www.idpf.org/2007/ops}type") == "toc")
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
StopIteration

Could you help me plz? How should I debug it?

BigB84 avatar Jan 16 '24 01:01 BigB84