DRM Removal Tools for eBooks

Version 6.5.3 released on 12 January, 2017

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 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.

2,934 thoughts on “DRM Removal Tools for eBooks

  1. Thank you so much for these tutorials. I need to make ebooks accessible for text-to-speech readers, and most e-readers’ TTS is woefully inadequate for the average disabled person’s needs. The simplest way is to convert to plain text and use my favorite TTS, but of course the DRM won’t let you do that. You’re a lifesaver! These people need to either stop using DRM or make their TTS usable; until then, TTS users will be happily removing that DRM at every opportunity. Disabled bookworms unite!

  2. Help – when i try and install the plugin on calibre it says “Invalid Plugin”

    Here is the information it has provided

    “calibre, version 2.76.0
    ERROR: Unhandled exception: InvalidPlugin:The plugin in u’D:\Downloads\DeDRM_tools_6.5.2 (1).zip’ is invalid. It does not contain a top-level init.py file

    calibre 2.76 embedded-python: True is64bit: False
    Windows-8-6.2.9200 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ‘8’, ‘6.2.9200’)
    Python 2.7.9
    Windows: (‘8’, ‘6.2.9200’, ”, ‘Multiprocessor Free’)
    Traceback (most recent call last):
    File “site-packages\calibre\gui2\preferences\plugins.py”, line 317, in add_plugin
    File “site-packages\calibre\customize\ui.py”, line 463, in add_plugin
    File “site-packages\calibre\customize\ui.py”, line 58, in load_plugin
    File “site-packages\calibre\customize\zipplugin.py”, line 192, in load
    File “site-packages\calibre\customize\zipplugin.py”, line 290, in _locate_code
    InvalidPlugin: The plugin in u’D:\Downloads\DeDRM_tools_6.5.2 (1).zip’ is invalid. It does not contain a top-level init.py file”

    Am i doing something very daft??

    Thanks

    • You’re trying to install the entire tools archive, instead of just the calibre plug-in. Unzip that file and look in the DeDRM calibre plugin folder to find the zip file that should be loaded into calibre.

    • Hey Fran. I had the same error and figured it out. I was thinking too far ahead and instead of just extracting DeDRM_calibre_plugin from DeDRM_tools_6.5.2.zip I was taking it another step and extracting all files from DeDRM_calibre_pluging.zip as well. I re-read the instructions and just pointed the Calibre plugin installer to DeDRM_calibre_pluging.zip in its zipped state. It worked as stated.

  3. Before posting my log dated yesterday @ 7:58 PM, I should have ensured that I understood the extraction instructions for DeDRM_tools_6.5.2.zip. Having attempted to follow the instructions to the letter, I find that some of them do not exactly fit what I see on my monitor.

    The instructions in the FAQs say, “You should select the zip file that is in the “DeDRM_calibre_plugin” folder, not any files inside the plugin’s zip archive. Make sure you are selecting from the tools folder that you created when you right clicked and selected “Extract All…” on the tools zip archive and not selecting a file inside the still-zipped tools archive.”

    I wish I could include screen grab JPEGs in this message, but I don’t see how to do it, so I’ll try to describe the WinZip screens.

    The first screen left side bar displays the folder [DeDRM_tools_6.5.2.zip], with sub-folders DeDRM_calibre_plugin, DeDRM_Macintosh_Application, DeDRM_Windows_Application, Obok_calible_plugin, Other_Tools, and the file ReadMe_First.txt. I read the ReadMe file without gaining any illumination.

    Extracting [DeDRM_tools_6.5.2.zip] results in separating the folders, but not in any actual extraction.

    I assume that I want the DeDRM_calibre folder. When I open it I see DeDRM_plugin.zip and another ReadMe file, which I have read to no avail.

    Extracting the DeDRMplugin.zip results in a list of 56 files, including yet another zipped file, alfcrypto.src.zip, and two applications, alfcrypto.dll and alfcrypto64.dll. Do I need to extract the alfcrypto.src.zip file? I extracted it and found that it doesn’t contain anything that I understand.

    Having extracted everything in sight, I removed first my Barnes & Noble key, then the plugin from Calibre, closed Calibre and restarted it, navigated to user-installed plugins, then to load plugin from file. That recognizes only files with .zip extensions. Is this correct?

    I am running Calbre 2.76 [64 bit] on a Windows 10 PC with the same result as described in my first post.

    • Unzip ONLY the DeDRM_tools_6.5.2.zip. Then when you go to load the plugin into calibre, navigate to the DeDRM_calibre_plugin folder and select the DeDRM_plugin.zip. Then close and restart calibre.

      I can see from the log you posted yesterday that you had the plugin installed correctly then. We just need to get the right B&N key in there.

      • Thank you for the very clear instructions. I deleted the (it turns out) copy of the key that I had stored in a document for safe-keeping, as I have no idea where the Caliber plug-in stores it. After following your instructions, I added a book to Calibre and attempted to open it. The system returned the message “This book is locked by DRM.”

        I have never had more than one Barnes & Noble account, so the plug-in must be retrieving the correct key. I wonder if B & N has done something sneaky since the plug-in was last updated.

        This is quite disappointing, as the plug-in processed my 36 Kindle books and my 12 ADE books perfectly, but so far I cannot rescue my 362 Barnes & Noble ones. All except a couple of the B&N library are books that I use for reference or novels that I reread periodically and that are not available at the public library or via interlibrary loan in any format. Replacing them with Kindle books will be a financial burden.

        • How old are your book downloads? The plugin will retrieve the current key. If your books were downloaded before the switch from credit card based keys, they won’t unlock with the current key. Try downloading a fresh copy of a book and importing that.

          • A few of the downloads probably go back to June of 2011 when I bought my first NOOK device, or when the book became available in electronic format, if later than that date. Most of the collection was downloaded/unarchived only a few days ago, though. Just now I archived one of my books, downloaded it, and added it to Calibre. When I tried to open it the system still displayed the locked message.

            • I’m mystified. If you have Nook for PC installed and registered, the tools should be retrieving the same key that Nook for PC is using for decryption. I suggest deleting any stored B&N keys, and getting the key once more. (So that there’s only one B&N key in the preferences,)

              And then post an import log for the newly downloaded book.

              • Do you mean to manually find and delete the stored keys, or to delete them through the Calibre plugin? If the former, where does the DeDRM tool store the key? Searching my entire hard drive has found only the file that I saved using the “Save highlighted key to a .b64 file” icon. Apparently I don’t even know what search term to use in searching my hard drive.

                • SOLVED!, possibly completely. And my apologies for being dense and causing others to spend time on my questions.

                  I have just discovered that there are a couple of different folders on my hard drive containing NOOK books. The first one, My Barnes & Noble eBooks, contains epub files dated from 6/19/2011 through August 2, 2016. The other is C:\Users\Marianna Stewart\AppData\Local\Packages\BarnesNoble.Nook_ahnzqzva31enc\LocalState, with the oldest file dated 7/7/2016. They account for 361 of my 362 titles and some are duplicates of the ones in the My Barnes & Noble eBooks file. Most of them are dated from December 30th or later, so I assume that they are the ones I downloaded for DeDRM processing.

                  I loaded one of them into Calible and it DeDRMed exactly as one would hope. Now I’ve set Calibre to work loading the remaining 360 books. I expect it will finish around bedtime. If you don’t hear from me again, you’ll know that they all are DeDRMed and ready to convert to the correct format for my next ereader, whatever brand it turns out to be.

                  Thanks for all your efforts.

  4. I’m back!

    19 of the 361 books from the C:\Users\Marianna Stewart\AppData\Local\Packages\BarnesNoble.Nook_ahnzqzva31enc\LocalState folder DeDRMed as expected. I just archived one of the ones that didn’t DeDRM, then checked that folder and found that it had vanished. Unexpectedly, when I downloaded the book, it did not reappear either there or in the My Barnes & Noble eBooks folder.

    Are there additional folders where B&N stores books that are active in NOOK for PC? My File Explorer options are set to show hidden files, folders and drives, and the search options are set to include compressed files and to search file names and contents, but when I search on the ebook or the hardcopy ISBN, taken from inside the book, or various author or title key words for the book on which I’m experimenting, the search retrieves nothing.

    Doesn’t the book have to be there somewhere for NOOK for PC to open it?

    • The books for Nook for PC are in this folder:
      C:\Users\%username%\Documents\My Barnes & Noble eBooks(your email address)

      That other folder is the Windows Store Nook app. Those books will be hit or miss with the tools because they might have a crucial piece of their DRM stored in a database separately from the book. In other words, stick with the books from Nook for PC.

      Anything older than about 2 years ago won’t unlock with the current key.

        • Success at last, this time for real.

          My apologies again. I hadn’t realized that there was a substantive difference between NOOK for PC and the Windows NOOK application, aside from the app always displaying each book’s correct author.

          Several months ago, I removed NOOK for PC from my desktop computer after upgrading to Windows 10 and replaced it with the Windows NOOK application. Access to my library via the Windows app was difficult, and B&N no longer distributed NOOK for PC, so I found it from another source (don’t remember the name, though), and installed it, but removed it because it was asking for my credit card number every time I clicked on book, so I suspected a phishing scam. After removing it, I reinstalled the Windows app.

          I just found NOOK for PC at yet another source, EPubSoft, and installed it. It asks for my credit card number only if I happen to click on a space between the options. After installation, it showed 169 books in the active library, the number in the My Barnes and Noble folder. After taking at least five minutes from the time I entered my B&N user ID and password to connect with the server, it opened and I removed all local copies, downloading fresh copies of my entire library, apparently with current keys.

          After that the DeDRM Calibre plugin stripped the DRM as expected, and conversion is now working perfectly. The next challenge will be to get my computer to recognize my new Kindle Paperwhite when it’s delivered next week, so that I can read my freshly converted books on it. The Calibre help site makes that sound very straightforward.

          I hope that reading about my saga will steer the next person with problems directly to the correct procedure, without any of my detours.

          • There’s a link to download Nook for PC here on the blog over on the FAQs page. It’s actually directly from B&N. They don’t provide a link on their site anymore, but it’s still hiding there on their server if you know where to look. There’s probably no issue with the version you have, but here it is if you want it: http://images.barnesandnoble.com/PResources/download/eReader2/bndr2_setup_latest.exe

            I imagine Nook for PC was asking for a credit card because you had old books in there that were encrypted with credit card based keys from when you originally downloaded them. Because you had uninstalled Nook for PC it didn’t have those old keys saved, and it could only retrieve the current key from your login. Back in the days of credit card based keys, you could open a nookbook from any account if you knew the right cc#.

  5. Hello,

    I’m trying to remove the DRM from a few comic digests that I purchased on Amazon using your DeDRM Windows Application utility. While most of the books were processed successfully, a few having file size around 400MB show a failure message. The books were all purchased using the same Amazon account and can be read successfully on my PC using the Kindle for PC app.

    An alternate utility, ePUBee DRM Removal shows a “file size too large” error for such books.

    Attaching 2 log files for your analysis:

    1) This is from a successfully processed 307MB file:

    DeDRM v6.5.2: Processing: B00YUY9J5Y_EBOK.azw…
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 8, header length 264
    Extra Data Flags: 3
    Decrypting Kindle Format 8 ebook: Archie Giant Comics Collection (Archie Giant Comics Digests)
    Found 4 keys to try after 5.5 seconds
    Crypto Type is: 2
    File is encoded with PID aP6SmmNC3A.
    Decrypting. Please wait . . . . done
    Decryption succeeded after 7.8 seconds
    Saved decrypted book B00YUY9J5Y_EBOK_nodrm after 18.7 seconds
    DeDRM v6.5.2: Success

    DeDRM v6.5.2: Complete: Successes: 1, Failures: 0

    2) This is from the failed 400MB file:

    DeDRM v6.5.2: Processing: B00QDYYKBM_EBOK.azw…
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 8, header length 264
    Extra Data Flags: 3
    Decrypting Kindle Format 8 ebook: Archie 1000 Page Comics Jam (Archie 1000 Page Digests)
    Found 4 keys to try after 10.2 seconds
    Crypto Type is: 2
    Error decrypting book after 10.2 seconds: No key found in 4 keys tried.
    Traceback (most recent call last):
    File “C:\Users\Audible\Downloads\DeDRM_tools_6.5.2\DeDRM_Windows_Application\DeDRM_App\DeDRM_lib\lib\k4mobidedrm.py”, line 248, in decryptBook
    book = GetDecryptedBook(infile, kDatabases, androidFiles, serials, pids, starttime)
    File “C:\Users\Audible\Downloads\DeDRM_tools_6.5.2\DeDRM_Windows_Application\DeDRM_App\DeDRM_lib\lib\k4mobidedrm.py”, line 222, in GetDecryptedBook
    mb.processBook(totalpids)
    File “C:\Users\Audible\Downloads\DeDRM_tools_6.5.2\DeDRM_Windows_Application\DeDRM_App\DeDRM_lib\lib\mobidedrm.py”, line 471, in processBook
    raise DrmException(u”No key found in {0:d} keys tried.”.format(len(goodpids)))
    DrmException: No key found in 4 keys tried.
    DeDRM v6.5.2: Failed

    DeDRM v6.5.2: Complete: Successes: 0, Failures: 1

    Thanks!

    • If they were both downloaded with the same installation of Kindle for PC, then it sounds like it probably timed out due to the large file size. I’ve seen people get larger files decrypted by using the plugin with 64-bit calibre.

  6. Looks like amazon updated their drm, when I want to add the books from the kindle folder, I get all the new books in folders, that has a vaucher file, md file, the book and a folder called tmp that has nothing inside. I tried to add just the book but doesn’t work; the entire folder as it would be a book and again, nothing.
    I tried from my kindle paperback to add the books, but most of them are the same and there is a book that calibre can’t strip it of drm; I get this error:

    Found KF8 MOBI of type ‘standalone’
    Python function terminated unexpectedly
    Ria’s Visions (Hearts of ICARUS Book 6) (Error Code: 1)
    Traceback (most recent call last):
    File “site.py”, line 132, in main
    File “site.py”, line 109, in run_entry_point
    File “site-packages\calibre\utils\ipc\worker.py”, line 195, in main
    File “site-packages\calibre\gui2\convert\gui_conversion.py”, line 33, in gui_convert_override
    File “site-packages\calibre\gui2\convert\gui_conversion.py”, line 26, in gui_convert
    File “site-packages\calibre\ebooks\conversion\plumber.py”, line 1064, in run
    File “site-packages\calibre\customize\conversion.py”, line 245, in __call__
    File “site-packages\calibre\ebooks\conversion\plugins\mobi_input.py”, line 44, in convert
    File “site-packages\calibre\ebooks\mobi\reader\mobi8.py”, line 86, in __call__
    File “site-packages\calibre\ebooks\mobi\reader\mobi6.py”, line 146, in check_for_drm
    calibre.ebooks.DRMError: Ria’s Visions (Hearts of ICARUS Book 6)
    
    I have both calibre and dedrm tools updated.
    
    • I found the previous version, kindle for pc was updated yesterday, and I installed it. Now I have no trouble in adding the books from kindle to my calibre.

        • I have Kindle for PC version 1.16.0, set to automatically install updates whenever they are available, and I really hope the automatic updates actually happen.

        • Just an FYI to say I turned off Auto Updates sometime ago and has been only using Kindle for PC/Mac 1.15. Have rejected every update since then and knock wood have had no issues transferring and converting in any version of Calibre.

  7. Just installed and used your plugin for calibre with a Kindle DRM protected book. Works like a spell. Amazon should be grateful, for now I even might consider buying more books from them.

  8. Hey all.

    Have Calibre 2.76 64 bit. Amazon kindle for PC 2 1.17.1 (44183) downloaded book from Amazon .az3 file ( a sign language book that I want to print some of the signs for adults with learning disabilities and make specific communication books for them. Wanted to convert .azw3 – .pdf). Followed unzip instructions, successfully installed plugin for Calibre. Restarted Calibre. Added book and wanted to convert to another file for storage. Calibre comes up with the following: ‘This book is DRMed, cannot convert, etc…

    Have uninstalled, and re-installed apps, same issues.

    Any help please?

    Thanks in advance.

    • Hello

      It is strange, have Calibre 2.76 64 bit. Amazon kindle for PC Version 1.19.1 (46067) and everything works very well.
      Perhaps you should look if the plugins is installed well.

      • Hi Belgian. Thanks for the reply. Same info.

        [screenshot removed]

        I’m slightly baffled…unless there is something blatantly obvious??

      • FYI, using version 1.19 of Kindle for PC could cause issues. That version is capable of downloading a new Kindle format which neither calibre or the DeDRM plugin can handle. Strongly suggest you download 1.17 from Amazon while you still can. Then be sure to uncheck automatic updates under the Tools > Options menu.

    • AZW3? Sounds like you didn’t actually download it with Kindle for PC. If that’s from or for an E-ink Kindle, enter the serial number into the plugin customization. Otherwise, download it with the Kindle for PC on the same machine as calibre.

      • I was working with 6.5.2 but the customisation dialog in Calibre throws an error and does not allow you to enter the Kindle serial number. Do you know if this has been fixed with 6.5.3?

        Importing from the latest version of K4PC seems to be working (DRM removed) but the same books in e-ink direct from the device say they are the new KFK format and to download the AZW3. If you do that, DRM cannot be removed as the serial number link cannot be added in the configurator.

        Would like to get this to work so as not to have to go through K4PC every time, before KFK it was fine to import from device to Calibre Library.

        • I just checked, and I was able to add a serial number with 6.5.2. If you’re copy/pasting from Amazon, be sure to remove spaces. Also, this is only for E-ink Kindles, not Fires.

  9. I just downloaded the newest Calibre (2.76) on my Windows 10 machine today. I followed the directions (though the tools file did not download as a zip file for me in the first place, so there was nothing to extract, as far as I can tell), and I received this error message:

    calibre, version 2.76.0
    ERROR: Unhandled exception: InvalidPlugin:Initialization of plugin Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 650, in initialize_plugin
    File “calibre_plugins.dedrm.init“, line 86, in initialize
    File “site-packages\calibre\customize\zipplugin.py”, line 183, in load_module
    File “calibre_plugins.dedrm.config”, line 12, in
    ImportError: No module named PyQt4.Qt
    failed with traceback:
    Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 650, in initialize_plugin
    File “calibre_plugins.dedrm.init“, line 86, in initialize
    File “site-packages\calibre\customize\zipplugin.py”, line 183, in load_module
    File “calibre_plugins.dedrm.config”, line 12, in
    ImportError: No module named PyQt4.Qt

    calibre 2.76 embedded-python: True is64bit: False
    Windows-8-6.2.9200 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ‘8’, ‘6.2.9200’)
    Python 2.7.9
    Windows: (‘8’, ‘6.2.9200’, ”, ‘Multiprocessor Free’)
    Traceback (most recent call last):
    File “site-packages\calibre\gui2\preferences\plugins.py”, line 317, in add_plugin
    File “site-packages\calibre\customize\ui.py”, line 467, in add_plugin
    File “site-packages\calibre\customize\ui.py”, line 656, in initialize_plugin
    InvalidPlugin: Initialization of plugin Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 650, in initialize_plugin
    File “calibre_plugins.dedrm.init“, line 86, in initialize
    File “site-packages\calibre\customize\zipplugin.py”, line 183, in load_module
    File “calibre_plugins.dedrm.config”, line 12, in
    ImportError: No module named PyQt4.Qt
    failed with traceback:
    Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 650, in initialize_plugin
    File “calibre_plugins.dedrm.init“, line 86, in initialize
    File “site-packages\calibre\customize\zipplugin.py”, line 183, in load_module
    File “calibre_plugins.dedrm.config”, line 12, in
    ImportError: No module named PyQt4.Qt

    I’ve been using DeDRM for years now (thank you!) but this new Windows 10 machine is of course requiring me to reinstall all my favorite programs, and I’m not sure what I’ve done here to make the plugin fail to install.

    Thanks!
    -Alana

  10. I just downloaded the newest Calibre 2.76 yesterday and the DeDRM_tools_6.5.2.zip from apprenticeharper. It was my first DeDRM tool.
    My proble is, that I don’t understand, which folder I should unzip? The whole DeDRM_tools_6.5.2.zip folder or just the folder in it: DeDRM_calibre_plugin? My problem is, that I can’t unzip ONLY the DeDRM_plugin.zip, it’s just possible to open, copy or delete it.
    When I unzip the hole DeDRM_tools_6.5.2.zip folder, I can unzip the DeDRM_plugin.zip folder in the next step. When I try to install this unzipped folder in Calibre (like it is described at the website), Calibre opens the unzipped DeDRM_plugin and I just can choose another zipped folder: alfcrypto_src.zip
    Then I get this message:

    calibre 2.76 [64bit] embedded-python: True is64bit: True
    Windows-8-6.2.9200 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ‘8’, ‘6.2.9200’)
    Python 2.7.9
    Windows: (‘8’, ‘6.2.9200’, ”, ‘Multiprocessor Free’)
    Traceback (most recent call last):
    File “site-packages\calibre\gui2\preferences\plugins.py”, line 317, in add_plugin
    File “site-packages\calibre\customize\ui.py”, line 463, in add_plugin
    File “site-packages\calibre\customize\ui.py”, line 58, in load_plugin
    File “site-packages\calibre\customize\zipplugin.py”, line 192, in load
    File “site-packages\calibre\customize\zipplugin.py”, line 290, in _locate_code
    InvalidPlugin: The plugin in u’C:\Users\Maxin\Downloads\DeDRM_tools_6.5.2\DeDRM_calibre_plugin\DeDRM_plugin\alfcrypto_src.zip’ is invalid. It does not contain a top-level init.py file

    When I just unzip the whole folder, without the DeDRM_plugin.zip folder, I can install the plugin in Calibre without problems. But when I try to add a book with DRM (after the restart) I can’t open the book – so the plugin doesn’t work.

    I’m sorry for my bad english, however I hope, one of you understands my problem and help me…

    best regards

    • Sounds like you had it right the second time. You unzip DeDRM_tools_6.5.2.zip. Then load the zip file inside the DeDRM_calibre_plugin folder.

      To figure out why it didn’t work, we’ll need to see a log of importing the book.

      From the FAQs:
      “Remove the DRMed book from calibre. Click the Preferences drop-down menu and choose ‘Restart in debug mode’. Once calibre has re-started, import the problem ebook. Now close calibre. A log will appear that you can copy and paste into a comment at Apprentice Alf’s blog.”

      • Hey Laura,
        and thank you for your quick answer!

        At the moment I install Python and PyCrypto, because I think, I need them too, right?

      • calibre Fehlerdiagnoseprotokoll
        calibre 2.76 [64bit] embedded-python: True is64bit: True
        Windows-8-6.2.9200 Windows (’64bit’, ‘WindowsPE’)
        (‘Windows’, ‘8’, ‘6.2.9200’)
        Python 2.7.9
        Windows: (‘8’, ‘6.2.9200’, ”, ‘Multiprocessor Free’)
        Successfully initialized third party plugins: DeDRM (6, 5, 2)
        devicePixelRatio: 1.0
        logicalDpi: 96.0 x 96.0
        physicalDpi: 96.618127786 x 96.5915492958
        Starting up…
        Started up in 14.16 seconds with 8 books
        stdout+stderr from file dialog helper: [”, ”]
        piped data from file dialog helper: [“U9P\xfd\x0b\xbf\xb1\xe4\xa8\xe4\r\xba\xa3\xe3\x97\xa1\xcf\x1fV\x12\xb0er\xa6@\x15B\x19n’zT”, ‘C:\Users\Maxin\Downloads\Der zehnte Heilige- Thriller (Sarah Weston Abenteuer 1) (German Edition).azw3’]
        DeDRM v6.5.2: Trying to decrypt Der zehnte Heilige- Thriller (Sarah Weston Abenteuer 1) (German Edition).azw3
        Using Library AlfCrypto DLL/DYLIB/SO
        MobiDeDrm v0.41.
        Copyright © 2008-2012 The Dark Reverser et al.
        MOBI header version 8, header length 264
        Extra Data Flags: 3
        Decrypting Kindle Format 8 ebook: Der zehnte Heilige: Thriller (Sarah Weston Abenteuer 1) (German Edition)
        Found 0 keys to try after 1.7 seconds
        Crypto Type is: 2
        DeDRM v6.5.2: Failed to decrypt with error: No key found in 0 keys tried.
        DeDRM v6.5.2: Looking for new default Kindle Key after 1.7 seconds
        searching for kinfoFiles in C:\Users\Maxin\AppData\Local
        No K4PC kindle.info/kinf/kinf2011 files have been found.
        DeDRM v6.5.2: Ultimately failed to decrypt after 1.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 “site-packages\calibre\customize\ui.py”, line 168, in _run_filetype_plugins
        File “calibre_plugins.dedrm.init“, line 609, in run
        File “calibre_plugins.dedrm.init“, line 559, in KindleMobiDecrypt
        DeDRMError: DeDRM v6.5.2: Ultimately failed to decrypt after 1.8 seconds
        C:\Program Files\Calibre2\pylib.zip\dateutil\parser.py:339: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode – interpreting them as being unequal
        Added Der zehnte Heilige: Thriller (Sarah Weston Abenteuer 1) (German Edition) to db in: 4.1
        Added 1 books in 9.0 seconds
        Worker Launch took: 1.22099995613

        And here I have the log for you from importing the book to calibre after installing the plugin

  11. Version 6.53 of the tool is out -a very big thank you to the devs for their hard work. A big thank you too to Paul and Laura for their time on this board.

    However, in the release notes Apprentice Alf wrote:

    –For the Kobo tools, incorrect linux support has been removed, and the decryption of ePubs with unusual file encodings has been improved.–

    Does this means the plugin can now be used directly with Calibre on Linux without one having to install Wine? I do not have Wine installed so all the apps I use are Linux natives.

      • You’re right Laura. I’d need Wine for any of the reader dtop apps including ADE. I was thinking of using the tool without them -but thinking about it more sensibly, that wouldn’t be possible I guess.

        • It’s possible to transfer keys. But if you’re downloading the books with a desktop program on another machine anyway, you might as well use the tools there. Clean ’em where you catch ’em. 🙂

    • Yes, as long as it’s not rented. If not and you can’t open them, post an import log. Once it’s drm-free, try Kindle Unpack to extract the pdf.

  12. Hi, I`ve been using your plugins for calibre ( and Kindle ) for a while now and it always works.. just now from the new books I can´t get the DRM off… everything updated, fresh download on the kindle application… but nothing. anyone could tell me how to fix this? Thanks in advance !

    calibre, version 2.77.0
    ERROR: Failed to generate preview: Failed to generate markup for testing. Click “Show Details” to learn more.

    Traceback (most recent call last):
    File “site-packages\calibre\utils\ipc\simple_worker.py”, line 286, in main
    File “site-packages\calibre\ebooks\oeb\iterator__init__.py”, line 41, in get_preprocess_html
    File “site-packages\calibre\ebooks\conversion\plumber.py”, line 1064, in run
    File “site-packages\calibre\customize\conversion.py”, line 245, in call
    File “site-packages\calibre\ebooks\conversion\plugins\mobi_input.py”, line 36, in convert
    File “site-packages\calibre\ebooks\mobi\reader\mobi6.py”, line 150, in extract_content
    File “site-packages\calibre\ebooks\mobi\reader\mobi6.py”, line 146, in check_for_drm
    DRMError: The Skull Mantra

  13. I just wanted to say thank you for the update, which works perfectly. I need it for TTS, which is often disabled on new e-books. It’s a sign of the times that one must employ a workaround like this in order to use a built-in feature on a Kindle, for a book bought FROM Amazon. In any case, I’m just glad there are programmers out there fighting the good fight.
    Also, I know it’s been mentioned once already, but Kindle for PC files are in the documents folder. I missed the post above and it took me a while to figure this out.

  14. DRM could not be removed. I got books from a friend. Here is the report:
    calibre Debug log
    calibre 2.77 embedded-python: True is64bit: True
    Darwin-16.3.0-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘16.3.0’, ‘Darwin Kernel Version 16.3.0: Thu Nov 17 20:23:58 PST 2016; root:xnu-3789.31.2~1/RELEASE_X86_64’)
    Python 2.7.11
    OSX: (‘10.12.2’, (”, ”, ”), ‘x86_64’)
    Successfully initialized third party plugins: DeDRM (6, 5, 3)
    devicePixelRatio: 1.0
    logicalDpi: 72.0 x 72.0
    physicalDpi: 109.000001637 x 109.000001637
    Starting up…
    Started up in 1.42 seconds with 0 books
    DeDRM v6.5.3: Trying to decrypt Hostage.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 6, header length 232
    Extra Data Flags: 2
    Decrypting Mobipocket 6 ebook: Hostage at the Table: How Leaders Can Overcome Conflict, Influence Others, and Raise Performance (J-B Warren Bennis Series)
    Found 6 keys to try after 0.0 seconds
    Crypto Type is: 2
    DeDRM v6.5.3: Failed to decrypt with error: No key found in 6 keys tried.
    DeDRM v6.5.3: Looking for new default Kindle Key after 0.0 seconds
    Found k4Mac kinf2011 file: /Users/Jose/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2011
    DeDRM v6.5.3: Trying to decrypt Introduction to Factor Analysis.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 6, header length 232
    Extra Data Flags: 10
    Decrypting Mobipocket 6 ebook: Introduction to Factor Analysis: What It Is and How To Do It (Quantitative Applications in the Social Sciences)
    Found 6 keys to try after 0.0 seconds
    Crypto Type is: 2
    DeDRM v6.5.3: Failed to decrypt with error: No key found in 6 keys tried.
    DeDRM v6.5.3: Looking for new default Kindle Key after 0.0 seconds
    Found k4Mac kinf2011 file: /Users/Jose/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2011
    DeDRM v6.5.3: Trying to decrypt Managing Conflict in Organizations.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 6, header length 264
    Extra Data Flags: 3
    Decrypting Mobipocket 6 ebook: Managing Conflict in Organizations
    Found 6 keys to try after 0.0 seconds
    Crypto Type is: 2
    DeDRM v6.5.3: Failed to decrypt with error: No key found in 6 keys tried.
    DeDRM v6.5.3: Looking for new default Kindle Key after 0.0 seconds
    Found k4Mac kinf2011 file: /Users/Jose/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2011
    Decrypted key file using IDString ‘6d8fb13990d4’ and UserName ‘Jose’
    DeDRM v6.5.3: Ultimately failed to decrypt after 0.4 seconds.
    Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages/calibre/customize/ui.py”, line 168, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 610, in run
    File “calibre_plugins.dedrm.init“, line 560, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.5.3: Ultimately failed to decrypt after 0.4 seconds
    DeDRM v6.5.3: Trying to decrypt Why Great Leaders.azw
    Decrypted key file using IDString ‘6d8fb13990d4’ and UserName ‘Jose’
    DeDRM v6.5.3: Ultimately failed to decrypt after 0.4 seconds.
    Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages/calibre/customize/ui.py”, line 168, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 610, in run
    File “calibre_plugins.dedrm.init“, line 560, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.5.3: Ultimately failed to decrypt after 0.4 seconds
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    Decrypted key file using IDString ‘6d8fb13990d4’ and UserName ‘Jose’
    DeDRM v6.5.3: Ultimately failed to decrypt after 0.4 seconds.
    Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    MOBI header version 6, header length 232
    Extra Data Flags: 10
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages/calibre/customize/ui.py”, line 168, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 610, in run
    File “calibre_plugins.dedrm.init“, line 560, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.5.3: Ultimately failed to decrypt after 0.4 seconds
    Decrypting Mobipocket 6 ebook: Why Great Leaders Don’t Take Yes for an Answer: Managing for Conflict and Consensus
    Found 6 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.5.3: Failed to decrypt with error: No key found in 6 keys tried.
    DeDRM v6.5.3: Looking for new default Kindle Key after 0.1 seconds
    Found k4Mac kinf2011 file: /Users/Jose/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2011
    Added Hostage at the Table: How Leaders Can Overcome Conflict, Influence Others, and Raise Performance (J-B Warren Bennis Series) to db in: 0.1
    Added Introduction to Factor Analysis: What It Is and How To Do It (Quantitative Applications in the Social Sciences) to db in: 0.0
    Decrypted key file using IDString ‘6d8fb13990d4’ and UserName ‘Jose’
    DeDRM v6.5.3: Ultimately failed to decrypt after 0.4 seconds.
    Read the FAQs at Harper’s repository: https://github.com/apprenticeharper/DeDRM_tools/blob/master/FAQs.md
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages/calibre/customize/ui.py”, line 168, in _run_filetype_plugins
    File “calibre_plugins.dedrm.init“, line 610, in run
    File “calibre_plugins.dedrm.init“, line 560, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.5.3: Ultimately failed to decrypt after 0.4 seconds
    2017-01-14 23:57:47.312 Calibre[49914:9482536] deliverNotificationWithTitle()
    * Notification delivered.
    Added Managing Conflict in Organizations to db in: 0.1
    Added Why Great Leaders Don’t Take Yes for an Answer: Managing for Conflict and Consensus to db in: 0.0
    Added 4 books in 1.4 seconds
    Worker Launch took: 0.113141775131
    Job: 1 Convert book 1 of 1 (Hostage at the Table: How Leaders Can Overcome Conflict, Influence Others, and Raise Performance (J-B Warren Bennis Series)) finished
    Convert book 1 of 1 (Hostage at the Table: How Leaders Can Overcome Conflict, Influence Others, and Raise Performance (J-B Warren Bennis Series))
    Resolved conversion options
    calibre version: 2.77.0
    {‘asciiize’: False,
    ‘author_sort’: None,
    ‘authors’: None,
    ‘base_font_size’: 0.0,
    ‘book_producer’: None,
    ‘change_justification’: u’original’,
    ‘chapter’: u”//*[((name()=’h1′ or name()=’h2′) and re:test(., ‘\s*((chapter|book|section|part)\s+)|((prolog|prologue|epilogue)(\s+|$))’, ‘i’)) or @class = ‘chapter’]”,
    ‘chapter_mark’: u’pagebreak’,
    ‘comments’: None,
    ‘cover’: u’/var/folders/gy/b24f2wvd3mqbf7f1dzcgf6gw0000gn/C/calibre_2.77.0_tmp_C6tWbJ/H4cg2a.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,
    ‘expand_css’: False,
    ‘extra_css’: None,
    ‘extract_to’: None,
    ‘filter_css’: u”,
    ‘fix_indents’: True,
    ‘flow_size’: 260,
    ‘font_size_mapping’: None,
    ‘format_scene_breaks’: True,
    ‘html_unwrap_factor’: 0.4,
    ‘input_encoding’: None,
    ‘input_profile’: <calibre.customize.profiles.InputProfile object at 0x115a61510>,
    ‘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.iPad3Output object at 0x115a61ad0>,
    ‘page_breaks_before’: u”//*[name()=’h1′ or name()=’h2′]”,
    ‘prefer_metadata_cover’: False,
    ‘preserve_cover_aspect_ratio’: False,
    ‘pretty_print’: True,
    ‘pubdate’: None,
    ‘publisher’: None,
    ‘rating’: None,
    ‘read_metadata_from_opf’: u’/var/folders/gy/b24f2wvd3mqbf7f1dzcgf6gw0000gn/C/calibre_2.77.0_tmp_C6tWbJ/Qd9LTh.opf’,
    ‘remove_fake_margins’: True,
    ‘remove_first_image’: False,
    ‘remove_paragraph_spacing’: False,
    ‘remove_paragraph_spacing_indent_size’: 1.5,
    ‘renumber_headings’: True,
    ‘replace_scene_breaks’: u”,
    ‘search_replace’: ‘[]’,
    ‘series’: None,
    ‘series_index’: None,
    ‘smarten_punctuation’: False,
    ‘sr1_replace’: None,
    ‘sr1_search’: None,
    ‘sr2_replace’: None,
    ‘sr2_search’: None,
    ‘sr3_replace’: None,
    ‘sr3_search’: None,
    ‘start_reading_at’: None,
    ‘subset_embedded_fonts’: False,
    ‘tags’: None,
    ‘timestamp’: None,
    ‘title’: None,
    ‘title_sort’: None,
    ‘toc_filter’: None,
    ‘toc_threshold’: 6,
    ‘toc_title’: None,
    ‘transform_css_rules’: ‘[]’,
    ‘unsmarten_punctuation’: False,
    ‘unwrap_lines’: True,
    ‘use_auto_toc’: False,
    ‘verbose’: 2}
    Python function terminated unexpectedly: Hostage at the Table: How Leaders Can Overcome Conflict, Influence Others, and Raise Performance (J-B Warren Bennis Series)
    InputFormatPlugin: MOBI Input running
    on /var/folders/gy/b24f2wvd3mqbf7f1dzcgf6gw0000gn/C/calibre_2.77.0_tmp_C6tWbJ/qWmVQ3.azw
    Traceback (most recent call last):
    File “/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py”, line 154, in main
    return run_entry_point()
    File “/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py

    • Oh wow, I realize it is not easy, but with
      “DRM could not be removed. I got books from a friend. Here is the report:”
      You just answered the question yourself.
      The question being “Why was DRM not removed”?
      You can only strip DRM from ebooks you bought yourself. The key to strip is in your programs or the serial number of your device (Kindle eInk). The first test and probably the first question anyone gets asked: can you open the ebook successfully in the program on your computer.
      For ebooks from a friend (with DRM) the answer will be “No”.
      It is possible to transfer the keys from computer to another, but the normal procedure is to strip the DRM on the same computer where they where first bought – also to perform the above mentioned test (can I open the ebook?).

      Obviously this is in the FAQ…

  15. Hello, Apprentice Alf. Thanks for developing / curating these tools. They are phenomenal!

    I managed to strip my Kindle eBooks (which I paid for) of its DRM on a Windows 10 machine without any problems, by following the simple path: 1. install Kindle for PC, 2. install Calibre; 3. install the deDRM plugin; 4. check that the plugin has detected the Kindle key; 5. just convert my books to ePub.

    But I also have a Ubuntu machine and here I have been less successful.

    I don’t want to install Wine, so I don’t have the Kindle for PC installed there.

    I thought that I could bypass this step by:
    1. installing Calibre on the Ubuntu machine
    2. installing the deDRM plugin on the Ubuntu machine
    3. going to my Windows machine; extracting the Kindle key (k4i file) via the deDRM plugin
    4. going to my Ubuntu machine and importing that k4i file as the Kindle key
    5. convert books to ePub

    Step 5 fails with the “padlock screen” that says that the file is locked with DRM.

    Where has my logic gone wrong? 😦

    Not a huge issue, as I can just transfer the deDRM’d epub files to my Ubuntu machine, but I would have loved to make it work this way.

    Thanks!!!!

  16. CALIBRE 2.77 with DeDRM 6.5.3 failed to convert AZW KINDLE purchased from AMAZON to PDF on 15 January 2017. Any solution?

  17. CALIBRE 2.77 with DeDRM 6.5.3 failed to convert to PDF Kindle AZW books on 15/1/2017. The operating system was WINDOWS 7. Any suggestion?

  18. CALIBRE 2.77 with DeDRM 6.5.3 and Kindle for PC 19 and WINDOWS 7 failed to convert AZW books to PDF on 15/1/2017. What can i do?

  19. Is there a possibility to convert epub files created by Adobe Digital Edition 4.5.3? Unfortunately I get the message that the DRM has not been removed by Calibre plus DeDRM plug-in.
    Many thanks in advance.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s