noDRM / DeDRM_tools

DeDRM tools for ebooks
7.37k stars 324 forks source link

Cannot DeDRM kindle book #496

Open jabondo opened 9 months ago

jabondo commented 9 months ago

Question / bug report

Downloaded kindle book into kindle classic on Macbook Pro - Ventura 13.6.4. Using Calibre 6.29.0

Which version of Calibre are you running?

6.29

Which version of the DeDRM plugin are you running?

10.0.9

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

Kindle Classic 1.40.3

Log output

Using calibre Qt style: True
ApplicationPaletteChange event received
ApplicationPaletteChange event received
ApplicationPaletteChange event received
ApplicationPaletteChange event received
ApplicationPaletteChange event received
ApplicationPaletteChange event received
ApplicationPaletteChange event received
ApplicationPaletteChange event received
ApplicationPaletteChange event received
ApplicationPaletteChange event received
ApplicationPaletteChange event received
ApplicationPaletteChange event received
ApplicationPaletteChange event received
ApplicationPaletteChange event received
qt.gui.imageio: libpng warning: iCCP: known incorrect sRGB profile
calibre Debug log
calibre 6.29  embedded-python: True
macOS-13.6.4-arm64-arm-64bit Darwin ('64bit', '')
('Darwin', '22.6.0', 'Darwin Kernel Version 22.6.0: Sun Dec 17 22:13:25 PST 2023; root:xnu-8796.141.3.703.2~2/RELEASE_ARM64_T6020')
Python 3.10.1
OSX: ('13.6.4', ('', '', ''), 'arm64')
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 8, 1) && DeDRM (10, 0, 9) && Package KFX (from KFX Input) (2, 8, 1) && KFX metadata reader (from KFX Input) (2, 8, 1) && From KFX (2, 8, 1) && KFX Input (2, 8, 1) && Set KFX metadata (from KFX Output) (2, 6, 1) && KFX Output (2, 6, 1) && Obok DeDRM (10, 0, 9) && ePub Extended Metadata {Writer} (0, 11, 2) && ePub Extended Metadata {Reader} (0, 11, 2) && ePub Extended Metadata (0, 11, 2)
calibre 6.29  embedded-python: True
macOS-13.6.4-arm64-arm-64bit Darwin ('64bit', '')
('Darwin', '22.6.0', 'Darwin Kernel Version 22.6.0: Sun Dec 17 22:13:25 PST 2023; root:xnu-8796.141.3.703.2~2/RELEASE_ARM64_T6020')
Python 3.10.1
OSX: ('13.6.4', ('', '', ''), 'arm64')
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 8, 1) && DeDRM (10, 0, 9) && Package KFX (from KFX Input) (2, 8, 1) && KFX metadata reader (from KFX Input) (2, 8, 1) && From KFX (2, 8, 1) && KFX Input (2, 8, 1) && Set KFX metadata (from KFX Output) (2, 6, 1) && KFX Output (2, 6, 1) && Obok DeDRM (10, 0, 9) && ePub Extended Metadata {Writer} (0, 11, 2) && ePub Extended Metadata {Reader} (0, 11, 2) && ePub Extended Metadata (0, 11, 2)
QPA platform: cocoa
devicePixelRatio: 2.0
logicalDpi: 72.0 x 72.0
physicalDpi: 127.50000191485792 x 127.50000191485789
[0.00] Starting up...
[0.03] Showing splash screen...
[0.18] splash screen shown
[0.18] Initializing db...
[0.41] db initialized
[0.41] Constructing main UI...
DEBUG:    0.0 obok::utilities.py - loading translations
DEBUG:    0.0 obok::dialogs.py - loading translations
DEBUG:    0.0 obok::config.py - loading translations
DEBUG:    0.0 obok::action_err.py - loading translations
[1.18] main UI initialized...
[1.18] Hiding splash screen
Starting QuickView
Gather KFX-ZIP (from KFX Input) 2.8.1: Importing /Users/smithsonmusic/Desktop/B08YY5WQN3_EBOK.azw
Gather KFX-ZIP (from KFX Input): Cannot locate some files needed for the book. KFX files must remain in their original folder structure for successful import. 
Gather KFX-ZIP (from KFX Input): Gathered 1 file(s) as /var/folders/qx/rjd9yqps2sdbt0r_6bs84d4h0000gn/C/calibre_6.29.0_tmp_72on1g_a/6xeaah8j.kfx-zip
DeDRM v10.0.9: Trying to decrypt 6xeaah8j.kfx-zip
Decrypting KFX-ZIP ebook: 6xeaah8j
Found 0 keys to try after 0.2 seconds
DeDRM v10.0.9: Failed to decrypt with error: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher
DeDRM v10.0.9: Looking for new default Kindle Key after 0.2 seconds
Found k4Mac kinf2018 file: /Users/smithsonmusic/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2018
trying username  b'smithsonmusic'  on file  /Users/smithsonmusic/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2018
trying IDString: b'57714ab460a7'
trying IDString: b'57714ab460a6'
trying IDString: b'57714ab460a1'
trying IDString: b'938dae2949e5'
trying IDString: b'f94cbb1220c0'
Decrypted key file using IDString 'f94cbb1220c0' and UserName 'smithsonmusic'
DeDRM v10.0.9: Found 1 new key
Decrypting KFX-ZIP ebook: 6xeaah8j
Got DSN key from database key_0
Found 1 keys to try after 0.8 seconds
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 931, in KindleMobiDecrypt
    book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime)
  File "/Users/smithsonmusic/Library/Preferences/calibre/plugins/DeDRM.zip/k4mobidedrm.py", line 203, in GetDecryptedBook
    mb.processBook(totalpids)
  File "/Users/smithsonmusic/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 67, in processBook
    self.decrypt_voucher(totalpids)
  File "/Users/smithsonmusic/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 88, in decrypt_voucher
    raise Exception("The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher")
Exception: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 965, in KindleMobiDecrypt
    book = k4mobidedrm.GetDecryptedBook(path_to_ebook,newkeys.items(),[],[],[],self.starttime)
  File "/Users/smithsonmusic/Library/Preferences/calibre/plugins/DeDRM.zip/k4mobidedrm.py", line 203, in GetDecryptedBook
    mb.processBook(totalpids)
  File "/Users/smithsonmusic/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 67, in processBook
    self.decrypt_voucher(totalpids)
  File "/Users/smithsonmusic/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 88, in decrypt_voucher
    raise Exception("The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher")
Exception: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher
DeDRM v10.0.9: Ultimately failed to decrypt after 0.8 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/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 931, in KindleMobiDecrypt
    book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime)
  File "/Users/smithsonmusic/Library/Preferences/calibre/plugins/DeDRM.zip/k4mobidedrm.py", line 203, in GetDecryptedBook
    mb.processBook(totalpids)
  File "/Users/smithsonmusic/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 67, in processBook
    self.decrypt_voucher(totalpids)
  File "/Users/smithsonmusic/Library/Preferences/calibre/plugins/DeDRM.zip/kfxdedrm.py", line 88, in decrypt_voucher
    raise Exception("The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher")
Exception: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre/customize/ui.py", line 187, in _run_filetype_plugins
  File "calibre_plugins.dedrm.__init__", line 1030, in run
    decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
  File "calibre_plugins.dedrm.__init__", line 981, in KindleMobiDecrypt
    raise DeDRMError("{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md".format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime))
calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.9: Ultimately failed to decrypt after 0.8 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md
Package KFX (from KFX Input) 2.8.1: Packaging /var/folders/qx/rjd9yqps2sdbt0r_6bs84d4h0000gn/C/calibre_6.29.0_tmp_72on1g_a/6xeaah8j.kfx-zip
Processing container: B08YY5WQN3_EBOK.azw
Running file type plugin Package KFX (from KFX Input) failed with traceback:
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 187, in _run_filetype_plugins
  File "calibre_plugins.kfx_input.package_filetype", line 23, in run
    return self.package_kfx(path_to_ebook)
  File "calibre_plugins.kfx_input.package_filetype", line 34, in package_kfx
    kfx_data = YJ_Book(path_to_ebook).convert_to_single_kfx()
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 79, in convert_to_single_kfx
    self.decode_book()
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 212, in decode_book
    container = self.get_container(datafile)
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 321, in get_container
    raise KFXDRMError("Book container %s has DRM and cannot be converted" % datafile.name)
calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container B08YY5WQN3_EBOK.azw has DRM and cannot be converted
KFX metadata reader (from KFX Input) activated for /var/folders/qx/rjd9yqps2sdbt0r_6bs84d4h0000gn/C/calibre_6.29.0_tmp_72on1g_a/45v5e6ny_add_books/0/B08YY5WQN3_EBOK.kfx-zip
Traceback (most recent call last):
  File "calibre/customize/ui.py", line 469, in get_file_type_metadata
  File "calibre_plugins.kfx_input.metadata_reader", line 28, in get_metadata
    md = YJ_Book(stream).get_metadata()
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 150, in get_metadata
    raise Exception("Failed to locate a KFX container with metadata")
Exception: Failed to locate a KFX container with metadata
[15.03] splash screen hidden
[15.03] Started up in 15.03 seconds with 14466 books
Added B08YY5WQN3 EBOK to db in: 0.0
Added 1 books in 1.2 seconds
ElleKayEm commented 9 months ago

KFX Input gave this error: Cannot locate some files needed for the book. KFX files must remain in their original folder structure for successful import.