apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.56k stars 1.52k forks source link

[QUESTION] Issue importing AZW files to Calibre 5.43 w/ DeDRM 7.2.1 #2072

Open phurious opened 2 years ago

phurious commented 2 years ago

CheckList


Issue importing AZW to Calibre 5.43 w/ DeDRM 7.2.1

I have installed Kindle for PC and downloaded the books I wish to import into Calibre. They are all .AZW files, yet fail to import correctly into Calibre. I do have the DeDRM plugin installed and enabled.

Windows 10

Calibre: 5.43 [64bit]

Kindle: Oasis

DeDRM: 7.2.1

Log

calibre Debug log ``` calibre Debug log calibre 5.43 [64bit] embedded-python: True is64bit: True Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19041') Python 3.8.5 Windows: ('10', '10.0.19041', '', 'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: DeDRM (7, 2, 1) calibre 5.43 [64bit] embedded-python: True is64bit: True Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.19041') Python 3.8.5 Windows: ('10', '10.0.19041', '', 'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: DeDRM (7, 2, 1) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 96.0 x 96.0 physicalDpi: 157.06280193236714 x 160.891495601173 Using calibre Qt style: True [0.00] Starting up... [0.00] Showing splash screen... [0.48] splash screen shown [0.48] Initializing db... [0.48] db initialized [0.48] Constructing main UI... [0.98] main UI initialized... [0.98] Hiding splash screen Starting QuickView DeDRM v7.2.1: Trying to decrypt B015FELXQ0_EBOK.azw Using Library AlfCrypto DLL/DYLIB/SO Using Library AlfCrypto DLL/DYLIB/SO DeDRM v7.2.1: Failed to decrypt with error: The .kfx DRMION file cannot be decrypted by itself. A .kfx-zip archive containing a DRM voucher is required. DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds searching for kinfoFiles in C:\Users\.\AppData\Local Found K4PC 1.25+ kinf2018 file: C:\Users\.\AppData\Local\Amazon\Kindle\storage\.kinf2018 [4.02] splash screen hidden [4.02] Started up in 4.02 seconds with 0 books stdout+stderr from file dialog helper: [b'', b''] piped data from file dialog helper: [b'\x01ux\xe7])\xad\x19\xaf\xe4e9u\x10\xa2\xa0\x1b\xfe+\xcc03\x88-\x9f{\x9ar\xaa\x92\x7f@', b'C:\\Users\\.\\Documents\\My Kindle Content\\B015FELXQ0_EBOK\\B015FELXQ0_EBOK.azw'] Decrypted key file using IDString '178551616' and UserName '.' DeDRM v7.2.1: Found 1 new key DeDRM v7.2.1: Ultimately failed to decrypt after 2.3 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Running file type plugin DeDRM failed with traceback: Traceback (most recent call last): File "calibre_plugins.dedrm.__init__", line 540, in KindleMobiDecrypt File "calibre_plugins.dedrm.k4mobidedrm", line 208, in GetDecryptedBook calibre_plugins.dedrm.k4mobidedrm.DrmException: The .kfx DRMION file cannot be decrypted by itself. A .kfx-zip archive containing a DRM voucher is required. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "calibre\customize\ui.py", line 175, in _run_filetype_plugins File "calibre_plugins.dedrm.__init__", line 633, in run File "calibre_plugins.dedrm.__init__", line 583, in KindleMobiDecrypt calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 2.3 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Traceback (most recent call last): File "calibre\customize\ui.py", line 432, in get_file_type_metadata File "calibre\customize\builtins.py", line 266, in get_metadata File "calibre\ebooks\metadata\mobi.py", line 503, in get_metadata File "calibre\ebooks\mobi\reader\headers.py", line 293, in __init__ File "calibre\ebooks\mobi\reader\headers.py", line 321, in identity calibre.ebooks.mobi.MobiError: Unknown book type: b'\x81\xc4\xde\x02\x9d\xAdded B015FELXQ0 EBOK to db in: 0.1 Added 1 books in 2.7 seconds ```
phurious commented 2 years ago

image image

steppypls commented 2 years ago

I'm having the same issue on my Mac. I was able to successfully bring in one book for some reason with the DRM removed. When I try and convert another one, I get an error saying that the DRM is in place and cannot be converted. I tried to convert again using the de-bug option and this is what was saved to the folder after I ran the report and I don't even know if this is normal or if this is just the intro but

This debug folder contains snapshots of the e-book as it passes through the various stages of conversion. The stages are:

1. input - This is the result of running the input plugin on the source
file. Use this folder to debug the input plugin.

2. parsed - This is the result of preprocessing and parsing the output of
the input plugin. Note that for some input plugins this will be identical to
the input sub-folder. Use this folder to debug structure detection,
etc.

3. structure - This corresponds to the stage in the pipeline when structure
detection has run, but before the CSS is flattened. Use this folder to
debug the CSS flattening, font size conversion, etc.

4. processed - This corresponds to the e-book as it is passed to the output
plugin. Use this folder to debug the output plugin.

I didn't get anything else from the debug report.

ElleKayEm commented 2 years ago

@phurious You're getting KFX format which unless you download it with an earlier version of the Kindle app can't be decrypted. Since you have an Oasis, you could get the older format by using the "download & transfer via usb" option on your content and devices page at Amazon. Choose the Oasis for the device. Enter your Oasis serial number into DeDRM's customization.

See details and other methods of avoiding or dealing with KFX format here: https://www.mobileread.com/forums/showthread.php?t=283371

ElleKayEm commented 2 years ago

@steppypls Here's how to get a log: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md#i-cannot-solve-my-problem-with-the-dedrm-plugin-and-now-i-need-to-post-a-log-how-do-i-do-that