noDRM / DeDRM_tools

DeDRM tools for ebooks
7.15k stars 321 forks source link

Problems with decrypting .azw (kindle for pc) - I think I'm missing something ! (Solved) #72

Open iainrs opened 2 years ago

iainrs commented 2 years ago

Question / bug report

I'm trying to run DeDRM on Kindle .azw files. (I was successful until about 2 years ago when things changed). I've installed latest versions of Calibre, DeDrm and Kindle for PC 1.33. I'm left with the .B00..._EBOK.azw file in Calibre which will not read.

The attached log file (nodrm_dedrm.txt) gives details and refers to ' a default Kindle Key' I've listed contents of ../B004UJAN68 at start of log file nodrm_dedrm.txt

I'm not sure what else I should be doing.

Which version of Calibre are you running?

5.42

Which version of the DeDRM plugin are you running?

10.0.2

If applicable, which version of the Kindle software are you running?

No response

Log output


Paste log output here.
`Linux – Mint XFCE
System:    Kernel: 5.4.0-109-generic x86_64 bits: 64 compiler: gcc v: 9.4.0 Desktop: Xfce 4.16.0
           tk: Gtk 3.24.20 wm: xfwm4 dm: LightDM Distro: Linux Mint 20.3 Una
           base: Ubuntu 20.04 focal

Windows running under Virtual -box :
“VirtualBox Graphical User Interface Version 6.1.32_Ubuntu r149290
© 2004-2022 Oracle Corporation (Qt5.12.8)
Copyright © 2022 Oracle Corporation and/or its affiliates. All rights reserved.”

contents of kindle folder
/home/iain/Data/iain/bridge/kindle1_17/B004UJAN68_EBOK/amzn1.drm-voucher.v1.2e581714-45f3-40f9-b400-7af1106faa99.voucher
/home/iain/Data/iain/bridge/kindle1_17/B004UJAN68_EBOK/B004UJAN68_EBOK.azw
/home/iain/Data/iain/bridge/kindle1_17/B004UJAN68_EBOK/B004UJAN68_EBOK.mbpV2
/home/iain/Data/iain/bridge/kindle1_17/B004UJAN68_EBOK/B004UJAN68_EBOK.phl
/home/iain/Data/iain/bridge/kindle1_17/B004UJAN68_EBOK/CR!6KM0WMABJS0MS0JV8KESDC6Z15RM.azw.md

calibre Debug log
calibre 5.42 [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: en_GB
Successfully initialized third party plugins: DeDRM (10, 0, 2)
calibre 5.42 [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: en_GB
Successfully initialized third party plugins: DeDRM (10, 0, 2)
Turning on automatic hidpi scaling
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 95.905604719764 x 95.97638376383763
Using calibre Qt style: True
[0.00] Starting up...
[0.00] Showing splash screen...
[2.03] splash screen shown
[2.03] Initializing db...
[2.30] db initialized
[2.30] Constructing main UI...
[3.91] main UI initialized...
[3.91] Hiding splash screen
Starting QuickView
DeDRM v10.0.2: Trying to decrypt B004UJAN68_EBOK.azw
Using Library AlfCrypto DLL/DYLIB/SO
Using Library AlfCrypto DLL/DYLIB/SO
DeDRM v10.0.2: 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 v10.0.2: Looking for new default Kindle Key after 0.2 seconds
searching for kinfoFiles in C:\Users\iain\AppData\Local
Found K4PC 1.25+ kinf2018 file: C:\Users\iain\AppData\Local\Amazon\Kindle\storage\.kinf2018
[16.62] splash screen hidden
[16.62] Started up in 16.62 seconds with 40 books
stdout+stderr from file dialog helper: [b'', b'']
piped data from file dialog helper: [b'f\xc1\xe6\x7f\\\x83\xa4\xc8f\xd2\x88\xb2\xb7\x13`\xad\xa3%\xe1\\\x97%Z\x06\xba\x0f\xcf6\xe3\x07\xad\xca', b'E:\\kindle1_17\\B004UJAN68_EBOK\\B004UJAN68_EBOK.azw']
Decrypted key file using IDString '2566718996' and UserName 'iain'
DeDRM v10.0.2: Found 1 new key
DeDRM v10.0.2: Ultimately failed to decrypt after 8.2 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 795, in KindleMobiDecrypt
  File "calibre_plugins.dedrm.k4mobidedrm", line 214, 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 888, in run
  File "calibre_plugins.dedrm.__init__", line 838, in KindleMobiDecrypt
calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.2: Ultimately failed to decrypt after 8.2 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 B004UJAN68 EBOK to db in: 2.0
Added 1 books in 11.0 seconds
ElleKayEm commented 2 years ago

You've got KFX format. Those can only be decrypted if they're downloaded with Kindle for PC 1.26 or earlier. But I recommended using one of the methods to get the older formats. See this post: https://www.mobileread.com/forums/showthread.php?t=283371