apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.38k stars 1.48k forks source link

Unable to import KFX format ebooks using the DeDRM plugin #492

Open CJShahmeran opened 6 years ago

CJShahmeran commented 6 years ago

I am not able to import Amazon KFX format ebooks into calibre using the DeDRM plugin. The ebooks were all purchased directly from Amazon. Per the plugin readme file, I installed an earlier version of Kindle for PC to prevent downloads of the new format. Calibre still recognizes the KFX format.

calibre version 3.21.0 DeDRM tool 6.6.0 Kindle for PC 1.16.0 Windows 8.1


calibre Debug log calibre 3.21 embedded-python: True is64bit: False Windows-8.1-6.3.9600-SP0 Windows ('32bit', 'WindowsPE') 32bit process running on 64bit windows ('Windows', '8.1', '6.3.9600') Python 2.7.12+ Windows: ('8.1', '6.3.9600', 'SP0', u'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: DeDRM (6, 6, 0) calibre 3.21 embedded-python: True is64bit: False Windows-8.1-6.3.9600-SP0 Windows ('32bit', 'WindowsPE') 32bit process running on 64bit windows ('Windows', '8.1', '6.3.9600') Python 2.7.12+ Windows: ('8.1', '6.3.9600', 'SP0', u'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: DeDRM (6, 6, 0) Turning on automatic hidpi scaling devicePixelRatio: 1.0 logicalDpi: 96.0 x 96.0 physicalDpi: 106.387434555 x 106.822429907 Using calibre Qt style: True [0.00] Starting up... [0.08] Showing splash screen... [1.14] splash screen shown [1.14] Initializing db... [1.39] db initialized [1.39] Constructing main UI... [15.38] main UI initialized... [15.38] Hiding splash screen [67.23] splash screen hidden [67.23] Started up in 67.23 seconds with 3 books stdout+stderr from file dialog helper: ['', ''] piped data from file dialog helper: ['\xd9\x1c\xea\x04\xfc\x08\xc6\xdfx\x94\xc8\xc6\xacT\xec\x8f\xa8w\x0c\x8f\x99Y\xb2a\xb5EO\xa2\xb1}\xfc\xc6', 'C:\Users\admin\Documents\My Kindle Content\B00OZHQF8K_EBOK\B00OZHQF8K_EBOK.azw'] DeDRM v6.6.0: Trying to decrypt B00OZHQF8K_EBOK.azw Using Library AlfCrypto Python DeDRM v6.6.0: 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 v6.6.0: Looking for new default Kindle Key after 0.9 seconds searching for kinfoFiles in C:\Users\admin\AppData\Local Found K4PC 1.9+ kinf2011 file: C:\Users\admin\AppData\Local\Amazon\Kindle\storage.kinf2011 Decrypted key file using IDString '4196248227' and UserName '61646d696e' DeDRM v6.6.0: Found 1 new key DeDRM v6.6.0: Ultimately failed to decrypt after 1.5 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 "site-packages\calibre\customize\ui.py", line 171, in _run_filetype_plugins File "calibre_plugins.dedrm.init", line 620, in run File "calibre_plugins.dedrm.init", line 570, in KindleMobiDecrypt DeDRMError: DeDRM v6.6.0: Ultimately failed to decrypt after 1.5 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md Traceback (most recent call last): File "site-packages\calibre\customize\ui.py", line 417, in get_file_type_metadata File "site-packages\calibre\customize\builtins.py", line 284, in get_metadata File "site-packages\calibre\ebooks\metadata\mobi.py", line 494, in get_metadata File "site-packages\calibre\ebooks\mobi\reader\headers.py", line 284, in init File "site-packages\calibre\ebooks\mobi\reader\headers.py", line 312, in identity MobiError: Unknown book type: ¢ÄޝŒ Added B00OZHQF8K EBOK to db in: 4.0 Added 1 books in 16.0 seconds

j-howell commented 6 years ago

If you reverted to an older version of Kindle for PC then you need to delete any books that were downloaded using the newer version and re-download them. That will allow you to avoid KFX.

If you want to import a KFX book anyway then you also need to install the optional KFX Input plugin for calibre. Calibre does not support KFX unless that plugin is installed.

CJShahmeran commented 6 years ago

When I uninstalled the current version of KIndle for PC and installed the older version, my books were deleted. I had to go to the Amazon website and re-download each of them. I'm just getting started with ebooks, so only have a few so far. I changed Kindle app versions before installing calibre and the plugin, so there was nothing to clean up in calibre.

Which calibre plugin are you referring to? The only one I installed was the DeDRM tool. Is there another?

ElleKayEm commented 6 years ago

People have reported that unchecking the auto-update in Kindle for PC doesn't always stick at first. The book in this log is a KFX file. If you want to decrypt that, the other plugin you need is the KFX Input plugin.

cemeyer commented 6 years ago

@CJShahmeran Here's the relevant log message:

DeDRM v6.6.0: Failed to decrypt with error: The .kfx DRMION file cannot be decrypted by itself. A .kfx-zip archive containing a DRM voucher is required.

You are attempting to import a KFX file.

Currently, the DeDRM plugin only supports zip archives (so-called ".kfx-zip" files) containing both the KFX .azw and the voucher file. I don't recall how those are supposed to be generated. I think the KFX Input plugin does it.

The KFX input plugin is separate, link here.