noDRM / DeDRM_tools

DeDRM tools for ebooks
7.36k stars 324 forks source link

Amazon E-Book DRM not being removed in Calibre #493

Open Night-Light21 opened 9 months ago

Night-Light21 commented 9 months ago

Question / bug report

After installing both the KFX Plug in and the DeDRM plugin, the issue persists where DRM remains on Amazon Kindle books. The book was downloaded to thePC via the Kindle app.

Which version of Calibre are you running?

7.5.1

Which version of the DeDRM plugin are you running?

10.0.3

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

2.3.1

Log output

ApplicationPaletteChange event ignored
Using calibre Qt style: True
ApplicationPaletteChange event received
calibre Debug log
calibre 7.5.1  embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.11.5
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: None
EXE path: C:\Program Files\Calibre2\calibre-debug.exe
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 8, 1) && DeDRM (10, 0, 3) && 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)
calibre 7.5.1  embedded-python: True
Windows-10-10.0.19045-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19045')
Python 3.11.5
Windows: ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')
Interface language: None
EXE path: C:\Program Files\Calibre2\calibre-debug.exe
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (2, 8, 1) && DeDRM (10, 0, 3) && 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)
QPA platform: windows
devicePixelRatio: 1.0
logicalDpi: 96.0 x 96.0
physicalDpi: 108.91792294807368 x 108.85714285714285
[0.00] Starting up...
[0.00] Showing splash screen...
[0.16] splash screen shown
[0.16] Initializing db...
[0.17] db initialized
[0.17] Constructing main UI...
[0.81] GUI main window shown
[0.88] main UI initialized...
[0.88] Hiding splash screen
Gather KFX-ZIP (from KFX Input) 2.8.1: Importing C:\Users\djapa\Documents\My Kindle Content\B08FHBV4ZX_EBOK\B08FHBV4ZX_EBOK.azw
Gather KFX-ZIP (from KFX Input): Gathered 4 file(s) as C:\Users\djapa\AppData\Local\Temp\calibre_wamu69qh\p6o6tm1a.kfx-zip
DeDRM v10.0.3: Trying to decrypt p6o6tm1a.kfx-zip
Using Library AlfCrypto DLL/DYLIB/SO
Decrypting KFX-ZIP ebook: p6o6tm1a
Found 0 keys to try after 0.1 seconds
Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.584fba3f-b61d-49da-b29f-ad11e46444b3.voucher
Traceback (most recent call last):
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 105, in decrypt_voucher
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 886, in decryptvoucher
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 762, in pkcs7unpad
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 102, in _assert
Exception: Incorrect padding - Wrong key
DeDRM v10.0.3: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
DeDRM v10.0.3: Looking for new default Kindle Key after 0.1 seconds
searching for kinfoFiles in C:\Users\djapa\AppData\Local
Found K4PC 1.25+ kinf2018 file: C:\Users\djapa\AppData\Local\Amazon\Kindle\storage\.kinf2018
Decrypted key file using IDString '1108088142' and UserName 'djapa'
DeDRM v10.0.3: Found 1 new key
Decrypting KFX-ZIP ebook: p6o6tm1a
Got DSN key from database key_0
Found 1 keys to try after 0.2 seconds
Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.584fba3f-b61d-49da-b29f-ad11e46444b3.voucher
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
Exception: Failed to decrypt KFX DRM voucher with any key

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 105, in decrypt_voucher
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 886, in decryptvoucher
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 762, in pkcs7unpad
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 102, in _assert
Exception: Incorrect padding - Wrong key
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
Exception: Failed to decrypt KFX DRM voucher with any key

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 105, in decrypt_voucher
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 886, in decryptvoucher
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 763, in pkcs7unpad
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 102, in _assert
Exception: Incorrect padding - Wrong key
Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
Exception: Failed to decrypt KFX DRM voucher with any key

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "calibre_plugins.dedrm.__init__", line 991, in KindleMobiDecrypt
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
Exception: Failed to decrypt KFX DRM voucher with any key
DeDRM v10.0.3: Ultimately failed to decrypt after 0.2 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 957, in KindleMobiDecrypt
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
  File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
Exception: Failed to decrypt KFX DRM voucher with any key

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 1056, in run
  File "calibre_plugins.dedrm.__init__", line 1007, in KindleMobiDecrypt
calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.3: Ultimately failed to decrypt after 0.2 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 C:\Users\djapa\AppData\Local\Temp\calibre_wamu69qh\p6o6tm1a.kfx-zip
Processing container: B08FHBV4ZX_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
  File "calibre_plugins.kfx_input.package_filetype", line 34, in package_kfx
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 79, in convert_to_single_kfx
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 212, in decode_book
  File "calibre_plugins.kfx_input.kfxlib.yj_book", line 321, in get_container
calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container B08FHBV4ZX_EBOK.azw has DRM and cannot be converted
KFX metadata reader (from KFX Input) activated for C:\Users\djapa\AppData\Local\Temp\calibre_wamu69qh\7kbupvn3_add_books\0\B08FHBV4ZX_EBOK.kfx-zip
[4.95] splash screen hidden
[4.95] Started up in 4.95 seconds with 1 books
stdout+stderr from file dialog helper: [b'', b'']
piped data from file dialog helper: [b'\x97\\2aq\xad<$\x02}Wk \x90\xcd\x8f!\x9b\xa0\x16\x8d\x04\x87\xdd\x954{\xf9\xdfR8`', b'C:\\Users\\djapa\\Documents\\My Kindle Content\\B08FHBV4ZX_EBOK\\B08FHBV4ZX_EBOK.azw']
Added Project Hail Mary to db in: 0.2
Added 1 books in 0.9 seconds
Worker Launch took: 0.01 seconds
Job: 0 Convert book 1 of 1 (Project Hail Mary) finished
Convert book 1 of 1 (Project Hail Mary)

    DeDRM v10.0.3: Trying to decrypt s6blxjol.kfx-zip
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypting KFX-ZIP ebook: s6blxjol
    Found 0 keys to try after 0.1 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.584fba3f-b61d-49da-b29f-ad11e46444b3.voucher
    Traceback (most recent call last):
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 105, in decrypt_voucher
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 886, in decryptvoucher
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 762, in pkcs7unpad
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 102, in _assert
    Exception: Incorrect padding - Wrong key
    DeDRM v10.0.3: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
    DeDRM v10.0.3: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\djapa\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\djapa\AppData\Local\Amazon\Kindle\storage\.kinf2018
    Decrypted key file using IDString '1108088142' and UserName 'djapa'
    DeDRM v10.0.3: Found 1 new key
    Decrypting KFX-ZIP ebook: s6blxjol
    Got DSN key from database key_0
    Found 1 keys to try after 0.2 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.584fba3f-b61d-49da-b29f-ad11e46444b3.voucher
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
    Exception: Failed to decrypt KFX DRM voucher with any key

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 105, in decrypt_voucher
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 886, in decryptvoucher
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 762, in pkcs7unpad
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 102, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
    Exception: Failed to decrypt KFX DRM voucher with any key

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 105, in decrypt_voucher
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 886, in decryptvoucher
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 763, in pkcs7unpad
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 102, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
    Exception: Failed to decrypt KFX DRM voucher with any key

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "calibre_plugins.dedrm.__init__", line 991, in KindleMobiDecrypt
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
    Exception: Failed to decrypt KFX DRM voucher with any key
    DeDRM v10.0.3: Ultimately failed to decrypt after 0.2 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 957, in KindleMobiDecrypt

      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook

      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook

      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher

    Exception: Failed to decrypt KFX DRM voucher with any key

    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 1056, in run

      File "calibre_plugins.dedrm.__init__", line 1007, in KindleMobiDecrypt

    calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.3: Ultimately failed to decrypt after 0.2 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md

    Conversion options changed from defaults:

      pdf_serif_family: 'Tahoma'

      pdf_sans_family: 'Tahoma'

      verbose: 2

      cover: 'C:\\Users\\djapa\\AppData\\Local\\Temp\\calibre_wamu69qh\\jikem46d.jpeg'

      pdf_mono_family: 'Courier New'

      output_profile: 'generic_eink'

      read_metadata_from_opf: 'C:\\Users\\djapa\\AppData\\Local\\Temp\\calibre_wamu69qh\\01xfoa_g.opf'

    Resolved conversion options

    calibre version: 7.5.1

    {'allow_conversion_with_errors': False,

     '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': 'C:\\Users\\djapa\\AppData\\Local\\Temp\\calibre_wamu69qh\\jikem46d.jpeg',

     'custom_size': None,

     'debug_pipeline': None,

     'dehyphenate': True,

     'delete_blank_paragraphs': True,

     'disable_font_rescaling': False,

     'duplicate_links_in_toc': False,

     'embed_all_fonts': False,

     'embed_font_family': None,

     'enable_heuristics': False,

     'expand_css': False,

     'extra_css': 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 0x000001E56BB9C190>,

     '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_inline_navbars': False,

     'output_profile': <calibre.customize.profiles.GenericEink object at 0x000001E56BB9FBD0>,

     'page_breaks_before': '/',

     'paper_size': 'letter',

     'pdf_add_toc': False,

     'pdf_default_font_size': 20,

     'pdf_footer_template': None,

     'pdf_header_template': None,

     'pdf_hyphenate': False,

     'pdf_mark_links': False,

     'pdf_mono_family': 'Courier New',

     'pdf_mono_font_size': 16,

     'pdf_no_cover': False,

     'pdf_odd_even_offset': 0.0,

     'pdf_page_margin_bottom': 72.0,

     'pdf_page_margin_left': 72.0,

     'pdf_page_margin_right': 72.0,

     'pdf_page_margin_top': 72.0,

     'pdf_page_number_map': None,

     'pdf_page_numbers': False,

     'pdf_sans_family': 'Tahoma',

     'pdf_serif_family': 'Tahoma',

     'pdf_standard_font': 'serif',

     'pdf_use_document_margins': False,

     'prefer_metadata_cover': False,

     'preserve_cover_aspect_ratio': False,

     'pretty_print': False,

     'pubdate': None,

     'publisher': None,

     'rating': None,

     'read_metadata_from_opf': 'C:\\Users\\djapa\\AppData\\Local\\Temp\\calibre_wamu69qh\\01xfoa_g.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,

     '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': '[]',

     'transform_html_rules': '[]',

     'uncompressed_pdf': False,

     'unit': 'inch',

     'unsmarten_punctuation': False,

     'unwrap_lines': True,

     'use_auto_toc': False,

     'use_profile_size': False,

     'verbose': 2}

    DeDRM v10.0.3: Trying to decrypt s6blxjol.kfx-zip
    Decrypting KFX-ZIP ebook: s6blxjol
    Found 0 keys to try after 0.0 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.584fba3f-b61d-49da-b29f-ad11e46444b3.voucher
    Traceback (most recent call last):
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 105, in decrypt_voucher
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 886, in decryptvoucher
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 762, in pkcs7unpad
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 102, in _assert
    Exception: Incorrect padding - Wrong key
    DeDRM v10.0.3: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
    DeDRM v10.0.3: Looking for new default Kindle Key after 0.0 seconds
    searching for kinfoFiles in C:\Users\djapa\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\djapa\AppData\Local\Amazon\Kindle\storage\.kinf2018
    Decrypted key file using IDString '1108088142' and UserName 'djapa'
    DeDRM v10.0.3: Found 1 new key
    Decrypting KFX-ZIP ebook: s6blxjol
    Got DSN key from database key_0
    Found 1 keys to try after 0.1 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.584fba3f-b61d-49da-b29f-ad11e46444b3.voucher
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
    Exception: Failed to decrypt KFX DRM voucher with any key

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 105, in decrypt_voucher
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 886, in decryptvoucher
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 762, in pkcs7unpad
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 102, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
    Exception: Failed to decrypt KFX DRM voucher with any key

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 105, in decrypt_voucher
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 886, in decryptvoucher
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 763, in pkcs7unpad
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py", line 102, in _assert
    Exception: Incorrect padding - Wrong key
    Traceback (most recent call last):
      File "calibre_plugins.dedrm.__init__", line 957, in KindleMobiDecrypt
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
    Exception: Failed to decrypt KFX DRM voucher with any key

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "calibre_plugins.dedrm.__init__", line 991, in KindleMobiDecrypt
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook
      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher
    Exception: Failed to decrypt KFX DRM voucher with any key
    DeDRM v10.0.3: Ultimately failed to decrypt after 0.1 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 957, in KindleMobiDecrypt

      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 261, in GetDecryptedBook

      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 67, in processBook

      File "C:\Users\djapa\AppData\Roaming\calibre\plugins\DeDRM.zip\kfxdedrm.py", line 111, in decrypt_voucher

    Exception: Failed to decrypt KFX DRM voucher with any key

    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 1056, in run

      File "calibre_plugins.dedrm.__init__", line 1007, in KindleMobiDecrypt

    calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.3: Ultimately failed to decrypt after 0.1 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md

    InputFormatPlugin: KFX Input running

    on C:\Users\djapa\AppData\Local\Temp\calibre_wamu69qh\s6blxjol.kfx-zip

    Software versions: KFX Input 2.8.1, calibre 7.5.1, Windows-10-10.0.19045-SP0

    KFX Input plugin help is available at https://www.mobileread.com/forums/showthread.php?t=291290

    Converting C:\Users\djapa\AppData\Local\Temp\calibre_wamu69qh\s6blxjol.kfx-zip

    Processing container: B08FHBV4ZX_EBOK.azw

    Traceback (most recent call last):

      File "calibre_plugins.kfx_input.__init__", line 102, in convert

      File "calibre_plugins.kfx_input.kfxlib.yj_book", line 212, in decode_book

      File "calibre_plugins.kfx_input.kfxlib.yj_book", line 321, in get_container

    calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container B08FHBV4ZX_EBOK.azw has DRM and cannot be converted

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):

      File "runpy.py", line 198, in _run_module_as_main

      File "runpy.py", line 88, in _run_code

      File "site.py", line 95, in <module>

      File "site.py", line 90, in main

      File "site.py", line 50, in run_entry_point

      File "calibre\utils\ipc\worker.py", line 215, in main

      File "calibre\gui2\convert\gui_conversion.py", line 38, in gui_convert_override

      File "calibre\gui2\convert\gui_conversion.py", line 25, in gui_convert

      File "calibre\ebooks\conversion\plumber.py", line 1108, in run

      File "calibre\customize\conversion.py", line 242, in __call__

      File "calibre_plugins.kfx_input.__init__", line 121, in convert

    calibre.ebooks.DRMError: This book has DRM!
Night-Light21 commented 9 months ago

I also tried removing the converter plugin based on the ticket https://github.com/noDRM/DeDRM_tools/discussions/451. Calibre did not allow me to convert due to the file remaining as a KFX.

ElleKayEm commented 9 months ago

You need DeDRM 10.0.9 and the KFX Input plugin.

https://github.com/noDRM/DeDRM_tools/releases/tag/v10.0.9

RationalHuman commented 9 months ago

ElleKayEm-

Apologies if this not the appropriate place or method for posting a response - I literally just joined GitHub after reading the various forums, FAQs and posts in an attempt to de-bug an issue that suddenly cropped up two days ago in my use of Calibre and the de-DRM (now NoDRM) plugin. I've been using both successfully for years by downloading books from my amazon account for my linked Kindle Paperwhite, then storing the files in Calibre where I also removed the DRM so that I could read library books when I got around to it, rather than in the 2-3 weeks allowed by DRM. This was still working as of 2/5/24, but when I downloaded some library books on 2/20/24 I got an error message that they were locked by DRM and could not be opened. So I upgraded Calibre to 7.5.1 and installed both the NoDRM (first 10.0.3 then 10.0.9) and then, when it still didn't work, also added the KFX input plugin (2.8.1) and re-installed NoDRM 10.0.9, but still no joy. Any advice as to next steps?

Best, RH

ElleKayEm commented 9 months ago

You're downloading them directly to your Paperwhite? Are you leaving the files in their original folder structure?

RationalHuman commented 9 months ago

No, I download them to my PC (Windows 11), then load them into Calibre, then load them to the Kindle from Calibre. I assume Calibre is putting them in the appropriate folder on the kindle as they show up there and are readable on the kindle (at least for now)

ElleKayEm commented 9 months ago

Downloading them from the website with the "transfer via usb" option? Then you don't have to worry about folder structure because there's only the one file. Just make sure you pick your Paperwhite as the device and make sure its serial number is correctly entered into DeDRM's customization.

RationalHuman commented 9 months ago

Have done both of those (serial number, device) and it's still not working, despite having worked hundreds of times in the past with no change on my end - that's why I'm posting here

ElleKayEm commented 9 months ago

Post a log and we'll see if that tells us anything: 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

RationalHuman commented 9 months ago

Done. Here's the log:

ApplicationPaletteChange event ignored Using calibre Qt style: True calibre Debug log calibre 7.5.1 embedded-python: True Windows-10-10.0.22621-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.22621') Python 3.11.5 Windows: ('10', '10.0.22621', 'SP0', 'Multiprocessor Free') Interface language: None EXE path: C:\Program Files\Calibre2\calibre-debug.exe 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) calibre 7.5.1 embedded-python: True Windows-10-10.0.22621-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.22621') Python 3.11.5 Windows: ('10', '10.0.22621', 'SP0', 'Multiprocessor Free') Interface language: None EXE path: C:\Program Files\Calibre2\calibre-debug.exe 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) QPA platform: windows devicePixelRatio: 1.5 logicalDpi: 96.0 x 96.0 physicalDpi: 109.21999999999998 x 109.18208955223879 [0.00] Starting up... [0.00] Showing splash screen... [0.20] splash screen shown [0.20] Initializing db... [0.22] db initialized [0.22] Constructing main UI... [0.97] GUI main window shown [1.09] main UI initialized... [1.09] Hiding splash screen DeDRM v10.0.9: Trying to decrypt Icarus A Novel (Benny Griessel Mysteries Book 5).azw3 [48.50] splash screen hidden [48.50] Started up in 48.50 seconds with 659 books stdout+stderr from file dialog helper: [b'', b''] piped data from file dialog helper: [b'v\xdb\xac\xcf\xd2r\x92\x0bs\xa5"\xd6\xa7\xbc@W\x1f\xe1\xa7\rv=.\xef\xda$\xda\x94\xb7\x9cY\x15', b'C:\Users\SimonKennedy\Downloads\Failed\Icarus A Novel (Benny Griessel Mysteries Book 5).azw3'] MobiDeDrm v1.1. Copyright © 2008-2022 The Dark Reverser, Apprentice Harper et al. Decrypting Kindle Format 8 ebook: Icarus: A Novel (Benny Griessel Mysteries Book 5) Found 4 keys to try after 1.3 seconds Crypto Type is: 2 DeDRM v10.0.9: Failed to decrypt with error: No key found in 4 PIDs tried. DeDRM v10.0.9: Looking for new default Kindle Key after 1.3 seconds searching for kinfoFiles in C:\Users\SimonKennedy\AppData\Local No K4PC kindle.info/kinf/kinf2011 files have been found. DeDRM v10.0.9: Ultimately failed to decrypt after 1.3 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 File "C:\Users\SimonKennedy\AppData\Roaming\calibre\plugins\DeDRM.zip\k4mobidedrm.py", line 203, in GetDecryptedBook File "C:\Users\SimonKennedy\AppData\Roaming\calibre\plugins\DeDRM.zip\mobidedrm.py", line 401, in processBook 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 187, in _run_filetype_plugins File "calibre_plugins.dedrm.init", line 1030, in run File "calibre_plugins.dedrm.init", line 981, in KindleMobiDecrypt calibre_plugins.dedrm.DeDRMError: DeDRM v10.0.9: Ultimately failed to decrypt after 1.3 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools/blob/master/FAQs.md

ElleKayEm commented 9 months ago

The log shows DeDRM doesn't like the keys you have in there for that copy of the book. Humor me and try this even if you're 100% sure it won't help:

Download a fresh copy of a book making sure you're choosing your Paperwhite (if you have more than one device). Copy and paste the Paperwhite's serial number from the website into DeDRM's customization. Click save or ok as needed on the way out of the dialog boxes. Restart calibre. Add the fresh copy of the book to calibre. If it still doesn't work, then I'd guess that Amazon has changed something about the way library books are encrypted. Or are you having the same issue with purchased books?

RationalHuman commented 9 months ago

So I deleted my old kindle serial # (which I had left in Calibre) and re-added the current one, as you directed, but got the same result. My wife, who has an older version of Calibre and DeDRM and her own kindle and Amazon account experienced the exact same thing when I asked her to try downloading and loading a library book, so I’m afraid it does seem likely that Amazon has changed how they handle library books. I haven’t tried a purchased book, as all the one I already own are already in Calibre with their DRM removed, but I suppose I could try deleting and re-adding one if you think it wb helpful

Thanks for all your help with this, BTW

From: ElleKayEm @.> Sent: Friday, February 23, 2024 6:51 PM To: noDRM/DeDRM_tools @.> Cc: RationalHuman @.>; Comment @.> Subject: Re: [noDRM/DeDRM_tools] Amazon E-Book DRM not being removed in Calibre (Issue #493)

The log shows DeDRM doesn't like the keys you have in there for that copy of the book. Humor me and try this even if you're 100% sure it won't help:

Download a fresh copy of a book making sure you're choosing your Paperwhite (if you have more than one device). Copy and paste the Paperwhite's serial number from the website into DeDRM's customization. Click save or ok as needed on the way out of the dialog boxes. Restart calibre. Add the fresh copy of the book to calibre. If it still doesn't work, then I'd guess that Amazon has changed something about the way library books are encrypted. Or are you having the same issue with purchased books?

— Reply to this email directly, view it on GitHub https://github.com/noDRM/DeDRM_tools/issues/493#issuecomment-1962145569 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BGKWGBW7GZZ6ND2BN6NLOZLYVETNZAVCNFSM6AAAAABDQUYG5KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRSGE2DKNJWHE . You are receiving this because you commented. https://github.com/notifications/beacon/BGKWGBX3VWIQHOET44TPRLTYVETNZA5CNFSM6AAAAABDQUYG5KWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTU6P3SC.gif Message ID: @. @.> >

ElleKayEm commented 9 months ago

Alright, I just tried myself. No issues. Try my instructions exactly as written.

RationalHuman commented 9 months ago

I must admit I was a bit annoyed by this advice, but I did repeat the steps, exactly and in order, and found that the old serial number I thought I had deleted was still there – I missed the ‘Apply’ button in the sequence. Repeated it all correctly, confirmed that the only serial number shown was the correct one, quite and re-started and re-loaded and…. It worked!

Thanks, again, for your help!

From: ElleKayEm @.> Sent: Saturday, February 24, 2024 12:53 PM To: noDRM/DeDRM_tools @.> Cc: RationalHuman @.>; Comment @.> Subject: Re: [noDRM/DeDRM_tools] Amazon E-Book DRM not being removed in Calibre (Issue #493)

Alright, I just tried myself. No issues. Try my instructions exactly as written.

— Reply to this email directly, view it on GitHub https://github.com/noDRM/DeDRM_tools/issues/493#issuecomment-1962436879 , or unsubscribe https://github.com/notifications/unsubscribe-auth/BGKWGBU6P6XYRRFCQ6VCWRLYVISG3AVCNFSM6AAAAABDQUYG5KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRSGQZTMOBXHE . You are receiving this because you commented. https://github.com/notifications/beacon/BGKWGBTNFZNS4QMHNYY4PF3YVISG3A5CNFSM6AAAAABDQUYG5KWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTU7BUQ6.gif Message ID: @. @.> >

ElleKayEm commented 9 months ago

No need to delete serial numbers. As long as one of them is the correct one for that copy of the book, all should be good.