apprenticeharper / DeDRM_tools

DeDRM tools for ebooks
14.53k stars 1.51k forks source link

Kindle for Mac - DrmException: No key found in 4 PIDs tried. #1675

Open shanemcquillan opened 3 years ago

shanemcquillan commented 3 years ago

Hi Folks. I'm seeing the following errors when trying to import a book from Kindle for Mac. I've tried versions 1.28, 1.29, 1.30, and 1.31 of K4M (I've also ran chmod -x /Applications/Kindle.app/Contents/MacOS/renderer-test on each), and I'm on the latest version of DeDRM and Calibre (5.16.1 and 7.2.1 respectively)

Any ideas? Happy to go through additional debug steps if it would help.

calibre Debug log
calibre 5.16.1  embedded-python: True is64bit: True
macOS-10.16-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '20.3.0', 'Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101')
Python 3.8.5
OSX: ('10.16', ('', '', ''), 'x86_64')
Interface language: None
Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
calibre 5.16.1  embedded-python: True is64bit: True
macOS-10.16-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '20.3.0', 'Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101')
Python 3.8.5
OSX: ('10.16', ('', '', ''), 'x86_64')
Interface language: None
Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
devicePixelRatio: 2.0
logicalDpi: 72.0 x 72.0
physicalDpi: 127.50000191485789 x 127.50000191485789
Using calibre Qt style: True
[0.00] Starting up...
[0.02] Showing splash screen...
[0.24] splash screen shown
[0.24] Initializing db...
[0.25] db initialized
[0.25] 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
[0.96] main UI initialized...
[0.96] Hiding splash screen
Starting QuickView
DeDRM v7.2.1: Trying to decrypt B0080K3J7S_EBOK.azw
Using Library AlfCrypto Python
Using Library AlfCrypto Python
MobiDeDrm v1.0.
Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
Decrypting Kindle Format 8 ebook: Cryptonomicon
Got SerialNumber from database default_key
Got UsernameHash from database default_key
Found 4 keys to try after 0.1 seconds
Crypto Type is: 2
DeDRM v7.2.1: Failed to decrypt with error: No key found in 4 PIDs tried.
DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
Found k4Mac kinf2018 file: /Users/shane/Library/Application Support/Kindle/storage/.kinf2018
trying username  b'shane'  on file  /Users/shane/Library/Application Support/Kindle/storage/.kinf2018
trying IDString: b'bba4a5ae9385'
trying IDString: b'bba4a5ae9384'
trying IDString: b'e190264a41c3'
[7.30] splash screen hidden
[7.30] Started up in 7.30 seconds with 68 books
Decrypted key file using IDString 'e190264a41c3' and UserName 'shane'
DeDRM v7.2.1: Found 1 new key
MobiDeDrm v1.0.
Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
Decrypting Kindle Format 8 ebook: Cryptonomicon
Got SerialNumber from database default_key_1
Got UsernameHash from database default_key_1
Found 4 keys to try after 1.2 seconds
Crypto Type is: 2
DeDRM v7.2.1: Ultimately failed to decrypt after 1.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 540, in KindleMobiDecrypt
    book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime)
  File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook
    mb.processBook(totalpids)
  File "calibre_plugins.dedrm.mobidedrm", line 484, in processBook
    raise DrmException("No key found in {0:d} PIDs tried.".format(len(goodpids)))
calibre_plugins.dedrm.mobidedrm.DrmException: No key found in 4 PIDs tried.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre/customize/ui.py", line 176, in _run_filetype_plugins
  File "calibre_plugins.dedrm.__init__", line 633, in run
    decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
  File "calibre_plugins.dedrm.__init__", line 583, in KindleMobiDecrypt
    raise DeDRMError("{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md".format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime))
calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 1.2 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
Added Cryptonomicon to db in: 0.0
Added 1 books in 1.7 seconds
Worker Launch took: 0.03 seconds
Job: 0 Convert book 1 of 1 (Cryptonomicon) finished
Convert book 1 of 1 (Cryptonomicon)
    DeDRM v7.2.1: Trying to decrypt yt5die5t.azw
    Using Library AlfCrypto Python
    Using Library AlfCrypto Python
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Cryptonomicon
    Got SerialNumber from database default_key
    Got UsernameHash from database default_key
    Found 4 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Failed to decrypt with error: No key found in 4 PIDs tried.
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    Found k4Mac kinf2018 file: /Users/shane/Library/Application Support/Kindle/storage/.kinf2018
    trying username  b'shane'  on file  /Users/shane/Library/Application Support/Kindle/storage/.kinf2018
    trying IDString: b'bba4a5ae9385'
    trying IDString: b'bba4a5ae9384'
    trying IDString: b'e190264a41c3'
    Decrypted key file using IDString 'e190264a41c3' and UserName 'shane'
    DeDRM v7.2.1: Found 1 new key
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Cryptonomicon
    Got SerialNumber from database default_key_1
    Got UsernameHash from database default_key_1
    Found 4 keys to try after 1.2 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Ultimately failed to decrypt after 1.2 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Conversion options changed from defaults:
      verbose: 2
      cover: '/var/folders/t8/0611gbp566939v49k6dfqxsw0000gp/C/calibre_5.16.1_tmp_96grgkdd/r3o3gfvd.jpeg'
      output_profile: 'kindle'
      read_metadata_from_opf: '/var/folders/t8/0611gbp566939v49k6dfqxsw0000gp/C/calibre_5.16.1_tmp_96grgkdd/tu5zl72y.opf'
    Resolved conversion options
    calibre version: 5.16.1
    {'asciiize': False,
     'author_sort': None,
     'authors': None,
     'base_font_size': 0.0,
     'book_producer': None,
     'change_justification': 'original',
     'chapter': "//*[((name()='h1' or name()='h2') and re:test(., "
                "'\\s*((chapter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))', "
                "'i')) or @class = 'chapter']",
     'chapter_mark': 'pagebreak',
     'comments': None,
     'cover': '/var/folders/t8/0611gbp566939v49k6dfqxsw0000gp/C/calibre_5.16.1_tmp_96grgkdd/r3o3gfvd.jpeg',
     'debug_pipeline': None,
     'dehyphenate': True,
     'delete_blank_paragraphs': True,
     'disable_font_rescaling': False,
     'dont_compress': False,
     'duplicate_links_in_toc': False,
     'embed_all_fonts': False,
     'embed_font_family': None,
     'enable_heuristics': False,
     'expand_css': False,
     'extra_css': None,
     'extract_to': None,
     'filter_css': '',
     'fix_indents': True,
     'font_size_mapping': None,
     'format_scene_breaks': True,
     'html_unwrap_factor': 0.4,
     'input_encoding': None,
     'input_profile': <calibre.customize.profiles.InputProfile object at 0x11e2b6190>,
     'insert_blank_line': False,
     'insert_blank_line_size': 0.5,
     'insert_metadata': False,
     'isbn': None,
     'italicize_common_cases': True,
     'keep_ligatures': False,
     'language': None,
     'level1_toc': None,
     'level2_toc': None,
     'level3_toc': None,
     'line_height': 0.0,
     'linearize_tables': False,
     'margin_bottom': 5.0,
     'margin_left': 5.0,
     'margin_right': 5.0,
     'margin_top': 5.0,
     'markup_chapter_headings': True,
     'max_toc_links': 50,
     'minimum_line_height': 120.0,
     'mobi_file_type': 'old',
     'mobi_ignore_margins': False,
     'mobi_keep_original_images': False,
     'mobi_toc_at_start': False,
     'no_chapters_in_toc': False,
     'no_inline_navbars': True,
     'no_inline_toc': False,
     'output_profile': <calibre.customize.profiles.KindleOutput object at 0x11e2b6700>,
     'page_breaks_before': "//*[name()='h1' or name()='h2']",
     'personal_doc': '[PDOC]',
     'prefer_author_sort': False,
     'prefer_metadata_cover': False,
     'pretty_print': False,
     'pubdate': None,
     'publisher': None,
     'rating': None,
     'read_metadata_from_opf': '/var/folders/t8/0611gbp566939v49k6dfqxsw0000gp/C/calibre_5.16.1_tmp_96grgkdd/tu5zl72y.opf',
     'remove_fake_margins': True,
     'remove_first_image': False,
     'remove_paragraph_spacing': False,
     'remove_paragraph_spacing_indent_size': 1.5,
     'renumber_headings': True,
     'replace_scene_breaks': '',
     'search_replace': '[]',
     'series': None,
     'series_index': None,
     'share_not_sync': False,
     'smarten_punctuation': False,
     'sr1_replace': None,
     'sr1_search': None,
     'sr2_replace': None,
     'sr2_search': None,
     'sr3_replace': None,
     'sr3_search': None,
     'start_reading_at': None,
     'subset_embedded_fonts': False,
     'tags': None,
     'timestamp': None,
     'title': None,
     'title_sort': None,
     'toc_filter': None,
     'toc_threshold': 6,
     'toc_title': None,
     'transform_css_rules': '[]',
     'unsmarten_punctuation': False,
     'unwrap_lines': True,
     'use_auto_toc': False,
     'verbose': 2}
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.__init__", line 540, in KindleMobiDecrypt
        book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime)
      File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook
        mb.processBook(totalpids)
      File "calibre_plugins.dedrm.mobidedrm", line 484, in processBook
        raise DrmException("No key found in {0:d} PIDs tried.".format(len(goodpids)))
    calibre_plugins.dedrm.mobidedrm.DrmException: No key found in 4 PIDs tried.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "calibre/customize/ui.py", line 176, in _run_filetype_plugins
      File "calibre_plugins.dedrm.__init__", line 633, in run
        decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
      File "calibre_plugins.dedrm.__init__", line 583, in KindleMobiDecrypt
        raise DeDRMError("{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md".format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime))
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 1.2 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    DeDRM v7.2.1: Trying to decrypt yt5die5t.azw
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Cryptonomicon
    Got SerialNumber from database default_key
    Got UsernameHash from database default_key
    Found 4 keys to try after 0.0 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Failed to decrypt with error: No key found in 4 PIDs tried.
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.0 seconds
    Found k4Mac kinf2018 file: /Users/shane/Library/Application Support/Kindle/storage/.kinf2018
    trying username  b'shane'  on file  /Users/shane/Library/Application Support/Kindle/storage/.kinf2018
    trying IDString: b'bba4a5ae9385'
    trying IDString: b'bba4a5ae9384'
    trying IDString: b'e190264a41c3'
    Decrypted key file using IDString 'e190264a41c3' and UserName 'shane'
    DeDRM v7.2.1: Found 1 new key
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: Cryptonomicon
    Got SerialNumber from database default_key_1
    Got UsernameHash from database default_key_1
    Found 4 keys to try after 1.2 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Ultimately failed to decrypt after 1.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 540, in KindleMobiDecrypt
        book = k4mobidedrm.GetDecryptedBook(path_to_ebook,kindleDatabases,androidFiles,serials,pids,self.starttime)
      File "calibre_plugins.dedrm.k4mobidedrm", line 238, in GetDecryptedBook
        mb.processBook(totalpids)
      File "calibre_plugins.dedrm.mobidedrm", line 484, in processBook
        raise DrmException("No key found in {0:d} PIDs tried.".format(len(goodpids)))
    calibre_plugins.dedrm.mobidedrm.DrmException: No key found in 4 PIDs tried.

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "calibre/customize/ui.py", line 176, in _run_filetype_plugins
      File "calibre_plugins.dedrm.__init__", line 633, in run
        decrypted_ebook = self.KindleMobiDecrypt(path_to_ebook)
      File "calibre_plugins.dedrm.__init__", line 583, in KindleMobiDecrypt
        raise DeDRMError("{0} v{1}: Ultimately failed to decrypt after {2:.1f} seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md".format(PLUGIN_NAME, PLUGIN_VERSION,time.time()-self.starttime))
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 1.2 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    InputFormatPlugin: MOBI Input running
    on /var/folders/t8/0611gbp566939v49k6dfqxsw0000gp/C/calibre_5.16.1_tmp_96grgkdd/yt5die5t.azw
    Found KF8 MOBI of type 'standalone'
    Traceback (most recent call last):
      File "runpy.py", line 194, in _run_module_as_main
      File "runpy.py", line 87, in _run_code
      File "site.py", line 39, in <module>
      File "site.py", line 35, in main
      File "calibre/utils/ipc/worker.py", line 216, in main
      File "calibre/gui2/convert/gui_conversion.py", line 41, in gui_convert_override
      File "calibre/gui2/convert/gui_conversion.py", line 28, in gui_convert
      File "calibre/ebooks/conversion/plumber.py", line 1105, in run
      File "calibre/customize/conversion.py", line 245, in __call__
      File "calibre/ebooks/conversion/plugins/mobi_input.py", line 47, in convert
      File "calibre/ebooks/mobi/reader/mobi8.py", line 86, in __call__
      File "calibre/ebooks/mobi/reader/mobi6.py", line 158, in check_for_drm
    calibre.ebooks.DRMError: Cryptonomicon
ElleKayEm commented 3 years ago

I think DeDRM 7 is still having issues with Big Sur. Try calibre 4.23 and DeDRM 6.8.1.

ZolaLa9 commented 3 years ago

Once you get calibre 4.23 and DeDRM 6.8.1 working (which works for most Big Sur users), try installing calibre 5.x and DeDRM 7.2.1 over that and see if it works then. That has worked for other Big Sur users.

(Please report back if this works for you. It would be helpful to know if using 6.8.1 to get the key solves the problem of 7.2.1 for most (all?) Big Sur users.)

shanemcquillan commented 3 years ago

Thank you for the quick reply @ElleKayEm and @ZolaLa9. I can confirm that the downgrade worked, and reinstalling the newer versions on top of that also worked. Thank you both for the help :)

ElleKayEm commented 3 years ago

Great! Thanks for letting us know.

tbondarchuk commented 3 years ago

This solution with downgrade then upgrade works for me as well, many thanks! (Can provide debug logs if needed.)

Might be worth adding this info to readme perhaps?

ElleKayEm commented 3 years ago

Hopefully a fix will be found so it's not necessary.

nalexiou commented 3 years ago

I downgraded to Calibre 4.23 and 6.8.1. I am still unable to this working. I am on KFM 1.30.0 and have applied the KFX fix. I am on Big Sur 11.2.3. Prior version didn't work either.

Anything else I can try? I am running out of ideas :-(

Here is the log:

alibre Debug log calibre 4.23 embedded-python: True is64bit: True Darwin-20.3.0-x86_64-i386-64bit Darwin ('64bit', '') ('Darwin', '20.3.0', 'Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64') Python 2.7.16 OSX: ('10.16', ('', '', ''), 'x86_64') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && DeDRM (6, 8, 0) && Package KFX (from KFX Input) (1, 39, 0) && Set KFX metadata (from KFX Output) (1, 51, 0) && KFX Output (1, 51, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0) calibre 4.23 embedded-python: True is64bit: True Darwin-20.3.0-x86_64-i386-64bit Darwin ('64bit', '') ('Darwin', '20.3.0', 'Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64') Python 2.7.16 OSX: ('10.16', ('', '', ''), 'x86_64') Interface language: None Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 39, 0) && DeDRM (6, 8, 0) && Package KFX (from KFX Input) (1, 39, 0) && Set KFX metadata (from KFX Output) (1, 51, 0) && KFX Output (1, 51, 0) && KFX metadata reader (from KFX Input) (1, 39, 0) && KFX Input (1, 39, 0) devicePixelRatio: 2.0 logicalDpi: 72.0 x 72.0 physicalDpi: 128.000001922 x 127.500001915 Using calibre Qt style: True [0.00] Starting up... [0.02] Showing splash screen... [0.25] splash screen shown [0.25] Initializing db... [0.26] db initialized [0.26] Constructing main UI... [1.21] main UI initialized... [1.21] Hiding splash screen Gather KFX-ZIP (from KFX Input) 1.39.0: Importing /Users/alexiou/Library/Application Support/Kindle/My Kindle Content/B084T71JWN_EBOK/B084T71JWN_EBOK.azw Gather KFX-ZIP (from KFX Input): File is not KFX format DeDRM v6.8.0: Trying to decrypt B084T71JWN_EBOK.azw Using Library AlfCrypto Python MobiDeDrm v0.42. Copyright © 2008-2017 The Dark Reverser, Apprentice Harper et al. Decrypting Kindle Format 8 ebook: No Home Like Nantucket (A Sweet Island Inn Book 1) Got DSN key from database default_key Got DSN key from database default_key_2 Got DSN key from database default_key_3 Got DSN key from database default_key_4 Got DSN key from database default_key_5 Got DSN key from database default_key_6 Got DSN key from database default_key_7 Found 14 keys to try after 0.1 seconds Crypto Type is: 2 DeDRM v6.8.0: Failed to decrypt with error: No key found in 14 keys tried. DeDRM v6.8.0: Looking for new default Kindle Key after 0.1 seconds DeDRM v6.8.0: Exception when getting default Kindle Key after 0.1 seconds Traceback (most recent call last): File "calibre_plugins.dedrm.init", line 543, in KindleMobiDecrypt File "site-packages/calibre/customize/zipplugin.py", line 185, in load_module File "calibre_plugins.dedrm.kindlekey", line 1283, in File "calibre_plugins.dedrm.kindlekey", line 1278, in _load_crypto File "calibre_plugins.dedrm.kindlekey", line 1191, in _load_crypto_libcrypto TypeError: not all arguments converted during string formatting DeDRM v6.8.0: Ultimately failed to decrypt after 0.1 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 172, in _run_filetype_plugins File "calibre_plugins.dedrm.init", line 626, in run File "calibre_plugins.dedrm.init", line 576, in KindleMobiDecrypt DeDRMError: DeDRM v6.8.0: Ultimately failed to decrypt after 0.1 seconds. Read the FAQs at Harper's repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md [4.28] splash screen hidden [4.28] Started up in 4.28 seconds with 307 books Added No Home Like Nantucket (A Sweet Island Inn Book 1) to db in: 0.0 Added 1 books in 1.0 seconds qt.qpa.window: Window position QRect(-85,53 1370x717) outside any known screen, using primary screen Worker Launch took: 0.1060090065 Job: 0 Convert book 1 of 1 (No Home Like Nantucket (A Sweet Island Inn Book 1)) finished Convert book 1 of 1 (No Home Like Nantucket (A Sweet Island Inn Book 1)) Conversion options changed from defaults: read_metadata_from_opf: u'/var/folders/2l/x8ywqj612999c9twtb138dnm0000gn/C/calibre_4.23.0_tmp_vT98cu/nqS8NX.opf' verbose: 2 output_profile: u'generic_eink' cover: u'/var/folders/2l/x8ywqj612999c9twtb138dnm0000gn/C/calibre_4.23.0_tmp_vT98cu/e291oL.jpeg' Resolved conversion options calibre version: 4.23.0 {'asciiize': False, 'author_sort': None, 'authors': None, 'base_font_size': 0.0, 'book_producer': None, 'change_justification': u'original', 'chapter': u"//[((name()='h1' or name()='h2') and re:test(., '\s((chapter|book|section|part)\s+)|((prolog|prologue|epilogue)(\s+|$))', 'i')) or @class = 'chapter']", 'chapter_mark': u'pagebreak', 'comments': None, 'cover': u'/var/folders/2l/x8ywqj612999c9twtb138dnm0000gn/C/calibre_4.23.0_tmp_vT98cu/e291oL.jpeg', 'debug_pipeline': None, 'dehyphenate': True, 'delete_blank_paragraphs': True, 'disable_font_rescaling': False, 'dont_split_on_page_breaks': False, 'duplicate_links_in_toc': False, 'embed_all_fonts': False, 'embed_font_family': None, 'enable_heuristics': False, 'epub_flatten': False, 'epub_inline_toc': False, 'epub_toc_at_end': False, 'epub_version': u'2', 'expand_css': False, 'extra_css': None, 'extract_to': None, 'filter_css': u'', 'fix_indents': True, 'flow_size': 260, 'font_size_mapping': None, 'format_scene_breaks': True, 'html_unwrap_factor': 0.4, 'input_encoding': None, 'input_profile': <calibre.customize.profiles.InputProfile object at 0x1122a5610>, 'insert_blank_line': False, 'insert_blank_line_size': 0.5, 'insert_metadata': False, 'isbn': None, 'italicize_common_cases': True, 'keep_ligatures': False, 'language': None, 'level1_toc': None, 'level2_toc': None, 'level3_toc': None, 'line_height': 0.0, 'linearize_tables': False, 'margin_bottom': 5.0, 'margin_left': 5.0, 'margin_right': 5.0, 'margin_top': 5.0, 'markup_chapter_headings': True, 'max_toc_links': 50, 'minimum_line_height': 120.0, 'no_chapters_in_toc': False, 'no_default_epub_cover': False, 'no_inline_navbars': False, 'no_svg_cover': False, 'output_profile': <calibre.customize.profiles.GenericEink object at 0x1122a5a10>, 'page_breaks_before': u"//*[name()='h1' or name()='h2']", 'prefer_metadata_cover': False, 'preserve_cover_aspect_ratio': False, 'pretty_print': True, 'pubdate': None, 'publisher': None, 'rating': None, 'read_metadata_from_opf': u'/var/folders/2l/x8ywqj612999c9twtb138dnm0000gn/C/calibre_4.23.0_tmp_vT98cu/nqS8NX.opf', 'remove_fake_margins': True, 'remove_first_image': False, 'remove_paragraph_spacing': False, 'remove_paragraph_spacing_indent_size': 1.5, 'renumber_headings': True, 'replace_scene_breaks': u'', 'search_replace': '[]', 'series': None, 'series_index': None, 'smarten_punctuation': False, 'sr1_replace': None, 'sr1_search': None, 'sr2_replace': None, 'sr2_search': None, 'sr3_replace': None, 'sr3_search': None, 'start_reading_at': None, 'subset_embedded_fonts': False, 'tags': None, 'timestamp': None, 'title': None, 'title_sort': None, 'toc_filter': None, 'toc_threshold': 6, 'toc_title': None, 'transform_css_rules': '[]', 'unsmarten_punctuation': False, 'unwrap_lines': True, 'use_auto_toc': False, 'verbose': 2} InputFormatPlugin: MOBI Input running on /var/folders/2l/x8ywqj612999c9twtb138dnm0000gn/C/calibre_4.23.0_tmp_vT98cu/OGHGDU.azw Found KF8 MOBI of type u'standalone' Python function terminated unexpectedly: No Home Like Nantucket (A Sweet Island Inn Book 1) Traceback (most recent call last): File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 187, in main return run_entry_point() File "/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py", line 121, in run_entry_point re

ElleKayEm commented 3 years ago

Use DeDRM 6.8.1.

grensv commented 3 years ago

OSX Mojave info : I struggled several hours trying to De DRM with Calibre 5.16.1 and DeDRM7.2.1, without succeeding. I ended up here because I had the same Key error message.

With Calibre 4.23 and DeDRM 6.8.1 it work like a charm on Mojave.

ZolaLa9 commented 3 years ago

@grensv — have you tried updating to Calibre 5.x and DeDRM 7.2.1 after getting it working on Calibre 4.23 and DeDRM 6.8.1? That has worked for some Mac users.

I.e., If Calibre 5.x/DeDRM 7.2.1 is having trouble retrieving the key, some Mac users have had success by going back to 4.23/6.8.1 to get the key, then updating to 5.x/7.2.1 on top of the older version.