DRM Removal Tools for eBooks

Version 7.2.1 released on 11 April, 2021

Welcome to Apprentice Alf’s blog

This blog is intended to help anyone looking for free and simple software for removing DRM from their Kindle ebooks, stripping DRM from their Adobe Digital Editions ebooks, getting rid of DRM from their Barnes and Noble ebooks, freeing their Kobo ebooks of DRM, or decrypting their Fictionwise eReader ebooks.

If you want to find out more about ebooks, DRM and why you will probably want to remove the DRM from your ebooks, see this post:  Ebook Formats, DRM and You — A Guide for the Perplexed.

If you already know that you want to strip the DRM from your ebooks, you’ve found the right place.

The Tools

To get started on removing DRM from your ebooks, just download the tools archive from the link below. Unzip the archive, and start reading.

The latest release can be found at the top of this page:
https://github.com/apprenticeharper/DeDRM_tools/releases

Getting Help with the Tools

If you have any questions about the tools, ebooks, and DRM, check the FAQs at the GitHub repository:
https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md

If you have any problems with the current tools, please ask for help in a comment on this post or in the Discussions area of Apprentice Harper’s GitHub repository.  If you would like to report a bug, please open a new issue at the GitHub repository. If you are having a problem with an older version of the tools, please first update to the current version, and see if that solves your problem.

Before commenting here, please check the ReadMe file and the FAQs (see link above).

In any bug report or help request, please include:

  • which tool was used
  • which OS you are using
  • where the ebook file came from (device or application)
  • any error messages
  • a log of the DRM-removal attempt (see the FAQs on how to get a log).

Anti-Piracy Notice

Please only use these tools for gaining full access to your own ebooks for archiving/conversion/convenience. De-drmed ebooks should not be uploaded to open servers, torrents, or other methods of mass distribution. No help will be given to people doing such things. Authors, retailers and publishers all need to make a living, so that they can continue to produce books for us to read. Don’t be a parasite.

Origin of the Tools

The tools for removing DRM from ePubs were originally posted at i♥cabbages’ blog. The tools for Kindle/Mobipocket were originally posted at The Dark Reverser’s blog.

They have since been improved by many people, but mostly some_updates, DiapDealer, Apprentice Alf, and Apprentice Harper. While there are many sites that redistribute these tools, the most up-to-date versions of the tools are currently released here.

Other Sources

Anyone trying to sell you ebook DRM removal tools for Adobe Adept ePub and PDFs, Barnes & Noble ePubs, Kindle ebooks, Kobo ebooks, or eReader ebooks has probably just repackaged (an earlier) version of the tools available here.

7,459 thoughts on “DRM Removal Tools for eBooks

  1. Hello,

    I’ve installed the latest version of the DeDRM plugin to Calibre 5.18.0. I recently transferred a bunch of older book from a previous kindle (registered to another account I have no access to) to my computer, then to my kindle paperwhite. I saved the serial number of my paperwhite in the plugin’s customization window, however I wasn’t sure if the serial number is supposed to be from the kindle the book is going to or the kindle it was originally licensed to. I am unable to remove the DRM from my older books (awz3, not kfx). Before I post my log, I wanted to ask if there might be an issue with the serial number I used just in case. I figured there might be something fishy there!

    Thanks in advance for any help!

    • The DRM which needs to be removed will be associated with the device or app they were downloaded with. After DRM is removed, it can be read on whatever you want. So you need the serial number the books are from. Not the one they are going to.

      • That is correct, but it would also be easy to simply put both (or more) Kindle serial numbers in the DeDRM-Plugin Settings, even if one of them is not needed yet.

        Also, as a side effect, the transfered books from the old device should not work on the new device, imho
        – or the ones that work do not have DRM anyway.

        If there is a problem using a different Account for the old Kindle, the books can also not be downloaded from Amazon again.

  2. I posted a message recently with my own error message I received from an attempted installation. I’m logged in with my WordPress credentials but I haven’t seen it posted. Do I need to repost? I was afraid to do it again because I didn’t want to seem like I was spamming the comment section. Thanks!

    • This time when I hit the post button, it sent. I’m not sure what happened the last time.

      This is the error message I get when I attempt to install the plugin. I’ve been using this plugin for quite a while but I reformat my hard drive around once a year or so to get rid of bit-rot and such. It was installed on this computer before I re-installed Windows, so it’s not like I’m new to the plugin. Still, this is the error I get. Thank you for any input!

      calibre, version 5.23.0
      ERROR: Unhandled exception: SyntaxError:invalid syntax (calibre_plugins.dedrm.init, line 167)

      calibre 5.23 [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: None
      Successfully initialized third party plugins: WordDumb (3, 10, 0)
      Traceback (most recent call last):
      File “calibre\gui2\preferences\plugins.py”, line 327, in add_plugin
      File “calibre\customize\ui.py”, line 477, in add_plugin
      File “calibre\customize\ui.py”, line 65, in load_plugin
      File “calibre\customize\zipplugin.py”, line 293, in load
      File “importlib__init__.py”, line 127, in import_module
      File “”, line 1014, in _gcd_import
      File “”, line 991, in _find_and_load
      File “”, line 975, in _find_and_load_unlocked
      File “”, line 671, in _load_unlocked
      File “calibre\customize\zipplugin.py”, line 185, in exec_module
      File “calibre\customize\zipplugin.py”, line 181, in get_code
      File “calibre_plugins.dedrm.init“, line 167
      print u”{0} v{1}: Copying needed library files from plugin’s zip”.format(PLUGIN_NAME, PLUGIN_VERSION)
      ^
      SyntaxError: invalid syntax

      • You need the latest version of the plugin for calibre 5.0. The one you’re trying to load is written in Python 2 and will only work with calibre 4.x (and earlier).

  3. Hi there,
    I’ve just freshly installed Adobe Digital Editions 4.5, Calibre 5.23, and the DeDRM plugin 7.2.1.
    I’ve used older versions successfully in the past, so I think I’ve got the method down. XD However, a book imported by .acsm into Digital Editions and then to Calibre, but Acrobat is still saying “… The security plug-in requires by this command is unavailable” when I try to open the file from the Calibre library.

    Here’s my debug data:

    calibre 5.23 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 120.0 x 120.0
    physicalDpi: 141.7674418604651 x 142.13471502590673
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.48] splash screen shown
    [0.48] Initializing db…
    [0.48] db initialized
    [0.48] Constructing main UI…
    [0.95] main UI initialized…
    [0.95] Hiding splash screen
    Starting QuickView
    [1.11] splash screen hidden
    [1.11] Started up in 1.11 seconds with 2 books
    stdout+stderr from file dialog helper: [b”, b”]
    piped data from file dialog helper: [b’n\x8f\xb6\xf2\xd9G\xc5\x10\xb0][\x96h\xe28hbN=T\x7f\xb6\xca\x96>\x0b\x0c\xf6\x87G\xb1R’, b’C:\Users\lemmi\OneDrive – University of New England\Documents\My Digital Editions\Design of Technology-Enhanced Learning.pdf’]
    DeDRM v7.2.1: Trying to decrypt Design of Technology-Enhanced Learning.pdf
    DeDRM v7.2.1: Design of Technology-Enhanced Learning.pdf is a PDF ebook
    DeDRM v7.2.1: Looking for new default Adobe Digital Editions Keys after 0.1 seconds
    Found 1 keys
    DeDRM v7.2.1: Trying a new default key
    error writing pdf: max() arg is an empty sequence
    DeDRM v7.2.1: Failed to decrypt with new default key after 0.1 seconds
    DeDRM v7.2.1: 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
    Added Design of Technology-Enhanced Learning to db in: 0.3
    Added 1 books in 0.8 seconds
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 176, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 640, in run
    File “calibre_plugins.dedrm.init“, line 515, in PDFDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: 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
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 433, in get_file_type_metadata
    File “calibre\customize\builtins.py”, line 347, in get_metadata
    File “calibre\ebooks\metadata\pdf.py”, line 126, in get_metadata
    ValueError: Could not read info dict from PDF
    Syntax Error: Couldn’t find the ‘EBX_HANDLER’ security handler
    pdfinfo errored out with return code: 1
    Exception ignored in:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.adobekey”, line 268, in del
    TypeError: ‘NoneType’ object is not callable
    Exception ignored in:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.adobekey”, line 268, in del
    TypeError: ‘NoneType’ object is not callable

  4. I am having trouble getting mine to convert.
    I am running Windows 10.
    The ebook was purchased and downloaded from Google Books. I am trying to get them onto my Kindle.

    calibre Debug log
    calibre 5.23 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    calibre 5.23 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 3.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 94.51162790697674 x 94.2680412371134
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.62] splash screen shown
    [0.62] Initializing db…
    [0.64] db initialized
    [0.64] Constructing main UI…
    [1.34] main UI initialized…
    [1.34] Hiding splash screen
    Starting QuickView
    [12.26] splash screen hidden
    [12.26] Started up in 12.26 seconds with 167 books
    stdout+stderr from file dialog helper: [b”, b”]
    piped data from file dialog helper: [b’\xb9z\xb9\x9e\x80\xb4M`\x1a_\x7fY^\xa0\xad\xc8/j\x82\xd1LL\x16\x06\xe5\x95\n~”\xcf-\x17′, b’C:\Users\jenni\Downloads\The_Bridge_Kingdom-epub.acsm’]
    Added The Bridge Kingdom-epub to db in: 0.2
    Added 1 books in 0.6 seconds

    Hopefully that’s everything needed. This is my first time trying to use this, so I could easily be doing it wrong…

    • Looking at your log snippet, it looks as if you are trying to import The_Bridge_Kingdom-epub.acsm from your downloads folder. This is not an ebook but rather an Adobe Content Server Message file which tell ADE how to download the file and what rights you have on it. You will need to open that file with ADE to actually download the ebook. If you do not already have ADE installed, you will need to install and register it.

      • Thank you! I did have it installed and loaded the book with it, but couldn’t figure out what to do from there (or why it was even necessary…). Turns out they’re in my documents folder, and they work just fine! Appreciate the push in the right direction lol!

  5. Could anyone help me figure out what I need to do? I’m using a Windows 10 PC and the book is downloaded from Amazon. I’m trying to get it converted to a pdf so I can read it more easily zoomed in (text is super blurry zoomed into the original file).

    • “converted to a pdf so I can read it more easily zoomed in (text is super blurry zoomed into the original file).”

      This reads to me like you are already reading a PDF (inside an Amazon eBook container) – and with scanned pages.
      This is a guess, so I maybe wrong, but if this is the case, and you manage to strip DRM, and convert it to PDF, this will not solve your problem, you still look at images, which will blurr, when zoomed. OCR might help, but wether that is even possible?

      • yes, my thought was that it may be exactly as you described.

        re using OCR: back in the Groklaw days I processed some of their legal documents (on Linux), which were primarily scanned images inside a PDF like this:
        1. use pdf2tiff to create tiff images.
        2. use some custom scripts I had hacked together to run early releases of Google’s tesseract OCR on those tiff images.
        3. the results, of course, still required cleaning up due to the inevitable ‘scanos’. a lot of work was involved.

  6. TY for letting us responsibly use our own epubbooks. I just got a new reMarkable ink tablet and this will make it actually useful.

  7. I am trying to archive my Nook magazines from B&N. I get the epub from Nook for PC and can view, with that epub, the magazine in “page view”. When the epub ends up in Calibre, however, it’s only in “article view”. I heard that the page view is just a series of images which would have to be included in the original epub file.

    I’m wondering if the DRM removal tools also strips the “extra” pictures from the epub since they’re not technically part of the epub format. Is that possible? If so, is there a way to prevent that? Since I can’t get into the epub until after it’s been de-DRM’d and imported into Calibre, I can’t easily verify if it’s pictures of what.

    G

        • The files inside an ePub can be encrypted. But you mentioned being able to view the ePub in calibre, so there either was no DRM, or you’ve successfully removed it.

          • I’ve successfully removed it — and that’s when I think the images (that would look like they’re extra to an epub program) get removed. I was wondering if my guess is correct and if there were a way to prevent that from happening.

            • Have you unzipped the de-drmed ePub? (If not, do so and check whether the images in there somewhere)
              Is the size of the de-drmed ePub significantly smaller than the ePub with DRM? (If so, perhaps the images did get stripped. Try unzipping the DRMed ePub – images sometimes aren’t encrypted.)

              • Yea, after you last message I looked. The images were there (yay!) and I was able to read them. And yes, the calibre epub is notably smaller. So, is there a way to get the DRM app to not strip the images?

                • The DeDRM app does not strip images. If you import the original epub into calibre and check, the images should be there. I just checked on two epubs and the images in the original epub and the deDRMmed epub were close to identical in size (the ones with DRM could not be opened since they are encrypted). OTOH, if you are using calibre to convert epub to epub (or any other format), that’s a whole ‘nother can of worms and outside the focus of this blog.

  8. Hi, I tried importing a book recently downloaded. I followed all instructions and have Calibre 5.23 installed along with Kindle for PC 1.30.0 (59056). Directly after installing the programs I could download books from Amazon and was able to add them to Calibre without any problems, but when I tried again today the downloaded books were placed in a folder again and when I tried importing the .azw file I got a ‘DRM’ message. This is the information from the log:

    calibre Debug log
    calibre 5.23 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Failed to initialize plugin: ‘C:\Users\user\AppData\Roaming\calibre\plugins\Goodreads.zip’
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 40, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 40, 0) && Goodreads Sync (1, 12, 1) && KFX metadata reader (from KFX Input) (1, 40, 0) && KFX Input (1, 40, 0) && Obok DeDRM (7, 2, 1)
    calibre 5.23 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 40, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 40, 0) && Goodreads Sync (1, 12, 1) && KFX metadata reader (from KFX Input) (1, 40, 0) && KFX Input (1, 40, 0) && Obok DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 127.66492146596858 x 127.59069767441859
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.53] splash screen shown
    [0.53] Initializing db…
    [1.17] db initialized
    [1.17] 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
    [2.91] main UI initialized…
    [2.91] Hiding splash screen
    Starting QuickView
    Failed to initialize plugin: ‘C:\Users\user\AppData\Roaming\calibre\plugins\Goodreads.zip’
    Gather KFX-ZIP (from KFX Input) 1.40.0: Importing D:/My Kindle Content/B08MDYRB8K_EBOK/B08MDYRB8K_EBOK.azw
    Gather KFX-ZIP (from KFX Input): Gathered 4 file(s) as C:\Users\user\AppData\Local\Temp\calibre_wjv8c41y\ee0c01w3.kfx-zip
    DeDRM v7.2.1: Trying to decrypt ee0c01w3.kfx-zip
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypting KFX-ZIP ebook: ee0c01w3
    Got DSN key from database default_key
    Found 2 keys to try after 0.1 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.799884a8-92c4-415a-9891-4d466c7fff54.voucher
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 884, in decryptvoucher
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Expected KeySet, got
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    DeDRM v7.2.1: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\user\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\user\AppData\Local\Amazon\Kindle\storage.kinf2018
    [36.08] splash screen hidden
    [36.08] Started up in 36.08 seconds with 10822 books
    Decrypted key file using IDString ‘3160632123’ and UserName ‘user’
    DeDRM v7.2.1: Found 1 new key
    Decrypting KFX-ZIP ebook: ee0c01w3
    Got DSN key from database default_key_1
    Found 1 keys to try after 5.9 seconds
    Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.799884a8-92c4-415a-9891-4d466c7fff54.voucher
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 540, in KindleMobiDecrypt
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 45, in processBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 89, 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.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 540, in KindleMobiDecrypt
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 45, in processBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 89, 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.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 884, in decryptvoucher
    File “C:\Users\user\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Expected KeySet, got
    DeDRM v7.2.1: Ultimately failed to decrypt after 5.9 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Package KFX (from KFX Input) 1.40.0: Packaging C:\Users\user\AppData\Local\Temp\calibre_wjv8c41y\ee0c01w3.kfx-zip
    Processing container: B08MDYRB8K_EBOK.azw
    KFX metadata reader (from KFX Input) activated for C:\Users\user\AppData\Local\Temp\calibre_wjv8c41y\r8pdvndl_add_books\0\B08MDYRB8K_EBOK.kfx-zip
    Import symbol table YJ_symbols version 10 max_id 788 exceeds known table size 780
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 540, in KindleMobiDecrypt
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 45, in processBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 89, 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 176, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 633, in run
    File “calibre_plugins.dedrm.init“, line 583, in KindleMobiDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 5.9 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Running file type plugin Package KFX (from KFX Input) failed with traceback:
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 176, in _run_filetype_plugins
    File “calibre_plugins.kfx_input.package_filetype”, line 21, in run
    File “calibre_plugins.kfx_input.package_filetype”, line 32, in run_kfx
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 85, 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 319, in get_container
    calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: BookTraceback (most recent call last):
    File “calibre\customize\ui.py”, line 741, in initialize_plugins
    File “calibre\customize\ui.py”, line 65, in load_plugin
    File “calibre\customize\zipplugin.py”, line 293, in load
    File “importlib__init__.py”, line 127, in import_module
    File “”, line 1014, in _gcd_import
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “calibre\customize\zipplugin.py”, line 192, in exec_module
    File “calibre_plugins.goodreads.init“, line 11, in
    ImportError: cannot import name ‘quote’ from ‘urllib’ (C:\Program Files (x86)\Calibre\app\bin\python-lib.bypy.frozen\urllib__init__.pyc)
    Traceback (most recent call last):
    File “calibre\gui2\ui.py”, line 134, in init
    File “calibre\gui2\ui.py”, line 152, in init_iaction
    File “calibre\customize__init__.py”, line 626, in load_actual_plugin
    File “importlib__init__.py”, line 127, in import_module
    File “”, line 1014, in _gcd_import
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “calibre\customize\zipplugin.py”, line 192, in exec_module
    File “calibre_plugins.goodreads_sync.action”, line 25, in
    File “calibre\customize\zipplugin.py”, line 192, in exec_module
    File “calibre_plugins.goodreads_sync.core”, line 5, in
    ImportError: cannot import name ‘tostring’ from ‘_elementtree’ (C:\Program Files (x86)\Calibre\app\bin_elementtree.pyd)
    Added Trusting Molly (Silverstone) to db in: 2.2
    Added 1 books in 8.6 seconds

    Any help is appreciated. TY

  9. Hello, I’m having problems importing recently purchased books (in 2021). Any help is greatly appreciated.

    Kobo Desktop Edition 4.28.15823
    Calibre 5.24
    Obok plugin 7.2.1

    calibre Debug log
    calibre 5.24 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    calibre 5.24 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 2.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 83.22184300341296 x 83.12727272727273
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.02] Showing splash screen…
    [0.56] splash screen shown
    [0.56] Initializing db…
    [0.62] db initialized
    [0.62] 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.47] main UI initialized…
    [1.47] Hiding splash screen
    Starting QuickView
    [78.27] splash screen hidden
    [78.27] Started up in 78.27 seconds with 849 books
    Running Obok DeDRM v7.2.1
    DEBUG: 82.6 didn’t find device
    Obok v4.0.0
    Copyright © 2012-2020 Physisticated et al.
    C:\Users[my name]\AppData\Local\Temp\tmp3sb5ccqf
    DEBUG: 82.6 got kobodir C:\Users[my name]\AppData\Local\Kobo\Kobo Desktop Edition
    Found 12 possible keys to try.
    DEBUG: 87.0 BookListTableWidget:get_books – book_num: 5
    DEBUG: 87.0 BookListTableWidget:get_books – book: Of Ants and Dinosaurs
    DEBUG: 87.0 InterfacePluginAction::launchObok – number of books to decrypt: 1
    Obok DeDRM v7.2.1 – Decrypting Of Ants and Dinosaurs
    Trying key: b’197ce7e21a7d4e3c402fd475f8f066ac’
    Checking text:b’\xcc\xb6\x9ctI\x8a\xbc!\x8b\xed’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 204
    Decryption failed, trying next key.
    Trying key: b’1d476e112362cdba72dff11aee5b1259′
    Checking text:b’\xa8\xd8\n\xe2\xbb\x9d\xc3\x86\xaat’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 168
    Decryption failed, trying next key.
    Trying key: b’e50b2e17e8eba87141029b22d738ec5f’
    Checking text:b’\xd5\x05\xc2\x15\xaeD\x12P\xfd\xba’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 213
    Decryption failed, trying next key.
    Trying key: b’73882f2f27b3e627b757d7cc2cc572a9′
    Checking text:b’\x8e6″\xfc\xf7\xad\x8f\xde\x13\xed’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 142
    Decryption failed, trying next key.
    Trying key: b’fafbd28c93760ea95f311c76c5e82214′
    Checking text:b’_e\xeb4&\xd2\xd2\x18\xaf\xf0′:
    Perhaps utf-8 without BOM
    Bad character at 2, value 235
    Decryption failed, trying next key.
    Trying key: b’5142f57926adffb4a81c55839d88a18f’
    Checking text:b”O\xe9!{5\xb3\x120’\xf9″:
    Perhaps utf-8 without BOM
    Bad character at 1, value 233
    Decryption failed, trying next key.
    Trying key: b’cabcb7adf7f5609ac00685c67fa7b4db’
    Checking text:b’\xa3\xf9\xc8!<\xa9\xd1\xf3/b’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 163
    Decryption failed, trying next key.
    Trying key: b’13a6681151f2e6666bd56d4cc8eb9f88′
    Checking text:b”‘q\x11$\xe3\xf6\x04\xf2\x13\xce”:
    Perhaps utf-8 without BOM
    Bad character at 2, value 17
    Decryption failed, trying next key.
    Trying key: b’1a3d5a4f75c32b77b27e55b4f4d0e4e6′
    Checking text:b’\xe1VmU\xe1ZH\xbd\xec+’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 225
    Decryption failed, trying next key.
    Trying key: b’f3168006d64b47991e3065fbb10feb32′
    Checking text:b’9\xaaD\x0bZ\rV\xd3<\xef’:
    Perhaps utf-8 without BOM
    Bad character at 1, value 170
    Decryption failed, trying next key.
    Trying key: b’ea96e0b354c02487c44e0b683b119f95′
    Checking text:b’P\x93\x18\x9a\x0br\xe2V\xd9\xd5′:
    Perhaps utf-8 without BOM
    Bad character at 1, value 147
    Decryption failed, trying next key.
    Trying key: b’4bc4077115ee9f2d9b5fec0b1bb96cca’
    Checking text:b’\xcd3\xb2Wt\x06\xab\xe7\x8d\x8d’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 205
    Decryption failed, trying next key.
    Obok DeDRM v7.2.1 – Couldn’t decrypt Of Ants and Dinosaurs
    DEBUG: 87.1 DecryptAddProgressDialog::do_book_action – book decryption failed: ‘Of Ants and Dinosaurs’
    Obok DeDRM v7.2.1 – wrapping up results.

  10. I’ve downloaded the latest tools for the DeDRM Calibre plugin, but I’m currently having problems with removing the DRM from a couple of Topaz files I’ve recently downloaded, or that’s what I’m guessing might be the problem. It used to be that importing Topaz files into Calibre worked fine, but now all I’m getting is “Could not convert the book because no supported source format was found”. What should I be doing that I’m not doing? Is this linked to DRM not being removed so that the Topaz file doesn’t become an HTML file, or something else? I wouldn’t ask except I need these two ebooks for work and find holding physical books hard to hold.

    • When calibre version 5 was released it changed the underlying software implementation from Python 2 to Python 3. This required updates to most plugins in order for them to work properly. DeDRM was updated to version 7 (currently 7.2.1) to work with calibre 5.

      Unfortunately, some infrequently used functionality, such as support for Topaz, has not yet been made to work in the new version. In order to import Topaz books you need to downgrade calibre to version 4.23 and install DeDRM 6.8.1. To ovoid compatibility problems do not install an version of calibre older than 4.23!

      https://download.calibre-ebook.com/4.23.0/

      https://github.com/apprenticeharper/DeDRM_tools/releases/tag/v6.8.1

  11. I’m completely new to all this. Have downloaded DeDRM tools 7.2.1, unzipped and cannot find a “DeDRM_calibre_plugin” folder, so obviously cannot find the DeDRM-plugin zip file in that folder. Also do not understand what an “archive” means.
    Can anyone help, instructions are very clear, but no calibre seen in DeDRM tools.

      • I know that, and have Calibre installed. My problem is that Alf’s bog says:
        “Download Apprentice Alf’s DRM removal tools for ebooks.” This comes as a .zip archive, so open it up and put the “DeDRM-calibre-plugin” folder where you can find it.”
        When I download Alf’s DRM removal tools for ebooks – I cannot find the “DeDRM_calibre_plugin” folder, it is simply not there.
        Any suggestions.

        • Open the FIRST zip file. In there should be another zip file labeled as the Calibre plugin. DO NOT OPEN THIS SECOND ZIP FILE; put the unopened file into Calibre.

          Yes, the instructions are very unclear on this but they refuse to rewrite them to make it clear. Hence the members hrere have to explain how to do it ad nauseum.

  12. Hi,
    I used to run de-DRM no problem and have run into trouble the last couple years. I deregistered my kindle for mac, deleted it/the content folders, redownloaded it/ my books, and tried to import into the latest version of calibre with the latest version of deDRM. I’m running Mac OS 10.15.7. I would really like to get these books deDRM-ed so I can listen to them text to speech.
    Here’s my error log:
    calibre Debug log
    calibre 5.24 embedded-python: True is64bit: True
    macOS-10.15.7-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘19.6.0’, ‘Darwin Kernel Version 19.6.0: Thu May 6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64’)
    Python 3.8.5
    OSX: (‘10.15.7’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    calibre 5.24 embedded-python: True is64bit: True
    macOS-10.15.7-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘19.6.0’, ‘Darwin Kernel Version 19.6.0: Thu May 6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64’)
    Python 3.8.5
    OSX: (‘10.15.7’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    devicePixelRatio: 2.0
    logicalDpi: 72.0 x 72.0
    physicalDpi: 110.50000165954353 x 110.50000165954353
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.03] Showing splash screen…
    [0.24] splash screen shown
    [0.24] Initializing db…
    [0.24] db initialized
    [0.24] Constructing main UI…
    /Users/rachelnaffziger/Documents/Calibre is not a valid directory to watch for new ebooks, ignoring
    [0.92] main UI initialized…
    [0.92] Hiding splash screen
    Starting QuickView
    DeDRM v7.2.1: Trying to decrypt B00EQWBMQE_EBOK.azw
    Using Library AlfCrypto Python
    Using Library AlfCrypto Python
    Decrypting Topaz ebook: Urban Ministry: The Kingdom, the City & the People of God
    Got DSN key from database default_key_3
    Found 10 keys to try after 0.1 seconds
    Trying: b’mMvc/iTk’
    DeDRM v7.2.1: Failed to decrypt with error: ord() expected string of length 1, but int found
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    Found k4Mac kinf2018 file: /Users/rachelnaffziger/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2018
    trying username b’rachelnaffziger’ on file /Users/rachelnaffziger/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2018
    trying IDString: b’ddeae678c4cf’
    Decrypted key file using IDString ‘ddeae678c4cf’ and UserName ‘rachelnaffziger’
    DeDRM v7.2.1: Found 1 new key
    Decrypting Topaz ebook: Urban Ministry: The Kingdom, the City & the People of God
    Got SerialNumber from database default_key_1
    Got UsernameHash from database default_key_1
    Found 4 keys to try after 0.6 seconds
    Trying: b’0y2UASpL’
    DeDRM v7.2.1: Ultimately failed to decrypt after 0.6 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.topazextract”, line 352, in processBook
    bookKeys+=decryptDkeyRecords(data,pid)
    File “calibre_plugins.dedrm.topazextract”, line 192, in decryptDkeyRecords
    key = decryptDkeyRecord(data[1:length+1],PID)
    File “calibre_plugins.dedrm.topazextract”, line 174, in decryptDkeyRecord
    record = decryptRecord(data,PID)
    File “calibre_plugins.dedrm.topazextract”, line 169, in decryptRecord
    ctx = topazCryptoInit(PID)
    File “calibre_plugins.dedrm.topazextract”, line 144, in topazCryptoInit
    return Topaz_Cipher().ctx_init(key)
    File “calibre_plugins.dedrm.alfcrypto”, line 211, in ctx_init
    keyByte = ord(keyChar)
    TypeError: ord() expected string of length 1, but int found

    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 0.6 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 433, in get_file_type_metadata
    File “calibre/customize/builtins.py”, line 289, in get_metadata
    File “calibre/ebooks/metadata/mobi.py”, line 497, in get_metadata
    File “calibre/ebooks/metadata/topaz.py”, line 378, in get_metadata
    File “calibre/ebooks/metadata/topaz.py”, line 114, in init
    ValueError: ‘/Users/rachelnaffziger/Documents/Kindle Books/My Kindle Content/B00EQWBMQE_EBOK/B00EQWBMQE_EBOK.azw’: Invalid Topaz format – no metadata record
    [4.17] splash screen hidden
    [4.17] Started up in 4.17 seconds with 0 books
    Added B00EQWBMQE EBOK to db in: 0.0
    Added 1 books in 1.0 seconds

    Best wishes and thank you,
    Rachel

  13. Hi,
    I used this till maybe 2018 when it stopped working on my Mac. I’m running Mac OS 10.15.7, the latest version of calibre, and the latest version of the deDRM plugin. I have also deregistered my old kindle for mac, deleted the app/content folders, emptied the trash, redownloaded the app, and reimported my books into calibre fresh… (I did delete them all from the calibre content library.) Here’s my error log from debug mode:
    calibre Debug log
    calibre 5.24 embedded-python: True is64bit: True
    macOS-10.15.7-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘19.6.0’, ‘Darwin Kernel Version 19.6.0: Thu May 6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64’)
    Python 3.8.5
    OSX: (‘10.15.7’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    calibre 5.24 embedded-python: True is64bit: True
    macOS-10.15.7-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘19.6.0’, ‘Darwin Kernel Version 19.6.0: Thu May 6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64’)
    Python 3.8.5
    OSX: (‘10.15.7’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    devicePixelRatio: 2.0
    logicalDpi: 72.0 x 72.0
    physicalDpi: 110.50000165954353 x 110.50000165954353
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.03] Showing splash screen…
    [0.24] splash screen shown
    [0.24] Initializing db…
    [0.24] db initialized
    [0.24] Constructing main UI…
    /Users/rachelnaffziger/Documents/Calibre is not a valid directory to watch for new ebooks, ignoring
    [0.92] main UI initialized…
    [0.92] Hiding splash screen
    Starting QuickView
    DeDRM v7.2.1: Trying to decrypt B00EQWBMQE_EBOK.azw
    Using Library AlfCrypto Python
    Using Library AlfCrypto Python
    Decrypting Topaz ebook: Urban Ministry: The Kingdom, the City & the People of God
    Got DSN key from database default_key_3
    Found 10 keys to try after 0.1 seconds
    Trying: b’mMvc/iTk’
    DeDRM v7.2.1: Failed to decrypt with error: ord() expected string of length 1, but int found
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    Found k4Mac kinf2018 file: /Users/rachelnaffziger/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2018
    trying username b’rachelnaffziger’ on file /Users/rachelnaffziger/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2018
    trying IDString: b’ddeae678c4cf’
    Decrypted key file using IDString ‘ddeae678c4cf’ and UserName ‘rachelnaffziger’
    DeDRM v7.2.1: Found 1 new key
    Decrypting Topaz ebook: Urban Ministry: The Kingdom, the City & the People of God
    Got SerialNumber from database default_key_1
    Got UsernameHash from database default_key_1
    Found 4 keys to try after 0.6 seconds
    Trying: b’0y2UASpL’
    DeDRM v7.2.1: Ultimately failed to decrypt after 0.6 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.topazextract”, line 352, in processBook
    bookKeys+=decryptDkeyRecords(data,pid)
    File “calibre_plugins.dedrm.topazextract”, line 192, in decryptDkeyRecords
    key = decryptDkeyRecord(data[1:length+1],PID)
    File “calibre_plugins.dedrm.topazextract”, line 174, in decryptDkeyRecord
    record = decryptRecord(data,PID)
    File “calibre_plugins.dedrm.topazextract”, line 169, in decryptRecord
    ctx = topazCryptoInit(PID)
    File “calibre_plugins.dedrm.topazextract”, line 144, in topazCryptoInit
    return Topaz_Cipher().ctx_init(key)
    File “calibre_plugins.dedrm.alfcrypto”, line 211, in ctx_init
    keyByte = ord(keyChar)
    TypeError: ord() expected string of length 1, but int found

    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 0.6 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 433, in get_file_type_metadata
    File “calibre/customize/builtins.py”, line 289, in get_metadata
    File “calibre/ebooks/metadata/mobi.py”, line 497, in get_metadata
    File “calibre/ebooks/metadata/topaz.py”, line 378, in get_metadata
    File “calibre/ebooks/metadata/topaz.py”, line 114, in init
    ValueError: ‘/Users/rachelnaffziger/Documents/Kindle Books/My Kindle Content/B00EQWBMQE_EBOK/B00EQWBMQE_EBOK.azw’: Invalid Topaz format – no metadata record
    [4.17] splash screen hidden
    [4.17] Started up in 4.17 seconds with 0 books
    Added B00EQWBMQE EBOK to db in: 0.0
    Added 1 books in 1.0 seconds

    I’d really like to get these converted so I can listen to them in text to speech software.
    Thank you for your help,
    Rachel

    • Decrypting Topaz ebook: Urban Ministry: The Kingdom, the City & the People of God

      This book appears to be in Topaz format, which tools 7.2.1 have trouble with. You might try going back to Calibre 4.23 and tools 6.8.1.

  14. Hi, I’ve tried a bunch of times and not able to remove DRM from my kindle books using the plugin – I have a feeling it might have to do with the “key” step, as I’m not totally sure I understand the “managing keys for mac/pc kindle” documentation page.

    which tool was used: Calibre (GUI), version 5.25, Kindle for Mac 1.31, having run the chmod -x /Applications/Kindle.app/Contents/MacOS/renderer-test , deleting and redownloading ebooks, DeDRM tools 7.2.1
    which OS you are using: MacOS Catalina 10.15.6
    where the ebook file came from (device or application): Kindle for Mac 1.31
    any error messages: just a “Could not remove DRM from this device”
    a log of the DRM-removal attempt (see the FAQs on how to get a log) -see below.

    Thanks for any help!!!

    Here is the log when I try and convert, and then open within calibre:
    Laurens-Air:DeDRM_tools_7.2.1 laurensorensen$ calibre-debug -g
    calibre 5.24 embedded-python: True is64bit: True
    macOS-10.15.6-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘19.6.0’, ‘Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64’)
    Python 3.8.5
    OSX: (‘10.15.6’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    devicePixelRatio: 1.0
    logicalDpi: 72.0 x 72.0
    physicalDpi: 128.00000192236715 x 128.00000192236715
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.05] Showing splash screen…
    [0.71] splash screen shown
    [0.71] Initializing db…
    [0.75] db initialized
    [0.75] Constructing main UI…
    [2.21] main UI initialized…
    [2.21] Hiding splash screen
    Starting QuickView
    [2.59] splash screen hidden
    [2.59] Started up in 2.59 seconds with 1 books
    Worker Launch took: 0.03 seconds
    Job: 0 Convert book 1 of 1 (The Four Agreements: A Practical Guide to Personal Freedom (A Toltec Wisdom Book)) finished
    Convert book 1 of 1 (The Four Agreements: A Practical Guide to Personal Freedom (A Toltec Wisdom Book))
    DeDRM v7.2.1: Trying to decrypt qa7sq_th.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: The Four Agreements: A Practical Guide to Personal Freedom (A Toltec Wisdom Book)
    Found 0 keys to try after 0.2 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Failed to decrypt with error: No key found in 0 PIDs tried.
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.2 seconds
    Found k4Mac kinf2018 file: /Users/laurensorensen/Library/Application Support/Kindle/storage/.kinf2018
    trying username b’laurensorensen’ on file /Users/laurensorensen/Library/Application Support/Kindle/storage/.kinf2018
    trying IDString: b’b9931e44b3f3′
    Decrypted key file using IDString ‘b9931e44b3f3’ and UserName ‘laurensorensen’
    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: The Four Agreements: A Practical Guide to Personal Freedom (A Toltec Wisdom Book)
    Got SerialNumber from database default_key_1
    Got UsernameHash from database default_key_1
    Found 4 keys to try after 1.1 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Ultimately failed to decrypt after 1.1 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
    read_metadata_from_opf: ‘/var/folders/mj/sb5r0czs3mvbvk140zl4xthh0000gn/C/calibre_5.24.0_tmp_onld5ftq/wmjrbdxs.opf’
    output_profile: ‘kobo’
    cover: ‘/var/folders/mj/sb5r0czs3mvbvk140zl4xthh0000gn/C/calibre_5.24.0_tmp_onld5ftq/hj5eytbk.jpeg’
    Resolved conversion options
    calibre version: 5.24.0
    {‘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/mj/sb5r0czs3mvbvk140zl4xthh0000gn/C/calibre_5.24.0_tmp_onld5ftq/hj5eytbk.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’: ‘2’,
    ‘expand_css’: False,
    ‘extra_css’: None,
    ‘extract_to’: None,
    ‘filter_css’: ”,
    ‘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 0x115991be0>,
    ‘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.KoboReaderOutput object at 0x1159a12b0>,
    ‘page_breaks_before’: “//*[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’: ‘/var/folders/mj/sb5r0czs3mvbvk140zl4xthh0000gn/C/calibre_5.24.0_tmp_onld5ftq/wmjrbdxs.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’: ‘[]’,
    ‘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 0 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.1 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 qa7sq_th.azw
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: The Four Agreements: A Practical Guide to Personal Freedom (A Toltec Wisdom Book)
    Found 0 keys to try after 0.0 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Failed to decrypt with error: No key found in 0 PIDs tried.
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.0 seconds
    Found k4Mac kinf2018 file: /Users/laurensorensen/Library/Application Support/Kindle/storage/.kinf2018
    trying username  b'laurensorensen'  on file  /Users/laurensorensen/Library/Application Support/Kindle/storage/.kinf2018
    trying IDString: b'b9931e44b3f3'
    Decrypted key file using IDString 'b9931e44b3f3' and UserName 'laurensorensen'
    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: The Four Agreements: A Practical Guide to Personal Freedom (A Toltec Wisdom Book)
    Got SerialNumber from database default_key_1
    Got UsernameHash from database default_key_1
    Found 4 keys to try after 0.8 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Ultimately failed to decrypt after 0.8 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 0 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 0.8 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/mj/sb5r0czs3mvbvk140zl4xthh0000gn/C/calibre_5.24.0_tmp_onld5ftq/qa7sq_th.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 163, in check_for_drm
    calibre.ebooks.DRMError: The Four Agreements: A Practical Guide to Personal Freedom (A Toltec Wisdom Book)
    
    • DeDRM v7.2.1: Trying to decrypt qa7sq_th.azw

      The filename is a little odd. Where did this book come from? Is it a library book or Kindle Unlimited or some variation of a rental by any chance? If so, that might be the problem.

        • Did you try downgrading to Calibre 4.23 and tools 6.8.1 to see if that will work? And a clean install of K4Mac (delete the app itself and User > Library > Application Support > Kindle folder or Application Support > Containers > com.amazon.Kindle)?

          This ebook is also part of the “Great on Kindle” program, which may have something to do with it.

          Finally, there are a lot of error messages in the log that I’m not familiar with. Hopefully someone else more familiar with error messages will come along and help.

          • Thank you! I will try out downgrading Calibre. I did try completely uninstalling Kindle for Mac…

        • One last note — you deleted the book from K4Mac and Calibre and then re-imported it into K4Mac and then Calibre before trying to convert, yes? Removal of DRM happens on import, so if you didn’t delete the book and re-import it before trying to convert, that may be the problem.

            • You should also delete the ebooks from Calibre and re-import into Calibre each time. You did that, yes?

              Anyway, try downgrading to Calibre 4.23 and tools 6.8.1. If that doesn’t work, post a log from Calibre 4.23.

              Tools 7.2.1 sometimes has trouble getting the key from K4Mac. If you downgrade, 6.8.1 will retrieve the key, then you can upgrade back up to 7.2.1.

  15. Hi,
    I unsuccessfully tried DeDRM with callbre and Kindle for mac versions 1.31 and 1.26.1 (the oldest version I could run on macOS Catalina) but no luck. Log and other info is below.. thank you for any help!!!

    which tool was used: calibre 5.25; DeDRM 7.2.1 (restarted Calibre gui after installing plugin.. though I am not sure I did the customize then “key” action right? The documentation about generating keys I could not really understand…)
    which OS you are using: MacOS Catalina 10.15.6
    where the ebook file came from (device or application): Kindle for Mac v 1.31 and 1.26.1 – ran the sudo chmod … /renderer-test command each time before downloading books.
    any error messages: in calibre, after I try and open in viewer, says that there is DRM on the book when I try and open in the Calibre viewer.

    a log of the DRM-removal attempt:
    Laurens-Air:~ lau*******n$ calibre-debug -g
    calibre 5.24 embedded-python: True is64bit: True
    macOS-10.15.6-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘19.6.0’, ‘Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64’)
    Python 3.8.5
    OSX: (‘10.15.6’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    devicePixelRatio: 1.0
    logicalDpi: 72.0 x 72.0
    physicalDpi: 128.00000192236715 x 128.00000192236715
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.03] Showing splash screen…
    [0.39] splash screen shown
    [0.39] Initializing db…
    [0.40] db initialized
    [0.40] Constructing main UI…
    [1.38] main UI initialized…
    [1.38] Hiding splash screen
    Starting QuickView
    [1.56] splash screen hidden
    [1.56] Started up in 1.56 seconds with 0 books
    Laurens-Air:~ lau******$ calibre-debug -g
    calibre 5.24 embedded-python: True is64bit: True
    macOS-10.15.6-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘19.6.0’, ‘Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64’)
    Python 3.8.5
    OSX: (‘10.15.6’, (”, ”, ”), ‘x86_64′)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    devicePixelRatio: 1.0
    logicalDpi: 72.0 x 72.0
    physicalDpi: 128.00000192236715 x 128.00000192236715
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.04] Showing splash screen…
    [0.40] splash screen shown
    [0.40] Initializing db…
    [0.41] db initialized
    [0.41] Constructing main UI…
    [1.52] main UI initialized…
    [1.52] Hiding splash screen
    Starting QuickView
    [1.82] splash screen hidden
    [1.82] Started up in 1.82 seconds with 0 books
    DeDRM v7.2.1: Trying to decrypt B08LLD7QM5_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: Ben Fletcher
    Found 0 keys to try after 0.2 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Failed to decrypt with error: No key found in 0 PIDs tried.
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.2 seconds
    Found k4Mac kinf2018 file: /Users/laurens******/Library/Application Support/Kindle/storage/.kinf2018
    trying username b’laurens****’ on file /Users/laurenso*****/Library/Application Support/Kindle/storage/.kinf2018
    trying IDString: b’b9931e44b3f3′
    Decrypted key file using IDString ‘b9931e44b3f3’ and UserName ‘laure*****’
    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: Ben Fletcher
    Got SerialNumber from database default_key_1
    Got UsernameHash from database default_key_1
    Found 4 keys to try after 1.1 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Ultimately failed to decrypt after 1.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 “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 0 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.1 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Added Ben Fletcher to db in: 0.1
    Added 1 books in 1.9 seconds
    Worker Launch took: 0.01 seconds

    • DeDRM v7.2.1: Trying to decrypt B08LLD7QM5_EBOK.azw … Ben Fletcher

      Where did this ebook come from? When I search B08LLD7QM5, there are no results on Amazon. When I search “Ben Fletcher” it’s only available in print, not ebook.

      • I don’t know what to say, I did buy it on amazon! The exact same thing happens with all my other books too, this was just an example I used running in debug mode. It was there as an ebook in January of this year and I have a receipt. Any other thoughts? Thanks.

        • I am out of ideas. Maybe the fact that the book is no longer available in ebook format has something to do with this.

        • By the way, you did already try this with Calibre 4.23 and tools 6.8.1, right? That should be one of the first things you try, as noted above. If that doesn’t work, post a log from Calibre 4.23/tools 6.8.1

    • Mac users have trouble with the initial key retrieval on DeDRM 7.2.1. Try calibre 4.23 and DeDRM 6.8.1. If you get things working with those versions, you should be able to return to the current versions.

  16. Hello! I bought a book off the Kobo website, downloaded onto the Kobo Desktop on my Windows 10 computer. When I tried to use the Obok plug-in to convert the file, it told me that it couldn’t be decrypted. What am I missing? Here is the error log:

    calibre Debug log
    calibre 5.25 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    calibre 5.25 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 2.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 83.22184300341296 x 83.12727272727273
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.41] splash screen shown
    [0.41] 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.03] main UI initialized…
    [1.03] Hiding splash screen
    Starting QuickView
    [4.61] splash screen hidden
    [4.61] Started up in 4.61 seconds with 1 books
    Running Obok DeDRM v7.2.1
    DEBUG: 7.2 didn’t find device
    Obok v4.0.0
    Copyright © 2012-2020 Physisticated et al.
    C:\Users\Leora\AppData\Local\Temp\tmpg7ycttgt
    DEBUG: 7.3 got kobodir C:\Users\Leora\AppData\Local\Kobo\Kobo Desktop Edition
    Found 8 possible keys to try.
    DEBUG: 11.3 BookListTableWidget:get_books – book_num: 1
    DEBUG: 11.3 BookListTableWidget:get_books – book: The Case for Contention
    DEBUG: 11.3 InterfacePluginAction::launchObok – number of books to decrypt: 1
    Obok DeDRM v7.2.1 – Decrypting The Case for Contention
    Trying key: b’933bd8518caa7089647d9c7b2381a1d3′
    Checking text:b’H\xe70s\x06q\xcb\xa9\xc8\x8e’:
    Perhaps utf-8 without BOM
    Bad character at 1, value 231
    Decryption failed, trying next key.
    Trying key: b’c4dc7c31727b150313835f418c75b9ee’
    Checking text:b”‘@\xa5P\xe5\xa2\tV\xe7F”:
    Perhaps utf-8 without BOM
    Bad character at 2, value 165
    Decryption failed, trying next key.
    Trying key: b’91cd0b9cbf2b854642ef649886377d0c’
    Checking text:b'{\xf7\xf8[>\xfceh\x9fE’:
    Perhaps utf-8 without BOM
    Bad character at 1, value 247
    Decryption failed, trying next key.
    Trying key: b’048781dfba1ee152b0008339d88456b6′
    Checking text:b’\xe7\x04d\re\x05\xc7\xb2\xee\xd5′:
    Perhaps utf-8 without BOM
    Bad character at 0, value 231
    Decryption failed, trying next key.
    Trying key: b’9f638c8a300b1309628e4be874136309′
    Checking text:b’E.\xf8`J\xd4\x8b\xad\x13:’:
    Perhaps utf-8 without BOM
    Bad character at 2, value 248
    Decryption failed, trying next key.
    Trying key: b’4c85b676bfe9ac6cb65c7e8325e29dbb’
    Checking text:b’0\xc81uho\xc4J\x1d.’:
    Perhaps utf-8 without BOM
    Bad character at 1, value 200
    Decryption failed, trying next key.
    Trying key: b’a5849e1b14d6020db89486c5d290b54f’
    Checking text:b’\xbb\x01\xce\x02E\x06\x01\x1c\xdd\x16′:
    Perhaps utf-8 without BOM
    Bad character at 0, value 187
    Decryption failed, trying next key.
    Trying key: b’82bc7d0ed0678fd4468a7b106c101260′
    Checking text:b’\xc1>\xae\x82\xa2Ur\x11\xf6\xac’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 193
    Decryption failed, trying next key.
    Obok DeDRM v7.2.1 – Couldn’t decrypt The Case for Contention
    DEBUG: 11.4 DecryptAddProgressDialog::do_book_action – book decryption failed: ‘The Case for Contention’
    Obok DeDRM v7.2.1 – wrapping up results.

  17. azw file downloaded from K4PC 1.17, as instructed here
    the file imports to calibre, but is not readable, and won’t convert, stating DRM in the dialog
    I’ve tried the solutions here, still nothing works.
    windows 10, latest

    log:
    calibre Debug log
    calibre 5.25 [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: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 41, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 41, 0) && KFX metadata reader (from KFX Input) (1, 41, 0) && KFX Input (1, 41, 0) && KindleUnpack – The Plugin (0, 82, 1) && Obok DeDRM (7, 2, 1)
    calibre 5.25 [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: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 41, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 41, 0) && KFX metadata reader (from KFX Input) (1, 41, 0) && KFX Input (1, 41, 0) && KindleUnpack – The Plugin (0, 82, 1) && Obok DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 2.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 109.21999999999998 x 109.18208955223879
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [1.70] splash screen shown
    [1.70] Initializing db…
    [1.73] db initialized
    [1.73] 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.1 obok::action_err.py – loading translations
    [2.98] main UI initialized…
    [2.98] Hiding splash screen
    Starting QuickView
    Failed to check for plugin update: Module use of python27.dll conflicts with this version of Python.
    Gather KFX-ZIP (from KFX Input) 1.41.0: Importing C:/Users/hnvadmin1/Documents/My Kindle Content/B01MR1TTS4_EBOK.azw
    Gather KFX-ZIP (from KFX Input): File is not KFX format
    DeDRM v7.2.1: Trying to decrypt B01MR1TTS4_EBOK.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 18, in
    File “zipimport.py”, line 259, in load_module
    File “C:\Users\hnvadmin1\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 33, in
    File “bypy-importer.py”, line 203, in exec_module
    File “Crypto\Cipher__init__.py”, line 33, in
    File “bypy-importer.py”, line 203, in exec_module
    File “Crypto\Cipher_mode_ccm.py”, line 44, in
    ImportError: Module use of python27.dll conflicts with this version of Python.

    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
    File “calibre_plugins.dedrm.init“, line 527, in KindleMobiDecrypt
    File “calibre\customize\zipplugin.py”, line 192, in exec_module
    File “calibre_plugins.dedrm.k4mobidedrm”, line 88, in
    File “calibre\customize\zipplugin.py”, line 192, in exec_module
    File “calibre_plugins.dedrm.kfxdedrm”, line 20, in
    File “calibre\customize\zipplugin.py”, line 192, in exec_module
    File “calibre_plugins.dedrm.ion”, line 33, in
    File “bypy-importer.py”, line 203, in exec_module
    File “Crypto\Cipher__init__.py”, line 33, in
    File “bypy-importer.py”, line 203, in exec_module
    File “Crypto\Cipher_mode_ccm.py”, line 44, in
    ImportError: Module use of python27.dll conflicts with this version of Python.
    [9.59] splash screen hidden
    [9.61] Started up in 9.61 seconds with 1 books
    Added What the CEO Wants You To Know, Expanded and Updated to db in: 0.1
    Added 1 books in 0.7 seconds

    • Not sure if this is something about your setup or this particular book, but this log has some strange errors. I’d try removing DeDRM from calibre. Close and restart calibre. Re-install DeDRM. Then close and restart calibre again before trying to add a book.

  18. Hi,

    I have Kindle for PC v1.32 on Window 10 v1909. I first disabled KFX format by running Kindle.cmd batch file. Checked in Registry Editor that isKRFDRendererSupported is false. Then a test, I downloaded a book as via Kindle, there’re 4 files (*.apnx, *.azw, *.mbpV2 & *.phl) in one folder that’s apparently designated for that book.

    I also have a Mac w/Big Sur v11.5.2 where Calibre v5.25 is installed, along w/DeDRM v7.2. I was able to add the test book (the aforementioned folder w/4 files in it) in Calibre, able to see the author info, format as “AZW”, & its own cover image. But when I go to convert the book, it fails & says “The book is locked by DRM”. No detail error message in debug file but below lines:

    This debug folder contains snapshots of the e-book as it passes through the
    various stages of conversion. The stages are:

    1. input - This is the result of running the input plugin on the source
    file. Use this folder to debug the input plugin.
    
    2. parsed - This is the result of preprocessing and parsing the output of
    the input plugin. Note that for some input plugins this will be identical to
    the input sub-folder. Use this folder to debug structure detection,
    etc.
    
    3. structure - This corresponds to the stage in the pipeline when structure
    detection has run, but before the CSS is flattened. Use this folder to
    debug the CSS flattening, font size conversion, etc.
    
    4. processed - This corresponds to the e-book as it is passed to the output
    

    plugin. Use this folder to debug the output plugin.

    I wonder if it’s because I didn’t configure DeDRM w/Kindle device serial #, since I currently don’t own a Kindle e-ink reader.

    Or is it because both of my laptop OS are in 64-bit, the latest version, and Calibre DRM removal plugging doesn’t work well in that computer environment?

    I don’t want to downgrade OS on either of the laptop. What should I do? Should I just buy a Kindle e-ink device so that I can use “Download & transfer via USB” via Amazon website to get AZW3 file for the book? But will DeDRM v7.2 in Calibre v5.25 work well on AZW3 file when OS is 64-bit? ​

    BTW, I tried my luck w/Epubor Ultimate, installed on Mac, v3.0.13.812. Same results “Kindle DRM Removal failed!”

    Last but not the least, I bought the book via Amazon, it’s NOT a rented book.

  19. Each installation of Kindle for Pc/Mac has its own encryption key. You can’t download on one computer and decrypt on another.

  20. My apologies for the length of this message: there are two logs at the bottom.

    I have some books bought from Kobo that don’t properly decrypt with Obok. Actually I’ve had this happen a few times before with Manga, but this is the first time with plain English text.

    The symptoms are that the book is allegedly successfully decrypted, but there is no cover page (so it gets a generic one from calibre), and opening the book reveals that it is complete garbage. Unpacking the epub and looking at the .htm files confirms that they are just garbage.

    The book itself in Kobo is fine – Kobo Desktop reads it without problem.

    Looking at the debug logs, I see that there are 12 encryption keys to try, and on the bad book, the second one “works” as in, produces a valid UTF-8 sequence. Comparing with the import of a book that actually works, it is the 9th key that works.

    My (confident) conjecture is that Obok’s algorithm for detecting successful decryption is defective in that it accepts an unsuccessful decryption. Perhaps instead of merely checking for a valid UTF-8 sequence, it should check that the text looks like XML or HTML, e.g. starting with ‘<?xml’ (the first character in that string is a less-than sign). Perhaps the best way would be to go through all the encryption keys with a strict check for XML output, and only if one is not found, go through again with the current permissive check.

    I’d try this myself, but my python skills are pretty poor (yes I am a programmer, no I don’t use python at work), so this will take some time and I may not succeed.

    Or perhaps someone has a better idea as to what is going wrong, or a suggestion of something else to try.

    Now the logs: first, the one for a decryption that produces garbage:
    calibre Debug log
    calibre 5.25 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    calibre 5.25 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 108.73578595317724 x 108.85714285714285
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.31] splash screen shown
    [0.31] Initializing db…
    [0.33] db initialized
    [0.33] 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.75] main UI initialized…
    [0.75] Hiding splash screen
    Starting QuickView
    Traceback (most recent call last):
    File “calibre\db\cache.py”, line 1458, in set_metadata
    File “calibre\db\cache.py”, line 1381, in set_cover
    File “calibre\db\backend.py”, line 1532, in set_cover
    File “calibre\utils\img.py”, line 288, in save_cover_data_to
    File “calibre\utils\img.py”, line 196, in image_to_data
    ValueError: Failed to export image as JPEG with error: Image is empty
    [27.11] splash screen hidden
    [27.11] Started up in 27.11 seconds with 616 books
    Running Obok DeDRM v7.2.1
    DEBUG: 29.7 didn’t find device
    Obok v4.0.0
    Copyright © 2012-2020 Physisticated et al.
    C:\Users\maru-\AppData\Local\Temp\tmp01lu1l1_
    DEBUG: 29.7 got kobodir C:\Users\maru-\AppData\Local\Kobo\Kobo Desktop Edition
    Found 12 possible keys to try.
    DEBUG: 52.5 BookListTableWidget:get_books – book_num: 13
    DEBUG: 52.5 BookListTableWidget:get_books – book: The Kitty Peck Mysteries
    DEBUG: 52.5 InterfacePluginAction::launchObok – number of books to decrypt: 1
    Obok DeDRM v7.2.1 – Decrypting The Kitty Peck Mysteries
    Trying key: b’1003f2f9818a8b99d789c8ff111c441b’
    Checking text:b”\xf5t’=\xf5\xb9\x96\xe6\xcf\xe4″:
    Perhaps utf-8 without BOM
    Bad character at 0, value 245
    Decryption failed, trying next key.
    Trying key: b’024f5156b8f506046e63145a42cb5414′
    Checking text:b’_sT(L”\xe9\x1a\xd0\x93′:
    Perhaps utf-8 without BOM
    Seems to be good text
    Success!
    DEBUG: 52.7 DecryptAddProgressDialog::do_book_action – decrypted book: ‘The Kitty Peck Mysteries’
    Obok DeDRM v7.2.1 – Added The Kitty Peck Mysteries
    Obok DeDRM v7.2.1 – wrapping up results.

    Now the log for a decryption that produces a good book:
    calibre Debug log
    calibre 5.25 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    calibre 5.25 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 108.73578595317724 x 108.85714285714285
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.31] splash screen shown
    [0.31] Initializing db…
    [0.33] db initialized
    [0.33] 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.75] main UI initialized…
    [0.75] Hiding splash screen
    Starting QuickView
    [10.53] splash screen hidden
    [10.53] Started up in 10.53 seconds with 616 books
    Running Obok DeDRM v7.2.1
    DEBUG: 20.3 didn’t find device
    Obok v4.0.0
    Copyright © 2012-2020 Physisticated et al.
    C:\Users\maru-\AppData\Local\Temp\tmp6derom5u
    DEBUG: 20.3 got kobodir C:\Users\maru-\AppData\Local\Kobo\Kobo Desktop Edition
    Found 12 possible keys to try.
    DEBUG: 24.1 BookListTableWidget:get_books – book_num: 6
    DEBUG: 24.1 BookListTableWidget:get_books – book: Telling Tales
    DEBUG: 24.1 InterfacePluginAction::launchObok – number of books to decrypt: 1
    Obok DeDRM v7.2.1 – Decrypting Telling Tales
    Trying key: b’1003f2f9818a8b99d789c8ff111c441b’
    Checking text:b’>\xc1\xf6I\xe0\xc0sez\t’:
    Perhaps utf-8 without BOM
    Bad character at 1, value 193
    Decryption failed, trying next key.
    Trying key: b’024f5156b8f506046e63145a42cb5414′
    Checking text:b’\x16]I\xe3\x86\xb2_\x95\xda)’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 22
    Decryption failed, trying next key.
    Trying key: b’eb4676a5fde80a458619c24a3eb26f8d’
    Checking text:b’\xaaf\xfe[1`\xef\xf9{\xce’:
    Perhaps utf-8 without BOM
    Bad character at 0, value 170
    Decryption failed, trying next key.
    Trying key: b’d496bf987c4eee532086560678130f58′
    Checking text:b’\x876Mo\xfe\x92\xcc\xa2\x92\xe7′:
    Perhaps utf-8 without BOM
    Bad character at 0, value 135
    Decryption failed, trying next key.
    Trying key: b’40e1255bbcbc258cea93d85782dc7916′
    Checking text:b’wJ\xb0!\xc9r>\xc2X\x05′:
    Perhaps utf-8 without BOM
    Bad character at 2, value 176
    Decryption failed, trying next key.
    Trying key: b’394de911db7bcf09a49c85147b597125′
    Checking text:b’\x02M/g\xd1m\x18D\xbe\xd6′:
    Perhaps utf-8 without BOM
    Bad character at 0, value 2
    Decryption failed, trying next key.
    Trying key: b’dc34e30b3036bfd290d9a7ead1560784′
    Checking text:b’u\xae\x82\xc1\xae\xdbNM\xe7\xf8′:
    Perhaps utf-8 without BOM
    Bad character at 1, value 174
    Decryption failed, trying next key.
    Trying key: b’6f54cc5e0684ea0152b1e649d0b94280′
    Checking text:b’td\x1f\xde\x84\xb7CL\x8f,’:
    Perhaps utf-8 without BOM
    Bad character at 2, value 31
    Decryption failed, trying next key.
    Trying key: b’dec67ec92b79d487a0b9fb9662608975′
    Checking text:b'<?xml vers’:
    Perhaps utf-8 without BOM
    Seems to be good text
    Success!
    DEBUG: 24.2 DecryptAddProgressDialog::do_book_action – decrypted book: ‘Telling Tales’
    Obok DeDRM v7.2.1 – Added Telling Tales
    Obok DeDRM v7.2.1 – wrapping up results.

  21. calibre Debug log
    calibre 5.26 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    calibre 5.26 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 120.0 x 120.0
    physicalDpi: 141.7674418604651 x 141.4020618556701
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.31] splash screen shown
    [0.31] Initializing db…
    [0.31] db initialized
    [0.31] 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.89] main UI initialized…
    [0.89] Hiding splash screen
    Starting QuickView
    DeDRM v7.2.1: Trying to decrypt B07BGT2Q5L_EBOK.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Mobipocket 4 ebook: Network+ Guide to Networks
    Found 0 keys to try after 0.2 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Failed to decrypt with error: No key found in 0 PIDs tried.
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.2 seconds
    searching for kinfoFiles in C:\Users\plung\AppData\Local
    No K4PC kindle.info/kinf/kinf2011 files have been found.
    DeDRM v7.2.1: Ultimately failed to decrypt after 0.2 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    [8.27] splash screen hidden
    [8.27] Started up in 8.27 seconds with 4 books
    stdout+stderr from file dialog helper: [b”, b”]
    piped data from file dialog helper: [b’Gb\x9d\xb4\x08\xb0:kiP\x92%\xb0\xe4W\xdf\x03\xb5_\xf1W(\x96\xb1x\xabc\x18\xf9\xe7W_’, b’C:\Users\plung\Desktop\B07BGT2Q5L_EBOK.azw’]
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 540, in KindleMobiDecrypt
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    File “calibre_plugins.dedrm.mobidedrm”, line 484, in processBook
    calibre_plugins.dedrm.mobidedrm.DrmException: No key found in 0 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
    File “calibre_plugins.dedrm.init“, line 583, in KindleMobiDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 0.2 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/masAdded Network+ Guide to Networks to db in: 0.4
    Added 1 books in 3.0 seconds

    So is it missing a keylist?

  22. Hi,

    I’ve been using the dedrm plugin successfully for several months but now it is only working on EPUB files and some but not all ASW3 files. All are books I’ve purchased not rented. If anyone has an idea why this is happening, I’d appreciate it.

  23. Hi, I’m having a problem with some awz3 files. This one is acquired thru Amazon by the “download via USB” option. Am running the latest versions available: Calibre 5.26.0 and DeDRM 7.2.1. I have tried the combination of Calibre 4.23.0 with DeDRM 6.8.1, but it didn’t work either. Am using Windows 10. Log below. Thanks

    calibre Debug log
    calibre 5.26 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    calibre 5.26 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1) && Obok DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 102.23899371069182 x 102.35820895522387
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.02] Showing splash screen…
    [0.39] splash screen shown
    [0.39] Initializing db…
    [0.39] db initialized
    [0.39] 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.89] main UI initialized…
    [0.89] Hiding splash screen
    Starting QuickView
    DeDRM v7.2.1: Trying to decrypt What the New Testament Authors Really Cared About.azw3
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: What the New Testament Authors Really Cared About
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Failed to decrypt with error: No key found in 0 PIDs tried.
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\nicky\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\nicky\AppData\Local\Amazon\Kindle\storage\.kinf2018
    [6.34] splash screen hidden
    [6.34] Started up in 6.34 seconds with 4 books
    Decrypted key file using IDString ‘1950053597’ and UserName ‘Nicky’
    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: What the New Testament Authors Really Cared About
    Got DSN key from database default_key_1
    Found 4 keys to try after 2.7 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Ultimately failed to decrypt after 2.7 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
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    File “calibre_plugins.dedrm.mobidedrm”, line 484, in processBook
    calibre_plugins.dedrm.mobidedrm.DrmException: No key found in 0 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
    File “calibre_plugins.dedrm.__init__”, line 583, in KindleMobiDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 2.7 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/Added What the New Testament Authors Really Cared About to db in: 0.3
    Added 1 books in 3.2 seconds
    
  24. I’m running the latest edition of both Calibre and the DeDrm plugin on Windows10 but I’m still having trouble with some of my awz3 files not unlocking. I’ve entered my Kindle serial number as well and the problem is still occurring. This is my error log. Thanks in advance!

    calibre Debug log
    calibre 5.26 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 42, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 42, 0) && KFX metadata reader (from KFX Input) (1, 42, 0) && KFX Input (1, 42, 0)
    calibre 5.26 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 42, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 42, 0) && KFX metadata reader (from KFX Input) (1, 42, 0) && KFX Input (1, 42, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 118.41774744027302 x 118.22545454545454
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.02] Showing splash screen…
    [0.70] splash screen shown
    [0.70] Initializing db…
    [0.81] db initialized
    [0.81] Constructing main UI…
    [1.72] main UI initialized…
    [1.72] Hiding splash screen
    Starting QuickView
    DeDRM v7.2.1: Trying to decrypt The Highland Henchman (Highland Force Book 2).azw3
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v1.0.
    Copyright © 2008-2020 The Dark Reverser, Apprentice Harper et al.
    Decrypting Kindle Format 8 ebook: The Highland Henchman (Highland Force Book 2)
    Got DSN key from database default_key
    Found 8 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Failed to decrypt with error: No key found in 8 PIDs tried.
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\howardj11\AppData\Local
    Found K4PC 1.25+ kinf2018 file: C:\Users\howardj11\AppData\Local\Amazon\Kindle\storage.kinf2018
    [39.69] splash screen hidden
    [39.69] Started up in 39.69 seconds with 1009 books
    Decrypted key file using IDString ‘2551829001’ and UserName ‘howardj11’
    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: The Highland Henchman (Highland Force Book 2)
    Got DSN key from database default_key_1
    Found 4 keys to try after 5.7 seconds
    Crypto Type is: 2
    DeDRM v7.2.1: Ultimately failed to decrypt after 5.7 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
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    File “calibre_plugins.dedrm.mobidedrm”, line 484, in processBook
    calibre_plugins.dedrm.mobidedrm.DrmException: No key found in 8 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
    File “calibre_plugins.dedrm.init“, line 583, in KindleMobiDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: Ultimately failed to decrypt after 5.7 seconds. Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_toolsAdded The Highland Henchman (Highland Force Book 2) to db in: 2.9
    Added 1 books in 9.1 seconds

    • When you download the book from the website, be sure you have chosen an E-ink Kindle (not a Fire) for the device and enter that Kindle’s serial number into DeDRM’s customization. Easiest way to make sure it’s correct is to copy and paste it from the website.

  25. I am having issues and cant seem to work out how to get it to work. I have Calibre 5.26 and downloaded Alf’s 7.2.1 and followed the instructions. I have generated a error log in debug mode and am not smart enough to work out what it says BUT it does say this “Exception: Incorrect padding – Wrong key” a couple of times and also says “Exception: Failed to decrypt KFX DRM voucher with any key” that in the last line. Does this mean the serial number I put in for the kindle is wrong?… I am almost positive I typed it in correctly and I am sure it is the kindle I selected to send the book to when I purchased it off Amazon. (I have a heap of kindles all associated with my account) However if someone can tell me that my problem is definately an issue with the wrong serial number for my kindle I can then look into this further and maybe put in all the serial numbers for all my kindles in AND/OR I could change all the zero’s in my kindle serial to the letter O’s in case this is the issue?? Thanks for any help!

    • A kfx format directly from a Kindle can’t be decrypted. Go to the website and use the “download & transfer via USB” option. Make sure to choose an E-ink Kindle (not a Fire). Copy and paste the Kindle’s serial number from the website to ensure you get it into DeDRM correctly.

  26. DeDRM 7.2.1, Calibre 5.26, kindle keyboard with extracted serial number.
    Windows 11
    I got the file from my kindle keyboard and after that method didnt work I downloaded it directly from amazon for manual upload.

    “calibre Debug log
    calibre 5.26 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    calibre 5.26 [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: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 2.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 81.28 x 80.68235294117646
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.34] splash screen shown
    [0.34] Initializing db…
    [0.34] db initialized
    [0.34] Constructing main UI…
    [0.78] main UI initialized…
    [0.78] Hiding splash screen
    Starting QuickView
    Failed to check for plugin update: DLL load failed while importing bz2: %1 is not a valid Win32 application.
    DeDRM v7.2.1: Trying to decrypt Ethics Within Engineering An Int-asin_B01MCS8O8U-type_EBOK-v_0.azw3
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Storage number map:
    {(7, 0): [(3, ‘C’)], (7, 1): [(1, ‘D’)], (7, 2): [(2, ‘E’)], (7, 3): [(1, ‘G’)]}
    Storage number for USBSTOR\DISK&VEN_KINDLE&PROD_INTERNAL_STORAGE&REV_0100\B006D0B113060EAX&0: StorageDeviceNumber(type=7, number=3, partition_number=0)
    Drive letters for USBDevice(vendor_id=0x1949 product_id=0x4 bcd=0x100 devid=usb\vid_1949&pid_0004&rev_0100 devinst=4)
    {‘drive_letters’: [‘G’],
    ‘pnp_id_map’: {‘G’: ‘\?\usbstor#disk&ven_kindle&prod_internal_storage&rev_0100#b006d0b113060eax&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}’},
    ‘readonly_drives’: set(),
    ‘sort_map’: {‘G’: (3, 1)}}
    Syncing cover thumbnails to workaround amazon cover bug
    Job: 0 Get device information started
    DeviceJob: 0 Get device information done, calling callback
    DeviceJob: 0 Get device information callback returned
    Job: 1 Set library information started
    DeviceJob: 1 Set library information done, calling callback
    DeviceJob: 1 Set library information callback returned
    Job: 2 Get list of books on device started
    DEBUG: 0.0 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= None
    DEBUG: 0.0 USBMS: dirs are: G:\ documents
    DEBUG: 0.0 USBMS: scan from root False G:\documents
    DEBUG: 0.0 USBMS: count found in cache: 36, count of files in metadata: 36, need_sync: False
    DEBUG: 0.0 USBMS: Finished fetching list of books from device. oncard= None
    DEBUG: 0.0 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= carda
    DEBUG: 0.0 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= cardb
    DeviceJob: 2 Get list of books on device done, calling callback
    DeviceJob: metadata_downloaded: Starting set_books_in_library
    DeviceJob: set_books_in_library: books to process= 36
    DeviceJob: set_books_in_library finished: time= 0.0019953250885009766
    DeviceJob: metadata_downloaded: updating views
    DeviceJob: metadata_downloaded: syncing
    DeviceJob: metadata_downloaded: refreshing ondevice
    DeviceJob: metadata_downloaded: sending metadata_available signal
    DeviceJob: 2 Get list of books on device callback returned
    Job: 0 Get device information finished
    No details available.
    Job: 2 Get list of books on device finished
    No details available.
    Job: 1 Set library information finished
    No details available.
    [13.67] splash screen hidden
    [13.67] Started up in 13.67 seconds with 6 books
    Added Ethics Within Engineering to db in: 2.1
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 18, in
    File “zipimport.py”, line 259, in load_module
    File “C:\Users\Jonat\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 33, in
    File “bypy-importer.py”, line 203, in exec_module
    File “Crypto\Cipher_init_.py”, line 33, in
    File “bypy-importer.py”, line 203, in exec_module
    File “Crypto\Cipher_mode_ccm.py”, line 44, in
    ImportError: DLL load failed while importing strxor: %1 is not a valid Win32 application.

    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
    File “calibre_plugins.dedrm.init”, line 527, in KindleMobiDecrypt
    File “calibre\customize\zipplugin.py”, line 192, in exec_module
    File “calibre_plugins.dedrm.k4mobidedrm”, line 88, in
    File “calibre\customize\zipplugin.py”, line 192, in exec_module
    File “calibre_plugins.dedrm.kfxdedrm”, line 20, in
    File “calibre\customize\zipplugin.py”, line 192, in exec_module
    File “calibre_plugins.dedrm.ion”, line 33, in
    File “bypy-importer.py”, line 203, in exec_module
    File “Crypto\Cipher_init.py”, line 33, in
    File “bypy-importer.py”, line 203, in exec_module
    File “Crypto\Cipher_mode_ccm.py”, line 44, in
    ImportError: DLL load failed while importing strxor: %1 is not a valid Win32 applicationAdded 1 books in 2.4 seconds”

    • With a Kindle Keyboard, you should be able to decrypt either the file directly from the device or the one downloaded from the website for transfer via USB. Be sure you have the Kindle’s serial number entered correctly into DeDRM’s customization.

    • Considering the occurrence of “%1 is not a valid Win32 application”, I would suspect that something in your calibre installation has been corrupted.

  27. Under Eink Kindle Serial Numbers:”Z000Z0Z000000ZZZ” I just replaced all letters with Z and all numbers with 0. I also followed this file:///C:/Users/Jonat/AppData/Roaming/calibre/plugins/DeDRM/help/DeDRM_EInk%20Kindle%20Serial%20Number_Help.htm when looking it up.

    • Easiest way to get the serial number in correctly is to copy and paste it from the website. But I agree with DNSB’s comment that something else must be going on from that log. DeDRM says it’s trying to decrypt your book, but there’s nothing else about it checking keys or looking for them. Then there’s usually a clear indication of success or failure to decrypt before it says the book is added. Can we see a log without your Kindle plugged in?

  28. Hello… Not sure if this is the right place to ask this, but what is the recommended Kindle for Mac version for someone running calibre 5.27 on the latest Mac OS? Thanks!

  29. Hi everyone.. anyone?
    I did post my issue in an earlier post but probably didnt supply enough information for anyone to help so I thought I would post again with the error log to see if anyone can help me. thanks in advance.
    calibre Debug log
    calibre 5.26 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 42, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 42, 0) && KFX metadata reader (from KFX Input) (1, 42, 0) && KFX Input (1, 42, 0)
    calibre 5.26 embedded-python: True is64bit: False
    Windows-10-10.0.19041 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ’10’, ‘10.0.19041’)
    Python 3.8.5
    Windows: (’10’, ‘10.0.19041’, ”, ‘Multiprocessor Free’)
    Interface language: None
    Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 42, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 42, 0) && KFX metadata reader (from KFX Input) (1, 42, 0) && KFX Input (1, 42, 0)
    Turning on automatic hidpi scaling
    devicePixelRatio: 2.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 69.96843615494979 x 69.9795918367347
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.33] splash screen shown
    [0.33] Initializing db…
    [0.34] db initialized
    [0.34] Constructing main UI…
    [0.94] main UI initialized…
    [0.94] Hiding splash screen
    Starting QuickView
    Gather KFX-ZIP (from KFX Input) 1.42.0: Importing H:\documents\Downloads\Items01\Oracle_B07TWXSQRS.kfx
    Gather KFX-ZIP (from KFX Input): Gathered 3 file(s) as C:\Users\marks\AppData\Local\Temp\calibre_fse64l9q\l1hue5b0.kfx-zip
    DeDRM v7.2.1: Trying to decrypt l1hue5b0.kfx-zip
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypting KFX-ZIP ebook: l1hue5b0
    Found 1 keys to try after 0.1 seconds
    Decrypting KFX DRM voucher: voucher
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\marks\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\marks\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\marks\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 83, in decrypt_voucher
    File “C:\Users\marks\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 879, in decryptvoucher
    File “C:\Users\marks\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 758, in pkcs7unpad
    File “C:\Users\marks\AppData\Roaming\calibre\plugins\DeDRM.zip\ion.py”, line 98, in _assert
    Exception: Incorrect padding – Wrong key
    DeDRM v7.2.1: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
    DeDRM v7.2.1: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\marks\AppData\Local
    No K4PC kindle.info/kinf/kinf2011 files have been found.
    DeDRM v7.2.1: 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
    Package KFX (from KFX Input) 1.42.0: Packaging C:\Users\marks\AppData\Local\Temp\calibre_fse64l9q\l1hue5b0.kfx-zip
    Processing container: Oracle_B07TWXSQRS.kfx
    KFX metadata reader (from KFX Input) activated for C:\Users\marks\AppData\Local\Temp\calibre_fse64l9q\hudt794m_add_books\0\Oracle_B07TWXSQRS.kfx-zip
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.init“, line 540, in KindleMobiDecrypt
    File “calibre_plugins.dedrm.k4mobidedrm”, line 238, in GetDecryptedBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 45, in processBook
    File “calibre_plugins.dedrm.kfxdedrm”, line 89, 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 176, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 633, in run
    File “calibre_plugins.dedrm.init“, line 583, in KindleMobiDecrypt
    calibre_plugins.dedrm.DeDRMError: DeDRM v7.2.1: 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 Package KFX (from KFX Input) failed with traceback:
    Traceback (most recent call last):
    File “calibre\customize\ui.py”, line 176, in _run_filetype_plugins
    File “calibre_plugins.kfx_input.package_filetype”, line 21, in run
    File “calibre_plugins.kfx_input.package_filetype”, line 32, in run_kfx
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 84, in convert_to_single_kfx
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 211, in decode_book
    File “calibre_plugins.kfx_input.kfxlib.yj_book”, line 318, in get_container
    calibre_plugins.kfx_input.kfxlib.utilities.KFXDRMError: Book container Oracle_B07TWXSQRS.kfx has DRM and cannot be converted
    [31.98] splash screen hidden
    [31.98] Started up in 31.98 seconds with 417 books
    Storage number map:
    {(7, 0): [(1, ‘F’)],
    (7, 1): [(1, ‘E’)],
    (7, 2): [(1, ‘D’)],
    (7, 3): [(4, ‘G’)],
    (7, 4): [(4, ‘C’)],
    (7, 5): [(1, ‘H’)]}
    Storage number for USBSTOR\DISK&VEN_KINDLE&PROD_INTERNAL_STORAGE&REV_0401\G000T60883960NJ0&0: StorageDeviceNumber(type=7, number=5, partition_number=0)
    Drive letters for USBDevice(vendor_id=0x1949 product_id=0x324 bcd=0x401 devid=usb\vid_1949&pid_0324&rev_0401 devinst=14)
    {‘drive_letters’: [‘H’],
    ‘pnp_id_map’: {‘H’: ‘\\?\usbstor#disk&ven_kindle&prod_internal_storage&rev_0401#g000t60883960nj0&0#{53f56307-b6bf-11d0-94f2-00a0c91efb8b}’},
    ‘readonly_drives’: set(),
    ‘sort_map’: {‘H’: (5, 1)}}
    Syncing cover thumbnails to workaround amazon cover bug
    Job: 0 Get device information started
    DeviceJob: 0 Get device information done, calling callback
    DeviceJob: 0 Get device information callback returned
    Job: 1 Set library information started
    DeviceJob: 1 Set library information done, calling callback
    DeviceJob: 1 Set library information callback returned
    Job: 2 Get list of books on device started
    DEBUG: 0.0 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= None
    DEBUG: 0.0 USBMS: dirs are: H:\ documents
    DEBUG: 0.0 USBMS: scan from root False H:\documents
    DEBUG: 0.1 USBMS: count found in cache: 24, count of files in metadata: 24, need_sync: False
    DEBUG: 0.1 USBMS: Finished fetching list of books from device. oncard= None
    DEBUG: 0.1 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= carda
    DEBUG: 0.1 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= cardb
    DeviceJob: 2 Get list of books on device done, calling callback
    DeviceJob: metadata_downloaded: Starting set_books_in_library
    DeviceJob: set_books_in_library: books to process= 24
    DeviceJob: set_books_in_library finished: time= 0.005004405975341797
    DeviceJob: metadata_downloaded: updating views
    DeviceJob: metadata_downloaded: syncing
    DeviceJob: metadata_downloaded: refreshing ondevice
    DeviceJob: metadata_downloaded: sending metadata_available signal
    DeviceJob: 2 Get list of books on device callback returned
    Job: 0 Get device information finished
    No details available.
    Job: 2 Get list of books on device finished
    No details available.
    Job: 1 Set library information finished
    No details available.
    stdout+stderr from file dialog helper: [b”, b”]
    piped data from file dialog helper: [b’\x80Qpv\x8e\x1b\xdb\xa7\x80″\x07\xf6\x8cP\xc0\x19\x88\xfed\xbe\xfb@\x12\xb5\x15B\x8c5p\xc7\xefI’, b’H:\documents\Downloads\Items01\Oracle_B07TWXSQRS.kfx’]
    Added Oracle to db in: 0.3
    Added 1 books in 0.7 seconds

  30. I have Calibre 5.3 for Linux and have installed the latest plugin. This is the log when I try to import a book not already in Calibre:
    calibre Debug log
    calibre 5.3 embedded-python: True is64bit: True
    Linux-5.4.0-86-generic-x86_64-with-glibc2.2.5 Linux (’64bit’, ‘ELF’)
    (‘Linux’, ‘5.4.0-86-generic’, ‘#97-Ubuntu SMP Fri Sep 17 19:19:40 UTC 2021′)
    Python 3.8.5
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    calibre 5.3 embedded-python: True is64bit: True
    Linux-5.4.0-86-generic-x86_64-with-glibc2.2.5 Linux (’64bit’, ‘ELF’)
    (‘Linux’, ‘5.4.0-86-generic’, ‘#97-Ubuntu SMP Fri Sep 17 19:19:40 UTC 2021’)
    Python 3.8.5
    Interface language: None
    Successfully initialized third party plugins: DeDRM (7, 2, 1)
    Turning on automatic hidpi scaling
    devicePixelRatio: 1.0
    logicalDpi: 96.0 x 96.0
    physicalDpi: 100.86162790697674 x 101.07357512953367
    Using calibre Qt style: True
    [0.00] Starting up…
    [0.00] Showing splash screen…
    [0.07] splash screen shown
    [0.07] Initializing db…
    [0.08] db initialized
    [0.08] Constructing main UI…
    Looking for desktop notifier support from: org.freedesktop.Notifications
    org.freedesktop.Notifications found in 0.0 seconds
    [0.78] main UI initialized…
    [0.78] Hiding splash screen
    Starting QuickView
    DeDRM v7.2.1: Trying to decrypt B07Q26B7GJ_EBOK.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    Using Library AlfCrypto DLL/DYLIB/SO
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.kfxdedrm”, line 18, in
    from ion import DrmIon, DrmIonVoucher
    File “/tmp/calibre_5.3.0_tmp_yj9wy68_/u4lg1_vsplugin_unzip/ion.py”, line 33, in
    from Crypto.Cipher import AES
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “bypy-importer.py”, line 154, in exec_module
    File “Crypto/Cipher/init.py”, line 27, in
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “bypy-importer.py”, line 154, in exec_module
    File “Crypto/Cipher/_mode_ecb.py”, line 35, in
    File “Crypto/Util/_raw_api.py”, line 308, in load_pycryptodome_raw_lib
    OSError: Cannot load native module ‘Crypto.Cipher._raw_ecb’: Trying ‘_raw_ecb.cpython-38-x86_64-linux-gnu.so’: /opt/calibre/lib/calibre-extensions/python-lib.bypy.frozen/Crypto/Util/../Cipher/_raw_ecb.cpython-38-x86_64-linux-gnu.so: cannot open shared object file: Not a directory, Trying ‘_raw_ecb.abi3.so’: /opt/calibre/lib/calibre-extensions/python-lib.bypy.frozen/Crypto/Util/../Cipher/_raw_ecb.abi3.so: cannot open shared object file: Not a directory, Trying ‘_raw_ecb.so’: /opt/calibre/lib/calibre-extensions/python-lib.bypy.frozen/Crypto/Util/../Cipher/_raw_ecb.so: cannot open shared object file: Not a directory

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “calibre/customize/ui.py”, line 172, 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 527, in KindleMobiDecrypt
    import calibre_plugins.dedrm.k4mobidedrm
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “calibre/customize/zipplugin.py”, line 184, in exec_module
    File “calibre_plugins.dedrm.k4mobidedrm”, line 88, in
    from calibre_plugins.dedrm import kfxdedrm
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “calibre/customize/zipplugin.py”, line 184, in exec_module
    File “calibre_plugins.dedrm.kfxdedrm”, line 20, in
    from calibre_plugins.dedrm.ion import DrmIon, DrmIonVoucher
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “calibre/customize/zipplugin.py”, line 184, in exec_module
    File “calibre_plugins.dedrm.ion”, line 33, in
    from Crypto.Cipher import AES
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “bypy-importer.py”, line 154, in exec_module
    File “Crypto/Cipher/init.py”, line 27, in
    File “”, line 991, in _find_and_load
    File “”, line 975, in _find_and_load_unlocked
    File “”, line 671, in _load_unlocked
    File “bypy-importer.py”, line 154, in exec_module
    File “Crypto/Cipher/_mode_ecb.py”, line 35, in
    File “Crypto/Util/_raw_api.py”, line 308, in load_pycryptodome_raw_lib
    OSError: Cannot load native module ‘Crypto.Cipher._raw_ecb’: Trying ‘_raw_ecb.cpython-38-x86_64-linux-gnu.so’: /opt/calibre/lib/calibre-extensions/python-lib.bypy.frozen/Crypto/Util/../Cipher/_raw_ecb.cpython-38-x86_64-linux-gnu.so: cannot open shared object file: Not a directory, Trying ‘_raw_ecb.abi3.so’: /opt/calibre/lib/calibre-extensions/python-lib.bypy.frozen/Crypto/Util/../Cipher/_raw_ecb.abi3.so: cannot open shared object file: Not a directory, Trying ‘_raw_ecb.so’: /opt/calibre/lib/calibre-extensions/python-lib.bypy.frozen/Crypto/Util/../Cipher/_raw_ecb.so: cannot open shared object file: Not a directory
    [7.70] splash screen hidden
    [7.70] Started up in 7.70 seconds with 2 books
    [‘zenity’, ‘–modal’, ‘–file-selection’, ‘–title=Select books’, ‘–separator=\n’, ‘–attach=102760471’, ‘–filename=/home/dennis/Documents/My Kindle Content/.fgdfg.gdfhjdhf*&^839’, ‘–file-filter=Books | *.lrf *.rar *.zip *.rtf *.lit *.txt *.txtz *.text *.htm *.xhtm *.html *.htmlz *.xhtml *.pdf *.pdb *.updb *.pdr *.prc *.mobi *.azw *.doc *.epub *.fb2 *.fbz *.djv *.djvu *.lrx *.cbr *.cbz *.cbc *.oebzip *.rb *.imp *.odt *.chm *.tpz *.azw1 *.pml *.pmlz *.mbp *.tan *.snb *.xps *.oxps *.azw4 *.book *.zbf *.pobi *.docx *.docm *.md *.textile *.markdown *.ibook *.ibooks *.iba *.azw3 *.ps *.kepub *.kfx *.kpf’, ‘–file-filter=EPUB books | *.epub *.kepub’, ‘–file-filter=Kindle books | *.mobi *.prc *.azw *.azw3 *.kfx *.tpz *.azw1 *.azw4’, ‘–file-filter=PDF books | *.pdf *.azw4’, ‘–file-filter=HTML books | *.htm *.html *.xhtm *.xhtml’, ‘–file-filter=LIT books | *.lit’, ‘–file-filter=Text books | *.txt *.text *.rtf *.md *.markdown *.textile *.txtz’, ‘–file-filter=Comics | *.cbz *.cbr *.cbc’, ‘–file-filter=Archives | *.zip *.rar’, ‘–file-filter=Wordprocessor files | *.odt *.doc *.docx’, ‘–file-filter=All files | *’, ‘–multiple’]
    Added Unfreedom of the Press to db in: 2.1
    Added 1 books in 2.7 seconds
    Worker Launch took: 0.06968903541564941

Comments are closed.