Error: Could Not Open ebook (.azw4)

Bug #1713157 reported by elias
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Invalid
Undecided
Unassigned

Bug Description

[Environment]

Calibre Version: 3.7.0 (installed via script provided on official website)
OS: Ubuntu, 16.04
Fresh install of Calibre, no plugins installed (other than those that come pre-installed, if any).

[Description]

Calibre is not capable of opening my kindle book of the .azw4 format and gives the following error. The book is imported as normal via `add books`, selecting the given book, and it imports with no reported errors. The error is purely from attempting to view/read it. Calibre does see its metadata just fine, however, listing author, publisher, title, and filetype accurately. Looking at the report below, it's giving off a conversion error which confuses me since I don't know why it is attempting to convert the book to start with unless this is expected Calibre behavior for a .azw4 book.

Looking further into this (using alternative converters, etc), it appears that Amazon has set restrictions on the file so that the file cannot be viewed in any client minus the official desktop apps for windows, mac and the ios/android apps. My amazon paperwhite is similarly non-compatible with this file and Amazon will not let me even download it. Neither is the cloud browser allowed to view it. Native apps only, in other words.

.azw4 files are (supposed to be) drm wrapped up PDFs essentially and yet the file does not appear to have a pdf(?) which adds to the confusion. Attempts to convert to EPUB, MOBI, or .azw3 have all failed with alternative clients.

[Error Log from ebook-viewer used by Calibre]

calibre, version 3.7.0
ERROR: Could not open e-book: Failed to read book, /home/<redacted>/Desktop/<redacted>.azw4 click "Show Details" for more information

Traceback (most recent call last):
  File "site-packages/calibre/utils/ipc/simple_worker.py", line 284, in main
  File "site-packages/calibre/ebooks/oeb/iterator/book.py", line 64, in extract_book
  File "site-packages/calibre/customize/conversion.py", line 245, in __call__
  File "site-packages/calibre/ebooks/conversion/plugins/azw4_input.py", line 26, in convert
  File "site-packages/calibre/ebooks/azw4/reader.py", line 57, in extract_content
  File "site-packages/calibre/ebooks/conversion/plugins/pdf_input.py", line 51, in convert
  File "site-packages/calibre/ebooks/pdf/pdftohtml.py", line 92, in pdftohtml
ConversionError: pdftohtml failed with return code: 1
Syntax Warning: May not be a PDF file (continuing anyway)
Syntax Error: Couldn't find trailer dictionary
Syntax Error: Couldn't find trailer dictionary
Syntax Error: Couldn't read xref table

elias (ejmg)
description: updated
Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1713157

I do not provide support for people using distro provided packages. If you are using a distro provided package, uninstall it and install the official calibre binary from https://calibre-ebook.com/download_linux and if you can reproduce the bug with that, re-open the ticket. Of course, if you are already using the official binary, apologies and feel free to re-open the ticket immediately :)

 status invalid

Changed in calibre:
status: New → Invalid
Revision history for this message
elias (ejmg) wrote :

My mistake, I have uninstalled apt's version and installed using the script provided on the website. I still receive an error and cannot view the .awz4 file as it is, though the error is fundamentally different (and per my research, is much more close to the problem at hand). I have updated the error log in the post to reflect this.

description: updated
Revision history for this message
elias (ejmg) wrote :

I have a creeping feeling this may be a another iteration of Amazon's new drm formats/controls being put out recently and that this is something we are helpless to fix until someone finds a way to view this "new" format.

description: updated
Changed in calibre:
status: Invalid → New
description: updated
Revision history for this message
Kovid Goyal (kovid) wrote :

AZW4 files are typically PDF files inside a MOBI wrapper.

Your particular azw4 file does not seem to be that. If you attach it I can take a look at it to see what it actually is.

Kovid Goyal (kovid)
Changed in calibre:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.