How to Add a Kindle DRM-Removal Plugin to calibre

9740648442_83e4f12bf3_bUpdate: These instructions were updated on  11 July 2015. They worked for me on that day.

DRM is the bugaboo of ebooks.  It's the cause of more pain and agony than a Snooki photo, and today I plan to help fix that. I have long been on the side of removing DRM (it's the best way to protect your purchases), but up until today I had never gone beyond pointing my readers at tools.

 

The process is minimally difficult and I'd like to share it with you. But first, a few warnings.

Warning

  • Note that these instructions are Windows only, and some details will be different between the various versions of Windows.
  • Note that these instructions were written without the permission or participation of Kovid Goyal, the creator of calibre.
  • These instructions are written in order to assist the average user in protecting their purchases. I did not write it to assist in committing piracy; I believe in buying content, when possible. But I also believe in controlling the content I buy and that is why I strip the DRM.

TL;DR

Here's the short-short version: You need to get the DeDRM plugin from Apprentice Alf and install it in calibre (and reboot calibre). Once you've installed the plugin, all you have to do is find where Kindle4PC put the ebooks on your computer and drag each ebook into calibre (everything else is automatic).

Luckily for you, you only have to go through the set up process once in order to remove Kindle, Nook, and Adobe DE DRM. (Kobo is a separate process.) If you've followed my instructions for removing Nook DRM then you've already finished the process of setting up to strip Kindle DRM, and you can skip to the end of this post.

First Things First

You need to download and install these apps on your computer. If you have either of them then you do not need to install them again:

Calibre is of course the ebook library management tool. I've mentioned it once or twice, and that's what you're going to use to remove the DRM.  And K4PC is how you'll download the ebooks.

Install the apps one at a time (and set up your account with the K4PC app, if you haven't already). While it's being installed, go to the Apprentice Alf website and download the ZIP file full of plugins.

Got everything installed? Good.

  1. UnZip the ZIP file you just downloaded. Open the folder called calibre and you should see a folder full of plugins.
  2. Launch calibre. When it's open, look at the icons on the top row. There's one on the far right called "Preferences". Click on it.
  3. It will bring up a new window with a bunch of icons.  Look on the bottom row for the one that says "plugins". Click it.
  4. And now you'll get another new window. Look at the buttons on the bottom row. Click on the one that says "load plugin from file".
  5. Use the file browser window to find the folder you downloaded. Open it, and then open the DeDRM_calibre_plugin folder.
  6. There should only be a single ZIP file in that folder, and it should be called "DeDRM_plugin". Double click to select it.
  7. Shut down calibre and launch it again. Some times the plugin won't kick in until you after you do this.

Yippee!

You've just installed and configured the plugin (assuming all went well).  You should be able to copy any ebook you've downloaded from the K4PC app to calibre.  Calibre should now be able to read the ebooks and convert them to whatever format you prefer.

But before you can do that you'll need to find out where the Kindle ebooks are stored. This varies depending on which version of Windows you're running, but they can usually be found under the My Documents folder.

I'm looking at my Win 7 laptop right now and the  Kindle ebooks are found in "My Kindle Content" under My Documents.

The ones you will need to copy are:

  • AZW/AZW1/AZW2/AZW3
  • MOBI
  • PRC
  • TPZ

After you copy the files into calibre, you might have some trouble getting calibre to open them so you can read them.   Windows will need to be told that calibre can open the files. This should only happen once, so it's a relatively minor issue.

Note that if you simply convert the ebooks to Epub, you won't have this issue.

images by pellestenRosino

About Nate Hoffelder (10599 Articles)
Nate Hoffelder is the founder and editor of The Digital Reader:"I've been into reading ebooks since forever, but I only got my first ereader in July 2007. Everything quickly spiraled out of control from there. Before I started this blog in January 2010 I covered ebooks, ebook readers, and digital publishing for about 2 years as a part of MobileRead Forums. It's a great community, and being a member is a joy. But I thought I could make something out of how I covered the news for MobileRead, so I started this blog."

41 Comments on How to Add a Kindle DRM-Removal Plugin to calibre

  1. Just thought I’d share…
    After having these tools working for a long time, this summer (2012) the tools seemed to stop working for my Kindle for PC. I kinda put things on hold for personal reasons & just got back to investigating this:

    This is the message I would recieve as I attempted it “add books” in Calibre:

    Error: No key found. Please report this failure for help….
    (This message is followed by the file name of the specific azw file I was attempting to add)

    afterwards, The file seemed like it was present in Calibre, but when I attempted to open it I got the message about protected by DRM.

    Long story short, my solution turned out to be in Kindle 4 PC: I right clicked on the book in Kindle, selected “remove from device”. The book still showed in Kindle 4 PC, but now showed it would need to be downloaded. I then right clicked again and downloaded it.

    When I went back to calibre to try “add Book” again, all went smoothly (no error message), and the my book is accessible to me!

    Just goes to show not every error in this process has to do with the tools or calibre–sometimes something else happens.

    Thanks to all who take the time to make comments that (hopefully) help others use what they own!

  2. Got a free book from Amazon sent to my Kindle Fire, then got Amazon to transferred it to my Kindle for PC and get a message “… Topaz book cannot be processed”.

    I am also unable to dedrm any Amazon .prc book. What gives?

    Thanks – Bob

  3. for all you people having trouble – trying things over and over again…
    I found a little note in Alf’s column “the DRM is removed only when you first IMPORT the book”…
    so I deleted all my books from Calibre, shut it down and re-opened it for good measure and added my AZW files again…..POOF DRM removed……

  4. Having tried the instructions for calibre about a dozen times with no luck, I tried the python method detailed above. One thing not mentioned in the above instructions is that you really do need to put your serial number in the space provided when running the DeDrm program. Once I did that, it converted the files just fine and I was then able to convert them from azw to epub with calibre. Also, when it says you need to install DeDrm in the directory specified, you don’t. I installed mine to a different drive (one I use for testing) and it worked perfectly.

    Thanks for a great article! I’ve been trying to convert some of these files for a while now.

  5. I was having a terrible time. I have used this method for a couple years or so with no trouble. Finally, I uninstalled the K4PC program and reinstalled it, removed the books from the device and redownloaded them. In Calibre, I DELETED the old Kindle DeDRM and left the new one. Closed Calibre and reopened it. Then imported the Kindle books and converted them to EPUB. Finally!! Success!!

    I think deleting the old kindle dedrm (not just disabling it) was the key.

  6. Hi,
    I am a new user in this world, and after reading the forum I still have aproblem with deDRM from azw to any other format. Here are the details:

    Win 7, kindle pc reader, calibre with the necessary plug-in added. I download some kindle book from amazon (bought them by 0.0 $ actually). I could convert those wich was in MOBI, but couldn’t those are in AZW because DRM cannot removed. I have tried the older calibre (0.9.3) as well without success. Do somebody has some idea? Thansk

    • I have the same problem. I have installed the Kindle for PC and the latest version of the deDRM. I have also installed python and decrypter. I don’t have a kindle, just an ipod touch so I have no kindle serial number to include.

      I have downloaded all my kindle books and tried to decrypt. Some have worked and others haven’t and I have no idea why. Does anybody have any suggestions?

      • It wouldn’t convert anything that I already had in the calibre library, so I removed all of the books and reloaded them into calibre. Poof, they are all converted upon import.

  7. Error

    Using Library AlfCrypto DLL/DYLIB/SO
    K4MobiDeDRM v0.4.6: Calibre configuration directory = /Users/ThanksForMoreLove/Library/Preferences/calibre
    MobiDeDrm v0.37. Copyright 2008-2012 The Dark Reverser et al.
    MOBI header version = 6, length = 232
    Extra Data Flags = 2
    Found k4Mac kinf2011 file: /Users/ThanksForMoreLove/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2011

    Using Munged MAC Address for ID: 99a2f15ff0ec
    Using Munged MAC Address for ID: 99a2f15ff0ec
    Crypto Type is: 2
    Running file type plugin Kindle and Mobipocket DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages/calibre/customize/ui.py”, line 148, in _run_filetype_plugins
    File “calibre_plugins.k4mobidedrm.__init__”, line 145, in run
    Exception: K4MobiDeDRM plugin v0.4.6 Error: No key found in 4 keys tried. Please report this failure for help.
    The following books were not added as they already exist in the database (see –duplicates option):
    Best Kept Secrets (Hideaway Novels):
    /Users/ThanksForMoreLove/Books now/Alers, Rochelle/Best Kept Secrets (Hideaway Novels) (59)/metadata.opf
    Backing up metadata
    Added book ids: 1
    Notifying calibre of the change

  8. One question. Some have mentioned to change the file extension from AZW3 to AZW. How do you do that?

    • AZW3 is AZW. The difference is only that the suffix is different; the contents of the files can be identical.

      • AZW3 is the newer version of AZW (which are just renamed MOBIs). They are rebuilt based on html, like EPUBs, but wrapped differently. They are not the same thing at all. Only fourth-generation kindles, running firmware v4.1 or higher, can read AZW3, since it is always used to identify KF8-formatted ebooks. Changing the filename doesn’t change the contents, it only misidentifies it.

  9. I did it : it works !
    Thx a lot for the dev. It’s pretty straight forward to export DRM azw3 to pdf.
    I just have to fill in the serial number of my kindle in the customize plugin window for it works.

  10. Thank you!!! You save me.

  11. You can just use this website service:
    http://www.webdedrm.com

    THen you don’t need to mess around with getting friggin python working on windows!! just takes a few seconds uploading and that’s it, you get a link to the unlocked file.

  12. It worked fine for a long time, after an upgrade of Calibre all plugins got removed…
    Now trying to setup it again, can’t get it to work. I have a Mac, bought a book at Amazon and try to put it on my Nook.
    Here the import log.

    Any help appreciated!

    calibredb add BLACKOUT.azw
    K4MobiDeDRM plugin v0.4.7: Starting
    K4MobiDeDRM v0.4.7: Calibre configuration directory = /xxx/xx/Library/Preferences/calibre
    MOBI header version = 8, length = 248
    Extra Data Flags = 3
    Running file type plugin Kindle and Mobipocket DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages/calibre/customize/ui.py”, line 155, in _run_filetype_plugins
    File “calibre_plugins.k4mobidedrm.__init__”, line 136, in run
    TypeError: getPidList() takes exactly 6 arguments (5 given)
    is not a valid Kindle serial number or PID.
    K4MobiDeDRM: Calibre configuration directory = /xxx/xxx/Library/Preferences/calibre
    MOBI header version = 8, length = 248
    Extra Data Flags = 3
    No kindle-info files have been found.
    Crypto Type is: 2
    Running file type plugin K4PC, K4Mac, Kindle Mobi and Topaz DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages/calibre/customize/ui.py”, line 155, in _run_filetype_plugins
    File “calibre_plugins.k4mobidedrm.__init__”, line 94, in run
    Exception: K4MobiDeDRM plugin could not decode the file
    Backing up metadata

  13. The MAIN reason I NEED dedrm is this:

    I buy so many books with either missing or messed up Table of Contents.. which I’m sure most of you know can be a **major pain**, especially if it’s a long read or a text book.

    I like to be able to edit and add a good TOC.. then transfer them back to kindle.

    I was using a far more difficult method.

    So this is so helpful, thank you!

  14. Can’t get Calibre to open or run the plug-ins – receive an error message that part of the file is missing.

  15. Thank you. After a few false starts, I was able to convert a file I bought recently. Now I can read it on my other tablet 🙂

  16. Great article stepping through the installation process, but could do with a warning that if you have previously installed these tools they must be removed before installing the latest version or they won’t work!

  17. really great, thank you

  18. would this work for adobe digital editions?

  19. Hi!
    I am a new user in this world, so please bear with me. I read and installed everything, but I still have a problem with deDRM from prc to any other format *i want to change it in a PDF format*. I have a Kindle for PC, so no serial number for me.
    I keep getting “Error: No key found in 8 keys tried. Read the FAQs at Alf’s Blog. Only if none apply, report this failure for help.”
    . . .aaaand, here i am. Can someone tell what’s wrong?
    Thanks 🙂

  20. hello,

    newcomer: sorry if I talk non-sense. I’m also new to the eReaders’ world…well, here it goes:

    1) I don’t have a Kindle device. I have a Sony (PRS-650) which I connect to Ubuntu 12.04 via Calibre 0.8.38. I have Kindle-for-PC 1.10.4 installed on Ubuntu (under Wine 1.5.6);
    2) following Alf Apprentice’s instructions (hopefully from the right page) I installed 5 plugins to Calibre (tools_v_5.4.1 from folder “Calibre_Plugins”);
    3) I didn’t customize any of the plugins (I don’t have a Kindle device);
    4) I bought an eBook locked by DRM from Amazon. I can import it to Calibre no problem. When I click on convert, I get a message:

    “This book is DRMed. Cannot convert…etc”.

    Can you please help? I must have missed out something from AA’s instructions, but don’t know what exactly…I tried to upgrade Calibre to the latest version for Linux, to no avail…thanks!

  21. quick update: I tried to remove the DRMed book from the Calibre library, uninstall + install Kindle-for-PC, import this book once again into Calibre. It does import it, although the following message pops up:

    Error: No key found in 0 keys tried. Read the FAQs at Alf’s blog. Only if none apply, report this failure for help…. /home/daniele/My Kindle Content/B004FV4T8O_EBOK.azw

    (if I click on OK the book gets imported)…weird?

  22. Just want to say thanks for this well written post!

  23. Some people using Windows 8 are defeated by the way the Kindle app from the start menu hides the Kindle content. There’s an extremely easy workaround. Just go to Amazon via your Desktop and install the Kindle PC reader for Windows 7. It runs perfectly well on Windows 8 and when you download books through the desktop, a “My Kindle Content” folder appears in your Documents folder. Then just drag the desired books to Calibre. Here’s a link:
    http://www.amazon.com/gp/feature.html/ref=kcp_pc_ln_ar?docId=1000426311

  24. Can anyone answer a question for me please? Does calibre need to run on the same machine as the KindleForWindows program? Or can I use KindleForWindows to download the purchased book from Amazon, and then transfer the downloaded files to a linux box with Calibre on it? (I’d like to do it all on the linux machine but apparently there is no KindleForLinux reader client). Or does the calibre plugin need to use information from the Kindle reader in order to decrypt / unlock the files?
    I’d like to buy ebooks from Amazon and read them (as pdf I guess) on the linux machine but this drm seems to be the stumbling block…

    • See my post below – I can pull my e-book files from the Windows partition on my machine over to the Linux partition directly with Calibre, so I would have thought you’d be able to copy them from another machine. Some have suggested that K4PC needs to be installed on the same machine as Calibre but unless Calibre interrogates some other file or setting while collecting the e-book file, I can’t see that what you want to do would be a problem.

    • unfortunately, yes they have to run together. The plugin needs to read the secret KindleID number of your K4PC application, which I believe would be hidden in the registry of your computer. I suppose you could hunt that down, but it would be much easier to simply install calibre in windows.

      Alternatively, you could look into installing K4PC in linux under WINE. Some people have gotten it to work.

  25. Just wanted to drop a line to say thank you for your deDRM plugin and your guidance and advice.

    I have an unusual configuration – My laptop dual boots Win7 and LinuxMint. Calibre is running under Linux but the Kindle for PC app is not available for Linux (grr…) so that’s running under Windows. In addition I have two Amazon accounts under different e-mail addresses. Some of my e-books have been bought through one account and some under another, which adds complexity. With K4PC I have to de-register the app from one account and register it for the other to download a new e-book, and I can never see all my e-books at one time. So it’s wonderful to be able to deDRM them and plop them into Calibre which organises them and lets me keep them all together, as well as other e-books I’ve accumulated from various sources. I can then put them onto my Kindle device from Calibre, converting as necessary to Mobi format. And if I decide one day to dump my Kindle and put my e-books on my Samsung Galaxy Note II phone instead I can do so easily. Wonderful.

    I take the points raised in this thread about e-book licences giving the right to read as provided and not otherwise, but I can’t see it’s likely Amazon or anyone else would find anything much wrong with what I do – I buy my content and read it on devices I own.

    There’s another argument to be made which seems to have been missed. A paper book can be given away after you finish with it without breaking any rules, an e-book generally can’t because the licence forbids it. It therefore seems churlish to prevent me from moving my e-book from my Kindle to my phone to read it there – which feels like my straitjacket is being tightened further, unnecessarily!

  26. Thank you so much Nate and Osiris2106: the deDRMer works, and I have control of my ebooks purchased from Amazon (which I could previously, ridiculously, only read on a PC because I refuse to be locked into anymore Amazon products). So now I can read all my stuff on my Sony PR300 and my Nexus7 — mobility restored! In the end I found it easier to set up the deDRMer on my desktop, ie separately from the Calibre programme (rather than attempt plug-ins), so it was easier to check if I was making mistakes. It took me about an hour and a half to work it out — I’m pretty close to an idiot on the tech-savvy scale of things, so this is just to encourage those who are still struggling. Also thanks to ApprenticeAlf and the Calibre creator.

    • The plugins are really easy to use, actually. Once calibre is installed just go to preferences ==> plugins ==> load from file and you’re done. As opposed to configuring python and pycrypto which takes real knowhow. I did both, and I am tech-savvy, but it still took way too long just installing, vs. calibre which took 3 minutes to install the plugin.

      I’ve never had any errors using the plugins, because I make sure they both update together.

  27. Most of my content has been through Baen or other ebook sellers. Some has been from free sites on the web. And a bit through Amazon. Anyway thanks for the info.

  28. Instructions worked for me as in the original post. Thanks!

1 2 3 4 5 7

2 Trackbacks & Pingbacks

  1. How and why you should back up your Kindle where Amazon can’t reach | Christian Haugen
  2. Hvordan man fjerner DRM beskyttelse fra e-bøger | Printanalyse

Leave a comment

Your email address will not be published.


*


%d bloggers like this: