DRM Removal Tools for eBooks

Last updated on 13 July, 2015

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, deleting the DRM from their Sony eBooks, 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 tools_v6.2.2.zip can be downloaded from
https://github.com/apprenticeharper/DeDRM_tools/releases/tag/v6.2.2

Changes in 6.2.2:

  • Adds support for retrieving Barnes & Noble/nook encryption keys from the B&N servers by entering the account email address and password into the configuration dialog. (The email address and password are not stored.)
  • Improved support for retrieving the key from Nook Study logs.

Getting Help with the Tools

If you have any questions about the tools, ebooks and DRM, check my FAQs post:  Frequently Asked Questions about the DRM removal tools.

If you have any problems with the current tools, please ask for help in a comment on this post. 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 folder)
  • 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 this application for gaining full access to your own ebooks for archiving/converson/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 or eReader ebooks has probably just repackaged (an earlier) version of the tools available here.

220 thoughts on “DRM Removal Tools for eBooks

    • May I suggest that rather than a cumbersome linear blog format, a bulletin board system be adopted?

    • I Downloaded the newest tool and put them in Calibre went to plugins and opened DeDRM 6.2.2 and got this message: “Attribute error:’module’ object has no attribute ‘ConfigWidget’ How do I fix this? I am usyng Windows 8 64 bit

    • Hi, I’m using the Calibre plugin on Linux (Ubuntu 15.04) to remove DRM from my Kindle books. It mostly works great. The only issue is, I recently reinstalled Ubuntu and so had to reinstall Calibre and the plugin, and since then, when I add books to my Calibre library from the Kindle, DRM is successfully removed, but any images in the book disappear, and I’m left with blank space and a little question mark icon.

      Is there anything I can do to fix this? Thanks for any help you can give me. This is a really wonderful tool.

      • Instead of copying the .azw3 file from your E-Ink kindle, download it from the Amazon web site ‘for transfer via USB’ to your Kindle, and use that copy. Some books directly downloaded by Kindles now come in two parts – a .azw3 that contains the text, and a .azw6 that contains the high resolution graphics. But using the ‘download for transfer via USB’ gets you a unified .azw3 file instead.

    • There is 1 ebook to be decrypted.
      Processing file: Taming the Ox – Charles Johnson.epub
      shellcommand: /usr/bin/python ‘/Users/fcvog/Downloads/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/zipfix.py’ ‘/Volumes/STORY/ Story – for – Mb/ Aaamap/Johnson, Charles/Taming the Ox/Taming the Ox – Charles Johnson.epub’ ‘/Users/fcvog/Desktop/Taming the Ox – Charles Johnson_fixed.epub’ > ‘/Users/fcvog/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
      shellresult:
      shellcommand: /usr/bin/python ‘/Users/fcvog/Downloads/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/epubtest.py’ ‘/Users/fcvog/Desktop/Taming the Ox – Charles Johnson_fixed.epub’ > ‘/Users/fcvog/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
      shellresult: Adobe

      shellcommand: /usr/bin/python ‘/Users/fcvog/Downloads/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ineptepub.py’ ‘/Users/fcvog/Library/Preferences/com.apprenticealf.dedrm/Local Adept Key.der’ ‘/Users/fcvog/Desktop/Taming the Ox – Charles Johnson_fixed.epub’ ‘/Users/fcvog/Desktop/Taming the Ox – Charles Johnson_nodrm.epub’ > ‘/Users/fcvog/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
      shellresult: Could not decrypt Taming the Ox – Charles Johnson_fixed.epub because of an exception:
      Traceback (most recent call last):
      File “/Users/fcvog/Downloads/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ineptepub.py”, line 415, in decryptBook
      bookkey = rsa.decrypt(bookkey.decode(‘base64′))
      File “/Users/fcvog/Downloads/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ineptepub.py”, line 182, in decrypt
      raise ADEPTError(‘RSA decryption failed’)
      ADEPTError: RSA decryption failed

      Het commando is afgesloten met een status van niet-nul.
      There was an error with 1 ebook:
      Taming the Ox – Charles Johnson.epub couldn’t be decoded:
      Het commando is afgesloten met een status van niet-nul.

    • Howdy! I am having trouble converting books because I cannot remove the DRM. After trying several time to remove the DRM from my books, I took these steps to start fresth:
      1) uninstalled calibre from my computer
      2) deleted the Tools 6.2.2 folder & DeDRM_plugin.zip file I had extracted
      3) uninstalled Kindle for PC & deregistered with Amazon
      4) defragmented my hard drive
      5) rebooted by computer
      6) downloaded and installed calibre 2.32.1
      7) downloaded Kindle for PC, installed it & registered it with Amazon
      8) downloaded DeDRM_tools-6.2.2 from ApprenticeAlf site
      9) extracted DeDRM_plugin.zip file and saved to my hard drive
      10) ran Kindle for PC and found a book I could open and read
      11) ran calibre -> Preference -> Change Calibre Behavior -> Plugins (Advanced)
      12) -> File Type Plugins to verify no current DRM plugin installed/enabled
      13) -> Load plugin from file -> DeDRM_plugin.zip -> Open
      14) message about installing plugins is a security risk, etc. Clicked YES
      Plugin DeDRM successfully installed under ‘file type plugins’, etc. Clicked OK
      15) -> File Type Plugins to verify that DeDRM plugin is installed & enabled
      16) Exited calibre
      17) Opened calibre & imported book that I could open & read with Kindle for PC
      18) Tried to Open book: “This book is locked by DRM. To learn more about DRM and why you cannot read or convert this book in calibre, click here, etc.”

      As you can see, I cannot open or convert books using calibre because it will not remove the DRM. Do you have any suggestions on how to solve this?

      Any help would be very much appreciated.

      Thank you

        • Hi,
          Related to above question, I started getting the same problem after updating the Kindle Reader for PC. – This may remove (or impact) the Key file, which would stop the de-DRM processing.

          I use Linux, currently Ubuntu MATE 15.04. I use Wine to run the Kindle Reader App for PC to download purchased Kindle content – the reader is currently version 1.12.0 (after its recent update).

          The book downloads and becomes available in the Kindle Reader app. Note that the downloaded file has an “AZW” file extension.

          After adding the book to my Calibre library, the book is indicated to be an AZW3 file and the cover artwork is displayed, but opening or sending to my Kobo fails due to DRM.

          I regenerated the KindleKey (k4i) file using the Other_Tools/DRM_Key_Scripts … Kindle Python script and then added (replaced) the key for the Plug-in under Calibre.

          This solved my problem – hope it helps others if they have experienced the same issue.

    • When launching the Mac DeDRM app, the error message appears: “The application “DeDRM” can’t be opened.” I have copies of previous versions of the appe.g. 6.1 that still work fine.

      • That’s probably security options. Try turning them off in the System preferences briefly. Or there might be some keyboard shortcuts while opening the application that might help. I don’t remember the details off-hand.

        • Probably the setting in System Preferences/Security & Privacy/General “Allow applications downloaded from:” is set to either of the first two restrictive options. Changing it to “Anywhere” will work but also holding down the Option key when you launch the application will let you open it on a one-time basis without changing the global restrictions.

    • I am probably an idiot but I have been trying to install your plug-in for Calibre for ages and always get this:

      calibre, version 2.20.0
      ERROR: Unhandled exception: InvalidPlugin:The plugin in u’C:/Users/Admin/Documents/MyZip/tools_v6.2.2 (1).zip’ is invalid. It does not contain a top-level __init__.py file

      calibre 2.20 [64bit] isfrozen: True is64bit: True
      Windows-7-6.1.7601-SP1 Windows (’64bit’, ‘WindowsPE’)
      (‘Windows’, ‘7’, ‘6.1.7601’)
      Python 2.7.9
      Windows: (‘7′, ‘6.1.7601’, ‘SP1′, ‘Multiprocessor Free’)
      Successfully initialized third party plugins: DeDRM
      Traceback (most recent call last):
      File “site-packages\calibre\gui2\preferences\plugins.py”, line 316, in add_plugin
      File “site-packages\calibre\customize\ui.py”, line 388, in add_plugin
      File “site-packages\calibre\customize\ui.py”, line 53, in load_plugin
      File “site-packages\calibre\customize\zipplugin.py”, line 188, in load
      File “site-packages\calibre\customize\zipplugin.py”, line 286, in _locate_code
      InvalidPlugin: The plugin in u’C:/Users/Admin/Documents/MyZip/tools_v6.2.2 (1).zip’ is invalid. It does not contain a top-level __init__.py file

      probably my incompetence but any chance of a little help?

      Thanks

      Anthony

    • I need help with DeDRM 6.2.2. I downloaded a new ebook from amazon to my MacBookPro on July-29-2015. DeDRM produces a message that it can’t decode the file and asks if I have another PID to try. What is a PID? Would DeDRM work if I had the right PID? How do I get the right PID?

      • Here is a copy of the DeDRM log file DeDRM.log:

        shellcommand: /usr/bin/python ‘/Applications/eBook Readers/DeDRM.app/Contents/Resources/adobekey.py’ ‘/Users/Administrator/Library/Preferences/com.apprenticealf.dedrm/Local Adept Key.der’ > ‘/Users/Administrator/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
        shellresult: adobekey.py v6.0
        Copyright © 2009-2013 i♥cabbages and Apprentice Alf
        Traceback (most recent call last):
        File “/Applications/eBook Readers/DeDRM.app/Contents/Resources/adobekey.py”, line 602, in
        sys.exit(cli_main())
        File “/Applications/eBook Readers/DeDRM.app/Contents/Resources/adobekey.py”, line 525, in cli_main
        keys = adeptkeys()
        File “/Applications/eBook Readers/DeDRM.app/Contents/Resources/adobekey.py”, line 446, in adeptkeys
        raise ADEPTError(“Could not find ADE activation.dat file.”)
        __main__.ADEPTError: Could not find ADE activation.dat file.
        There is 1 ebook to be decrypted.
        Processing file: B005EYEPB2_EBOK.azw
        shellcommand: /usr/bin/python ‘/Applications/eBook Readers/DeDRM.app/Contents/Resources/k4mobidedrm.py’ -k ‘/Users/Administrator/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i’ ‘/Users/Administrator/Black Hole/eBook Library/B005EYEPB2_EBOK.azw’ ‘/Users/Administrator/Black Hole/eBook Library/Calibre will Assimilate/’ > ‘/Users/Administrator/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
        shellresult: Using Library AlfCrypto DLL/DYLIB/SO
        K4MobiDeDrm v5.2.
        Copyright © 2008-2013 The Dark Reverser et al.
        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: Destiny Disrupted: A History of the World Through Islamic Eyes
        Found 4 keys to try after 0.0 seconds
        Crypto Type is: 2
        Error decrypting book after 0.0 seconds: No key found in 4 keys tried.
        Traceback (most recent call last):
        File “/Applications/eBook Readers/DeDRM.app/Contents/Resources/k4mobidedrm.py”, line 242, in decryptBook
        book = GetDecryptedBook(infile, kDatabases, serials, pids, starttime)
        File “/Applications/eBook Readers/DeDRM.app/Contents/Resources/k4mobidedrm.py”, line 216, in GetDecryptedBook
        mb.processBook(totalpids)
        File “/Applications/eBook Readers/DeDRM.app/Contents/Resources/mobidedrm.py”, line 469, in processBook
        raise DrmException(u”No key found in {0:d} keys tried.”.format(len(goodpids)))
        DrmException: No key found in 4 keys tried.

      • I recently had trouble deDRMing a Kindle book that also asked for a PID. It had worked a few weeks earlier but the first sign of trouble was the Kindle app for Mac asking me to agree to the Terms of Service all over again when I downloaded a new book. After that, the DeDRM tool kept asking for a PID. I removed my Kindle files, got the newest DeDRM, 6.2.2, and still had problems. In the DeDRM configuration, Kindle for Mac, it said it had a key but I couldn’t find that file anywhere on my disk and it obviously didn’t work so I finally ran the Kindle key generator program manually from the other tools directory. That generated a file that I pointed DeDRM at and now it works. My theory is whatever automatically calls the key generator for Kindle books got confused and lost my old key or didn’t realize it needed to generate a new one when Amazon made me agree to their TOS all over again.

        • Kindle works this way: every program and device has its own Key (PID = Personal ID).
          The DeDRM Tools, wether standalone or the Calibre Plugin can handle more than one key.
          The Key from the Software should be found automatically by both the plugin and the DeDRM.
          For the eInk-devices you have to enter the serial number (without spaces), then the Key is generated, again you can have multiple eInk-Devices configured and working with DeDRM, all Keys are checked against the book.

          If you have to enter your account information again in the Kindle program, you should quit Calibre and the DeDRM standalone tool, enter the information in the Kindle program and download the ebook fresh. Then test wether it can be read with DRM in the Kindle program (it should).
          Then drag and drop the book on the DeDRM standalone program.

          If it still does not work, and wants a PID, you should configure a new User in Mac OS / Windows to try again without old setting probable getting in the way. The Key Generator you mention might be for eInk-Devices, actually I just checked, where did you get it, if it is from an older DeDRM-Tool-Zip, it is not needed anymore, and I do not find it in the Tools directories. If it really is for eInk-Kindle-Devices, it will generate a Key for ebooks downloaded on that device – which will not help with eBooks downloaded with the Kindle program. Only books downloaded with and directly from the Kindle with the entered serial number might then work with DeDRM.

          With the Calibre-Plugin there are added causes for error (old DeDRM plugins, something else not working), so I would suggest to start and concentrate on the standalone if it starts without error. For Windows I cannot help further, but for Mac OS I may be able to help.
          Maybe others will comment.
          If it still does not work, post a log.

        • If you had to agree to TOS again, it may have worked like a new install of Kindle for Mac. You might have tried deleting the “default key” in the plug-in configuration for Kindle for Mac. That would have forced it to look for a new key. Something to keep in mind if it happens again.

          • I didn’t actually have to re-enter my data just click a box saying I agreed to their terms. I didn’t see anything in deDRM to delete an old key but I wasn’t looking for it either. I’ll try deleting the key if it happens again.

    • merci pour la mise à jour. Certains livres n’étaient plus convertis pas la précédente. je peux enfin lire tous mes livres sur ma liseuse!

    • Hi. downloaded the tools, followed the instructions but my books are still drm, I am using the most up to date tools and calibre & a kindle voyage. Can anyone help please?

      • Hi Dee,

        There are two possibilities that come to mind:
        1. You might not have the Python script engine installed (please refer to line 46 of the ReadMe_First.txt file).
        2. It is possible that you need to generate/load your “Kindle Key” (assuming your book came from Amazon). This is a file with a “k4i” extension that can be generated using one of the supplied Python scripts – into the De-DRM plugin within Calibre. (Please refer to line 65 of the ReadMe_First.txt).

        Note that possibility 2 usually only applies of you are using a Linux system.

        If you DO have the Python engine installed, then I suggest checking option 2.

        In Calibre, open the Preferences dialog, then click Plug-ins.
        Expand the File-Type Plug-ins and select the DeDRM6.2.2 entry.
        Now click the Customise Plug-in button.
        For your source platform, click the appropriate button – e.g. “Kindle for Mac/PC enooks”.
        If there is no entry listed, you’ll likely need to generate the key file and add it here.

        To generate the key file:
        Run the appropriate Python script from the “Other Tools” sub-folders.

        Lastly, do please read the notes on Troubleshooting in the “DeDRM_plugin_ReadMe.txt” file, located in the tools_v6.2.2/DeDRM_calibre_plugin folder. You may want to follow the guidance on generating a log file to post here for Apprentice Alf to check.

        Hope this helps.

        • You don’t need to install Python if you’re using the calibre plug-in. To decrypt books from an Eink Kindle, you do need to add the device’s serial number to the plug-in’s configuration dialog.

    • Not sure if this is the right place to post, but I have installed DeDRM 6.2.2 into Calibre on a Windows 10 Machine, but the plugin is not working. All previous DeDRM versions were previously removed. On a second PC (windows 7) the plugin works perfectly. It mystifies me as to what’s wrong. As previously suggested in FAQ, I opened Calibre in debug mode and the following script is the result. Please Help!! Many thanks.

      Microsoft Windows [Version 10.0.10240]
      (c) 2015 Microsoft Corporation. All rights reserved.

      C:\Windows\system32>calibre-debug -g
      calibre 2.33 isfrozen: True is64bit: False
      Windows-8-6.2.9200 Windows (’32bit’, ‘WindowsPE’)
      (‘Windows’, ‘8’, ‘6.2.9200’)
      Python 2.7.9
      Windows: (‘8′, ‘6.2.9200’, ”, ‘Multiprocessor Free’)
      Successfully initialized third party plugins: DeDRM && KindleUnpack – The Plugin && Generate Cover && Modify ePub && Quality Check && Find Duplicates && EpubSplit && EpubMerge
      Starting up…
      macmenuhack file_path:C:\Users\Con_0\AppData\Roaming\calibre\plugins\fanficfare_macmenuhack.txt
      Started up in 3.67 seconds with 1 books
      DeDRM v6.2.2: Trying to decrypt One_Life.epub
      DeDRM v6.2.2: Verifying zip archive integrity
      DeDRM v6.2.2: One_Life.epub is a secure Adobe Adept ePub
      DeDRM v6.2.2: Looking for new default Adobe Digital Editions Keys after 0.2 seconds
      DeDRM v6.2.2: Exception when getting default Adobe Key after 0.2 seconds
      Traceback (most recent call last):
      File “calibre_plugins.dedrm.__init__”, line 313, in ePubDecrypt
      File “calibre_plugins.dedrm.adobekey”, line 377, in adeptkeys
      ADEPTError: Adobe Digital Editions not activated
      DeDRM v6.2.2: Ultimately failed to decrypt after 0.2 seconds.
      Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
      Running file type plugin 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.dedrm.__init__”, line 590, in run
      File “calibre_plugins.dedrm.__init__”, line 367, in ePubDecrypt
      DeDRMError: DeDRM v6.2.2: Ultimately failed to decrypt after 0.2 seconds.
      Added One Life to db in: 0.2
      Added 1 books in 1.2 seconds
      Exception TypeError: “‘NoneType’ object is not callable” in <bound method NativeFunction.__del__ of > ignored

  1. shellcommand: /usr/bin/python ‘/Users/Name/Desktop/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/adobekey.py’ ‘/Users/Name/Library/Preferences/com.apprenticealf.dedrm/Local Adept Key.der’ > ‘/Users/Name/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: adobekey.py v6.0
    Copyright © 2009-2013 i♥cabbages and Apprentice Alf
    Traceback (most recent call last):
    File “/Users/Name/Desktop/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/adobekey.py”, line 602, in
    sys.exit(cli_main())
    File “/Users/Name/Desktop/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/adobekey.py”, line 525, in cli_main
    keys = adeptkeys()
    File “/Users/Name/Desktop/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/adobekey.py”, line 446, in adeptkeys
    raise ADEPTError(“Could not find ADE activation.dat file.”)
    __main__.ADEPTError: Could not find ADE activation.dat file.
    shellcommand: /usr/bin/python ‘/Users/Name/Desktop/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/kindlekey.py’ ‘/Users/Name/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i’ > ‘/Users/Name/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: kindlekey.py v1.9
    Copyright © 2010-2013 some_updates and Apprentice Alf
    No k4Mac kindle-info/rainier/kinf2011 files have been found.
    Could not retrieve Kindle for Mac/PC key.

    shellcommand: /usr/bin/python ‘/Users/Name/Desktop/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/ignoblekey.py’ ‘/Users/Name/Library/Preferences/com.apprenticealf.dedrm/Nook Study Key.b64′ > ‘/Users/Name/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: ignoblekey.py v1.1
    Copyright © 2015 Apprentice Alf
    No nook Study log files have been found.
    Could not retrieve nook Study key.

    There is 1 ebook to be decrypted.
    Processing file: B00DBE1P2Y_EBOK.azw
    shellcommand: /usr/bin/python ‘/Users/Name/Desktop/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py’ -k ‘/Users/Name/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i’ ‘/Users/Name/Desktop/B00DBE1P2Y_EBOK.azw’ ‘/Users/Name/Desktop/’ > ‘/Users/Name/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: Using Library AlfCrypto DLL/DYLIB/SO
    K4MobiDeDrm v5.2.
    Copyright © 2008-2013 The Dark Reverser et al.
    Error getting database from file /Users/Name/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i: [Errno 2] No such file or directory: u’/Users/Name/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i’
    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: World After (Penryn & the End of Days Book 2)
    Found 0 keys to try after 0.0 seconds
    Crypto Type is: 2
    Error decrypting book after 0.0 seconds: No key found in 0 keys tried.
    Traceback (most recent call last):
    File “/Users/Name/Desktop/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py”, line 232, in decryptBook
    with open(dbfile, ‘r’) as keyfilein:
    IOError: [Errno 2] No such file or directory: u’/Users/Name/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i’
    Traceback (most recent call last):
    File “/Users/Name/Desktop/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py”, line 242, in decryptBook
    book = GetDecryptedBook(infile, kDatabases, serials, pids, starttime)
    File “/Users/Name/Desktop/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py”, line 216, in GetDecryptedBook
    mb.processBook(totalpids)
    File “/Users/Name/Desktop/tools_v6.2.2/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/mobidedrm.py”, line 469, in processBook
    raise DrmException(u”No key found in {0:d} keys tried.”.format(len(goodpids)))
    DrmException: No key found in 0 keys tried.
    There was an error with 1 ebook:
    B00DBE1P2Y_EBOK.azw couldn’t be decrypted.

    • Judging by the name, that’s a book from Kindle for PC/Mac. But no installation of Kindle for Mac was found on your computer

      (No k4Mac kindle-info/rainier/kinf2011 files have been found.
      Could not retrieve Kindle for Mac/PC key.)

      Try doing the decryption on the same computer as your copy of Kindle for Mac.

      • This worked perfectly. Thank you. I had originally downloaded the book on my work machine, and then transferred it to my play machine, where I do all of my off the clock work. Installed Kindle For Mac on the play machine and redownloaded the book. Dragged the book onto CeCRM.app and bang.

        Thanks again!

  2. Unsuccessful De-DRM’ing various ePub or pdf files. Running tools v6.2.2. on Mac OS10.10.4
    Receive following error message:
    There was an error with 1 ebook:
    [BOOKNAME].pdf couldn’t be decoded:
    The command exited with a non-zero status.

    log reads:
    shellresult: Error serializing pdf [BOOKNAME]. Probably wrong key.
    The command exited with a non-zero status.

    Any suggestions or fixes?

      • Log for an unsuccessful ePub file attempt:

        shellcommand: /usr/bin/python ‘/Applications/DeDRM-Mac/DeDRM_Mac_v6.2.2/DeDRM.app/Contents/Resources/kindlekey.py’ ‘/Users/Griffin/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i’ > ‘/Users/Griffin/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
        shellresult: kindlekey.py v1.9
        Copyright © 2010-2013 some_updates and Apprentice Alf
        No k4Mac kindle-info/rainier/kinf2011 files have been found.
        Could not retrieve Kindle for Mac/PC key.

        There is 1 ebook to be decrypted.
        Processing file: Tocqueville.epub
        shellcommand: /usr/bin/python ‘/Applications/DeDRM-Mac/DeDRM_Mac_v6.2.2/DeDRM.app/Contents/Resources/zipfix.py’ ‘/Users/Griffin/Documents/Digital Editions/Tocqueville.epub’ ‘/Users/Griffin/Desktop/Tocqueville_fixed.epub’ > ‘/Users/Griffin/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
        shellresult:
        shellcommand: /usr/bin/python ‘/Applications/DeDRM-Mac/DeDRM_Mac_v6.2.2/DeDRM.app/Contents/Resources/epubtest.py’ ‘/Users/Griffin/Desktop/Tocqueville_fixed.epub’ > ‘/Users/Griffin/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
        shellresult: Adobe

        shellcommand: /usr/bin/python ‘/Applications/DeDRM-Mac/DeDRM_Mac_v6.2.2/DeDRM.app/Contents/Resources/ineptepub.py’ ‘/Users/Griffin/Library/Preferences/com.apprenticealf.dedrm/Local Adept Key.der’ ‘/Users/Griffin/Desktop/Tocqueville_fixed.epub’ ‘/Users/Griffin/Desktop/Tocqueville_nodrm.epub’ > ‘/Users/Griffin/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
        shellresult: Could not decrypt Tocqueville_fixed.epub. Wrong key
        The command exited with a non-zero status.
        There was an error with 1 ebook:
        Tocqueville.epub couldn’t be decoded:
        The command exited with a non-zero status.

  3. Thank you Alf for the new toolversion that now can be again downloaded again directly from your blogside!

  4. thanks.

    Trying the dedrm MacOS app (on 10.9.5). works perfectly with drag-n-drop for individual files, but if I drag-n-drop the folder, containing the file, it says “No ebooks found in the dropped items”.

    The folder I am dropping contains just one file, which works perfectly if dropped itself on the app.

    log below, thanks much indeed.

    shellcommand: /usr/bin/python ‘/Users/cdm/Desktop/DRM/DeDRM.app/Contents/Resources/adobekey.py’ ‘/Users/cdm/Library/Preferences/com.apprenticealf.dedrm/Local Adept Key.der’ > ‘/Users/cdm/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: adobekey.py v6.0
    Copyright © 2009-2013 i♥cabbages and Apprentice Alf
    Traceback (most recent call last):
    File “/Users/cdm/Desktop/DRM/DeDRM.app/Contents/Resources/adobekey.py”, line 602, in
    sys.exit(cli_main())
    File “/Users/cdm/Desktop/DRM/DeDRM.app/Contents/Resources/adobekey.py”, line 525, in cli_main
    keys = adeptkeys()
    File “/Users/cdm/Desktop/DRM/DeDRM.app/Contents/Resources/adobekey.py”, line 446, in adeptkeys
    raise ADEPTError(“Could not find ADE activation.dat file.”)
    __main__.ADEPTError: Could not find ADE activation.dat file.
    shellcommand: /usr/bin/python ‘/Users/cdm/Desktop/DRM/DeDRM.app/Contents/Resources/kindlekey.py’ ‘/Users/cdm/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i’ > ‘/Users/cdm/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: kindlekey.py v1.9
    Copyright © 2010-2013 some_updates and Apprentice Alf
    Found k4Mac kindle-info file: /Users/cdm/Library/Application Support/Amazon/Kindle/storage/.kindle-info
    Couldn’t decrypt file.
    Could not retrieve Kindle for Mac/PC key.

    There is 1 ebook to be decrypted.

      • thanks Paul – the book’s extension is azw3, and it has drm.

        DeDRM is perfectly happy with it, amd removes the drm correctly, if the file itself is dropped onto the app.

        • Well, goodness me. I can reproduce the problem (I don’t usually use the AppleScript now – I use the calibre plugin exclusivly). But I did originally write the AppleScript that the current DeDRM tool is based on, now maintained by Alf and Harper. Let me take a look and see if I can see what’s wrong. (My guess would be something to do with Mac OS X 10.10.x)

          • The reason i’m using the DeDRM app is simply that I don’t need all the extra features of Calbre. I just want to make drm-free backups of my books, just in case.

            But if the Calibre plugin is better, e.g. if it’s getting more recent development, then I could switch, and simply not use all the Calibre features….?

        • OK, found it – there’s a bug. If you drop a folder, it assumes that there’s more than one ebook in the folder and that the progress dialog will be active. With only one ebook in the folder, the progress dialog doesn’t get launched and the script then quits before processing the (one and only) ebook, assuming that the cancel button in the progress dialog has been pressed.

          This bug has probably been in there a long time. Alf or Harper might fix it in the next release, although it looks a bit fiddly.

          • Brilliant! thanks much indeed, Paul.

            confirmed that it works fine with 2 books in the folder.

            In general, would I be better off with the Calibre plug-in, even if I don’t need all the Calibre features?

            thanks again… :)

            • The stand-alone tools and the plugins all use the same tools underneath, as far as I can tell. The plugin is certainly easier to use on Windows than the stand-alone, where you need to install python and run some of the key retrieval scripts manually. But on Mac the stand-alone and the plugin are about as easy to use.

              I use the plugin because calibre is brilliant for keeping track of all my ebooks. My calibre library currently has over 5,500 ebooks in it, an even split between ones I’ve paid money for and ones I’ve got in free offers. Without calibre there’s no way I’d be able to keep track of the 750+ unread books I have in my TBR stack.

              I really can’t recommend calibre highly enough.

              • thanks again, Paul.

                I’m struggling to see what Calibre might offer me… I have several hundred books – not quite as many as you – but all are paid-for Kindle books.

                I really want a DRM-free backup, just in case something happens, but otherwise, I don’t really need any management tools, since I only use the Kindle device (and apps), and only for books bought from amazon, other than a very few exceptions.

                I use Kindle’s cloud collections to manage my books, and I believe Calibre can’t help with that, at least on newer devices, owing to the lock-down. that’s a shame, since that’s one thing that would be useful.

                thanks again for your help…

                • If you only have ebooks from Amaozn, and just want a DRM-free backup and are happy about managing your books in your Kindle account, then carry on without calibre. I have books from 25 different retailers (some now defunct), and before calibre, I did get into a bit of a muddle sometimes. Now I can easily track which book was bought where (custom column), whether I’ve read it (custom column) and how much I paid for it (custom column). calibre is wonderfully versatile.

                  • Hi Paul,

                    It’s very neat that you organized your books that way in Calibre. I have just over 800 and would love to do something akin to what you’ve done. How does one customized columns in Calibre?

                    I have 6.21 plug-in. Do I need to un-install it to install 6.22? How would I uninstall, please?

              • Some management can be done online at Goodreads.com, create an account & login. You can do an export of the metadata from calibre (as CSV) and Goodreads can import that. The rest can be done with self-named shelves, just to give you an idea from my shelves (number is books, the 999 is just by chance):
                Standard shelves:
                – all (999)
                – read ‎(603)
                – currently-reading ‎(23)
                – to-read ‎(373)
                Self-named:
                – abandoned ‎(2)
                – backlog-owned ‎(35)
                – filmed-as-movie-tv ‎(105)
                – paused ‎(6)
                – preordered ‎(22)
                – want2read-again ‎(37)
                Of course I use both Calibre and Goodreads, and Goodreads is a Database, so it may be kind of slow. And they sometimes change things and not for the better. It was bought by Amazon a few years ago, and the integration with the US-Site is now on the latest e-Ink-Kindles, so you can do some updates (like reading-progress) from the Kindle, as I just switched my German-registered Kindle to US-registration, I cannot say with which Kindle Model the Goodreads integration started, but it works with my Kindle Paperwhite V1.
                Interestingly enough, the US-Shop knows I am from Germany (I ordered my first DVD 1998 in the US), both from my shipping-adress and the credit-card, but they sell me ebooks which are not all available in the German store.
                With B&N I have to use a US-adress and for buying need VPN with an IP from the US – but I guess they will close shop soon, the last ebooks I bought there where the free offers from Bookbub I could not find at Amazon (at least not free).
                Sorry for the rant, it is not really about DRM, but I thought it might be of interest.

  5. I’m running into a strange problem with a book I got from Amazon. I just encountered the problem today with an older version of deDRM and the current version of calibre (2.31). I came to this website for troubleshooting and found (what luck!) that a new version was released today. I installed the new version, but the problem persists.

    Here are the steps:
    1. I add Book1 to calibre. So far I have tried doing this both directly from my device where it is in azw1 format and from my computer where I have the file in tpz format. The tpz is downloaded directly from the Amazon website. I get the same problem both ways.
    2. Book1 shows up in calibre. However, when I try to open it, calibre tries to add Book1 again. I get a message that I already have that title, but otherwise get no error message. I am never able to open Book1
    3. Here’s where it gets weird. Now I try to add Book2 (I have tried this with two different Book2’s, one in epub and one in azw3). Book2 gets added to calibre, but if I try to open it, I get the window telling me that there is DRM. When I close the reader window, I get a broken pipe error and the following error message details:

    calibre, version 2.31.0
    ERROR: Unhandled exception: IOError:[Errno 32] Broken pipe

    calibre 2.31 isfrozen: True is64bit: True
    Darwin-14.4.0-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘14.4.0’, ‘Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 2015; root:xnu-2782.30.5~1/RELEASE_X86_64′)
    Python 2.7.9
    OSX: (‘10.10.4′, (”, ”, ”), ‘x86_64′)
    Successfully initialized third party plugins: DeDRM && Find Duplicates
    Traceback (most recent call last):
    File “/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py”, line 209, in main
    return run_entry_point()
    File “/Applications/calibre.app/Contents/Resources/Python/lib/python2.7/site.py”, line 114, in run_entry_point
    return getattr(pmod, func)()
    File “site-packages/calibre/utils/ipc/worker.py”, line 199, in main
    IOError: [Errno 32] Broken pipe

    4. I close and reopen calibre and add Book2 again. This time, the DRM is successfully removed from Book2.

    Any thoughts? I’m unable to duplicate the problem with any book other than Book1, but I have no other books in azw1 or tpz format. Is this a calibre problem of a deDRM problem?

    Thanks.

      • I just ran calibre in debug mode and tried importing Book1. It worked this time – although it converted the tpz file to htmlz for some reason. I also tried importing Book2 right afterward and that also worked this time.

        I can try reproducing the problem when not in debug mode, but I have no idea if a log file gets created or where it goes.

        Here is the log from the successful debug mode import. I modified one line of it to replace my actual username with [username]. Sorry, this log file is kind of long.

        libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
        calibre Debug log
        calibre 2.31 isfrozen: True is64bit: True
        Darwin-14.4.0-x86_64-i386-64bit Darwin (’64bit’, ”)
        (‘Darwin’, ‘14.4.0’, ‘Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 2015; root:xnu-2782.30.5~1/RELEASE_X86_64′)
        Python 2.7.9
        OSX: (‘10.10.4′, (”, ”, ”), ‘x86_64′)
        Successfully initialized third party plugins: DeDRM && Find Duplicates
        Starting up…
        DeDRM v6.2.2: Trying to decrypt Running with the Buffaloes.tpz
        Using Library AlfCrypto DLL/DYLIB/SO
        Decrypting Topaz ebook: Running with the Buffaloes
        Found 4 keys to try after 0.1 seconds
        Trying: iWKC/QtS
        Book Key Found! (dc6bd6a729a0050b)
        Processing Section: glyphs
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        Processing Section: page
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        Processing Section: metadata
        . . . .
        Processing Section: other
        . . . .
        Processing Section: dict
        . . . .
        Processing Section: color
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        Processing Section: img
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        Successfully Extracted Topaz contents
        Updating to color images if available
        Creating cover.jpg
        Processing Dictionary
        Processing Meta Data and creating OPF
        Processing StyleSheet
        Using font size: 120
        Using page height: 12710
        Using page width: 7910
        Processing Glyphs
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        Processing Pages
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        Extracting Table of Contents from Amazon OCR
        The 1998 U of C Cross Country Team|0017
        Introduction|0028
        94 Day to Lawrence|0034
        Like Ten Pounds of Shit in a Five-Pound Bag|0041
        The Unspoken Agreement|0044
        The Day of Truth|0057
        Fuck This Shit|0064
        The Plan|0067
        Monster Islan|0076
        Rest … Finally|0088
        Short Specificity|0089
        You Need the Melon|0094
        Res Severa Verum Gaudia|0095
        The Right Stuff|0097
        Time to Work|0098
        So Many Gouchers|0101
        St. Crispin’s Day|0102
        Bluebirds|0107
        Oh, toucher!|0108
        Seasonal Affective Disorder|0112
        The Tank|0115
        The Miracle Doctor|0116
        AT|0119
        The Arapahoe Invitationa|0121
        Vengeance Is a Very Useful Too|0124
        Casualties|0134
        It’s My Last One, Bitch!|0146
        Flagstaff Again|0150
        More Trouble|0153
        Strength Kills|0154
        Ponce Has His Day|0157
        Money in the Bank|0168
        The Dam|0171
        Recovery|0175
        They All Want to Be You|0181
        Forty. Four Zero. Forty|0191
        Step It Up|0196
        Edge City Blues|0199
        We Believe in Our Fitness|0200
        Bluebirds|0208
        Death March|0209
        Milers|0211
        Without Limits|0213
        Percolation|0214
        Shakeout|0217
        Unleash the Lions|0222
        Mags|0238
        Welcome, Captains Reese and Burroughs|0241
        It’s in God’s Hands|0246
        Biding Time|0251
        A Day of Rest-for Some|0266
        Black Monday|0273
        A Struggle to Understan|0275
        Progress|0283
        Impressions from Afar|0286
        Memories|0290
        Tornado Coming-PFB’S!|0291
        Into the Sun|0303
        Slattery, I Think You’re Full of Shit|0307
        No Doubt About It|0308
        Welcome to Anaerobic|0313
        Changing of the Guar|0315
        Who Is Friedberg?|0316
        One More Victim|0320
        Musings|0321
        Let It Rain|0324
        How Good Are We?|0330
        Remember, We’re Buffaloes|0331
        The 1998 Big 12 Cross Country Championship|0337
        Back to Work|0346
        Master Blaster|0347
        Skeleton Dreams|0352
        Down|0354
        Another Casualty|0359
        Punchdrunk Fighters|0364
        Call to Arms|0368
        Edge City Is a Scary Place|0371
        I’m No Wildlife Expert|0372
        Earning Their Shot|0374
        Fired Up!!|0382
        Anyone Like Duck?|0391
        Priorities|0398
        The Hay’s in the Barn|0399
        Time Crawling|0403
        Lawrence, Here We Come|0406
        A Push From Above|0408
        The 1998 Men’s NCAA Cross Country Championship|0411
        The Show Is Over|0435
        Epilogue|0440
        Postscript|0445
        Building svg images of each book page
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
        Processing Complete
        Book Successfully generated
        Decryption succeeded after 19.9 seconds
        DeDRM v6.2.2: Successfully decrypted book after 20.7 seconds
        Started up in 85.44 seconds with 1400 books
        Added Running with the Buffaloes to db in: 0.1
        Added 1 books in 21.8 seconds
        libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
        InputFormatPlugin: HTLZ Input running
        on /Users/[username]/Box Sync/LibFictionEbook/Chris Lear/Running with the Buffaloes (1652)/Running with the Buffaloes – Chris Lear.htmlz
        Language not specified
        Building file list…
        Normalizing filename cases
        Rewriting HTML links
        DeDRM v6.2.2: Trying to decrypt Thunderball (James Bond – Extended Series Book 9).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: Thunderball (James Bond – Extended Series Book 9)
        Found 4 keys to try after 0.1 seconds
        Crypto Type is: 2
        File is encoded with PID ayCwDevn7L.
        Decrypting. Please wait . . . . done
        Decryption succeeded after 0.1 seconds
        DeDRM v6.2.2: Successfully decrypted book after 0.1 seconds
        Worker Launch took: 0.0826678276062
        Added Thunderball (James Bond – Extended Series Book 9) to db in: 0.6
        Added 1 books in 3.7 seconds
        2015-07-13 13:36:51.514 Calibre[3523:368984] deliverNotificationWithTitle()
        * Notification delivered.

        • An htmlz is the expected result of importing a Topaz format ebook. All seems to be well now, I wouldn’t waste time trying to reproduce the problem if I were you,

          • Thanks for your help. It still seems strange to me that I run into this problem in calibre’s release mode but not in debug mode. I’m not too concerned any more since I was able to fix the problem, but it might be worth looking into in the future.

  6. Hi,

    Thank you in advance to those that help out in this situation!

    Info

    DRM Removal Tool Used
    Windows 8.1
    ebook came from folder
    No error’s

    C:\Users\ELEE>calibre-debug -g
    calibre 2.31 [64bit] isfrozen: 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
    Starting up…
    Started up in 7.89 seconds with 94 books
    DeDRM v6.2.2: Trying to decrypt The Richest Man in Babylon.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: The Richest Man in Babylon
    Found 2 keys to try after 0.5 seconds
    Crypto Type is: 2
    File is encoded with PID W2Khj1BjZH.
    Decrypting. Please wait . . . done
    Decryption succeeded after 0.5 seconds
    DeDRM v6.2.2: Successfully decrypted book after 0.5 seconds
    Added The Richest Man in Babylon to db in: 2.3
    Added 1 books in 5.2 seconds

    • I don’t see a problem here. The book was successfully de-drmed. If the book was already in your calibre database, it’s possible that calibre discarded the new import and retained the older, DRMed copy. Delete the .azw3 version from calibre and re-import.

      • Appreciate the reply!
        I’ve deleted the book multiple times from calibre and re-added it, but each time it comes through it arrives as “AZW3″.

        Any advice on what I could do to fix this issues?

  7. Hi Paul,

    It’s very neat that you organized your books that way in Calibre. I have just over 800 and would love to do something akin to what you’ve done. How does one customized columns in Calibre?

    I have 6.21 plug-in. Do I need to un-install it to install 6.22? How would I uninstall, please?

  8. I’m having issues decrypting a new B&N Book. I’ve configured the plugin and provided my email and password but I’m seeing an error that indicates the Key is not being saved (ValueError: Key cannot be the null string) in the debug. I even tore open the Python script that fetches the key and submitted the URL it uses and appear to get a key returned.

    Successfully initialized third party plugins: DeDRM && Goodreads Sync && Goodreads
    Starting up…
    Started up in 3.42 seconds with 2225 books
    DeDRM v6.2.2: Trying to decrypt 2940151642507.epub
    DeDRM v6.2.2: Verifying zip archive integrity
    DeDRM v6.2.2: “2940151642507.epub” is a secure Barnes & Noble ePub
    DeDRM v6.2.2: Trying Encryption key Chris Oyler
    Could not decrypt h7lcm6.epub because of an exception:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.ignobleepub”, line 278, in decryptBook
    File “calibre_plugins.dedrm.ignobleepub”, line 209, in __init__
    File “calibre_plugins.dedrm.ignobleepub”, line 180, in __init__
    File “site-packages\pycrypto-2.6.1-py2.7-win-amd64.egg\Crypto\Cipher\AES.py”,line 95, in new
    File “site-packages\pycrypto-2.6.1-py2.7-win-amd64.egg\Crypto\Cipher\AES.py”,line 59, in __init__
    File “site-packages\pycrypto-2.6.1-py2.7-win-amd64.egg\Crypto\Cipher\blockalgo.py”, line 141, in __init__
    ValueError: Key cannot be the null string

    DeDRM v6.2.2: Failed to decrypt with key Chris Oyler after 0.3 seconds
    DeDRM v6.2.2: Looking for new NOOK Study Keys after 0.3 seconds
    No nook Study log files have been found.
    DeDRM v6.2.2: Ultimately failed to decrypt after 0.3 seconds.
    Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
    Running file type plugin 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.dedrm.__init__”, line 590, in run
    File “calibre_plugins.dedrm.__init__”, line 272, in ePubDecrypt
    DeDRMError: DeDRM v6.2.2: Ultimately failed to decrypt after 0.3 seconds.
    Added Jonesbridge: Echoes of Hinterland to db in: 1.7
    Added 1 books in 4.3 seconds

  9. I’ve always used Nook for Mac. At the beginning of the year, I had to download Nook Study to manually retrieve the new hidden key. Everything had been working fine since. The last time I DeDRMed any Nook books was on April 30. Today, I went to DeDRM the books from the last 2 1/2 months. For some reason Nook for Mac wasn’t showing my recent purchases until I went to my account settings and re-entered my email and password (they have not changed). I tried to load a book into calibre and it wouldn’t DeDRM. I deleted it and used Nook Study instead. Again, it wouldn’t DeDRM. I updated calibre and the DeDRM removal plugins and it still won’t work. Here is the debug log:

    libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    calibre Debug log
    calibre 2.31 isfrozen: True is64bit: True
    Darwin-13.3.0-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘13.3.0’, ‘Darwin Kernel Version 13.3.0: Tue Jun 3 21:27:35 PDT 2014; root:xnu-2422.110.17~1/RELEASE_X86_64′)
    Python 2.7.9
    OSX: (‘10.9.4′, (”, ”, ”), ‘x86_64′)
    DeDRM v6.1.0: In __init__
    DeDRM v6.1.0: In load_resources
    DeDRM v6.1.0: verdir /Users/Bug/Library/Preferences/calibre/plugins/DeDRM/6.1.0
    DeDRM v6.1.0: In initialize
    Successfully initialized third party plugins: DeDRM && K4PC, K4Mac, Kindle Mobi and Topaz DeDRM && Inept Epub DeDRM && Goodreads Sync && Save To Format && Inept PDF DeDRM && KindleUnpack – The Plugin && Goodreads && Manage Series && Modify ePub && Copy Cover To Device && User Category && Ignoble Epub DeDRM && Read MP3 AudioBook metadata && Generate Cover && Quality Check && Barnes & Noble && eReader PDB 2 PML && Resize Cover
    Starting up…
    DeDRM v6.1.0: In __init__
    DeDRM v6.1.0: In load_resources
    DeDRM v6.1.0: verdir /Users/Bug/Library/Preferences/calibre/plugins/DeDRM/6.1.0
    DeDRM v6.1.0: In initialize
    DeDRM v6.1.0: Trying to decrypt theliving_9780375984358.epub
    DeDRM v6.1.0: Verifying zip archive integrity
    DeDRM v6.1.0: “theliving_9780375984358.epub” is a secure Barnes & Noble ePub
    DeDRM v6.1.0: Trying Encryption key Juniper Moreno_XXXX
    Could not decrypt fRrjqK.epub because of an exception:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.ignobleepub”, line 278, in decryptBook
    File “calibre_plugins.dedrm.ignobleepub”, line 209, in __init__
    File “calibre_plugins.dedrm.ignobleepub”, line 158, in __init__
    IGNOBLEError: AES improper key used

    DeDRM v6.1.0: Failed to decrypt with key Juniper Moreno_XXXX after 0.0 seconds
    DeDRM v6.1.0: Trying Encryption key bnkey
    Could not decrypt fRrjqK.epub because of an exception:
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.ignobleepub”, line 278, in decryptBook
    File “calibre_plugins.dedrm.ignobleepub”, line 209, in __init__
    File “calibre_plugins.dedrm.ignobleepub”, line 158, in __init__
    IGNOBLEError: AES improper key used

    DeDRM v6.1.0: Failed to decrypt with key bnkey after 0.0 seconds
    DeDRM v6.1.0: Ultimately failed to decrypt after 0.0 seconds.
    Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
    Running file type plugin 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.dedrm.__init__”, line 503, in run
    File “calibre_plugins.dedrm.__init__”, line 201, in ePubDecrypt
    DeDRMError: DeDRM v6.1.0: Ultimately failed to decrypt “theliving_9780375984358.epub” after 0.0 seconds.
    Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
    Running file type plugin Inept Epub 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.ineptepub.__init__”, line 475, in run
    ADEPTError: IneptEpub – Ultimately failed to decrypt
    Running file type plugin Ignoble Epub 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.ignobleepub.__init__”, line 377, in run
    IGNOBLEError: IgnobleEpub – Ultimately failed to decrypt.
    IneptEpub: Using libcrypto.
    IneptEpub: Calibre configuration directory = /Users/Bug/Library/Preferences/calibre
    IneptEpub: Keyfile calibre-adeptkey.der found in config folder.
    IneptEpub: Encryption key invalid… trying others.
    IgnobleEpub: Using libcrypto.
    IgnobleEpub: Calibre configuration directory = /Users/Bug/Library/Preferences/calibre
    IgnobleEpub: No keyfiles found. Checking plugin customization string.
    IgnobleEpub: 1 userkey(s) generated from customization data.
    IgnobleEpub: Encryption key invalid… trying others.
    Started up in 17.79 seconds with 501 books
    Added The Living to db in: 0.0
    Added 1 books in 0.8 seconds
    libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    DeDRM v6.1.0: In __init__
    DeDRM v6.1.0: In load_resources
    DeDRM v6.1.0: verdir /Users/Bug/Library/Preferences/calibre/plugins/DeDRM/6.1.0
    DeDRM v6.1.0: In initialize
    InputFormatPlugin: EPUB Input running
    on /Users/Bug/Calibre Library/Matt de la Pena/The Living (573)/The Living – Matt de la Pena.epub

    • First you seem to be several versions of DeDRM out of date. Download the new tools 6.2.2 file. Now that said, I don’t know if the new tools have fixed the problem with the new Nook Books encryption. Several weeks ago, they did not work and I ended up having to buy a commercial program to remove DRM from Nook Books. I’d try using the latest DeDRM tools first.

      • Oh good grief, for some reason only an old tools file was showing up when I went to ‘change calibre behavior’. Went back, hunted up the new one I’d just downloaded earlier, and now all is good. Thank you

    • Since April, B&N have moved everyone over to the new encryption key scheme. You need to remove all the old DRM removal plugins you have installed (DeDRM 6.1; K4PC, K4Mac, Kindle Mobi and Topaz DeDRM; Inept Epub DeDRM; Inept PDF DeDRM; Ignoble Epub DeDRM) and replace them with DeDRM 6.1. Books from nook Study might work straight away, or you might need to enter your account email and password into the DeDRM plugin’s preferences as well.

  10. Hello Alf,

    I have installed the latest version of your software as a plugin in Calibre, but it still does not remove the DRM from my ebook. I just get the same warning again that says it can’t open the file because there is a drm protection. Below are the results of the debug from the command screen. I hope you can help.

    Sincerely, Niels

    Microsoft Windows [Version 6.3.9600]
    (c) 2013 Microsoft Corporation. Alle rechten voorbehouden.

    C:\Users\Niels>calibre-debug -g
    calibre 2.32.1 isfrozen: 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’)
    Successfully initialized third party plugins: DeDRM

    C:\Users\Niels>

      • Hello Laura,

        You are right. I thought I did it right but when i tried again i noticed ALOT different. Below is the full story.

        Sincerely,
        Niels

        Microsoft Windows [Version 6.3.9600]
        (c) 2013 Microsoft Corporation. Alle rechten voorbehouden.

        C:\Users\Niels>calibre-debug -g
        calibre 2.32.1 isfrozen: 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’)
        Successfully initialized third party plugins: DeDRM
        Starting up…
        Started up in 2.24 seconds with 1 books
        DeDRM v6.2.2: Trying to decrypt StudioJaz Drum Cookbook.epub
        DeDRM v6.2.2: Verifying zip archive integrity
        DeDRM v6.2.2: StudioJaz Drum Cookbook.epub is a secure Adobe Adept ePub
        DeDRM v6.2.2: Looking for new default Adobe Digital Editions Keys after 0.2 seco
        nds
        DeDRM v6.2.2: Exception when getting default Adobe Key after 0.2 seconds
        Traceback (most recent call last):
        File “calibre_plugins.dedrm.__init__”, line 313, in ePubDecrypt
        File “calibre_plugins.dedrm.adobekey”, line 377, in adeptkeys
        ADEPTError: Adobe Digital Editions not activated
        DeDRM v6.2.2: Ultimately failed to decrypt after 0.2 seconds.
        Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
        Running file type plugin DeDRM failed with traceback:
        Traceback (most recent call last):
        File “site-packages\calibre\customize\ui.py”, line 155, in _run_filetype_plugi
        ns
        File “calibre_plugins.dedrm.__init__”, line 590, in run
        File “calibre_plugins.dedrm.__init__”, line 367, in ePubDecrypt
        DeDRMError: DeDRM v6.2.2: Ultimately failed to decrypt after 0.2 seconds.
        Added Studio/Jaz Drum Cookbook to db in: 0.1
        Added 1 books in 0.7 seconds

        • For Adobe ePubs the tools only work with ePubs downloaded using Adobe DIgital Editions where Adobe Digital Editions has been registered/activated with an Adobe ID. It seems you haven’t done that. If you can read that book in your installed copy of Adobe Digital Editions, it means it’s tied to that copy and that copy only, and I don’t think the tools can help. (For future purchases, I urge you to register ADE with an Adobe ID.)

          Or, if that book comes from somewhere else, note that the tools need access to the decryption key, so you must already be able to read the ebook on the machine that has the DeDRM plugin on it.

  11. Hi Alf,

    i have python 3.3.2 installed and cannot change that :( So my question is: Can i build an exe version of the DeDRM Tool fo Windows with py2exe? If yes, i would setup a virtual machine :)

    • I suggest you use calibre and the plugin instead. calibre includes its own internal copy of Python 2.x, which the plugin also uses – it then doesn’t matter whether you have Python 2.x or 3.x installed as the default python on your system.

  12. Hi Alf, thanks for all the hard work. So grateful to find Calibre.

    First Problem I am having, I can’t find my Kindle books on my iPad Air to import them into Calibre.

    Second problem: I can’t figure out how to install the plug in into Calibre. Did I miss some instructions?

    Third problem: I have nook ebooks. I entered my info into the stand alone remover but it wasn’t able to get the key. Here’s the log info.

    shellcommand: /usr/bin/python ‘/Applications/DeDRM.app/Contents/Resources/adobekey.py’ ‘/Users/BBBBB/Library/Preferences/com.apprenticealf.dedrm/Local Adept Key.der’ > ‘/Users/BBBBB/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: adobekey.py v6.0
    Copyright © 2009-2013 i♥cabbages and Apprentice Alf
    Traceback (most recent call last):
    File “/Applications/DeDRM.app/Contents/Resources/adobekey.py”, line 602, in
    sys.exit(cli_main())
    File “/Applications/DeDRM.app/Contents/Resources/adobekey.py”, line 525, in cli_main
    keys = adeptkeys()
    File “/Applications/DeDRM.app/Contents/Resources/adobekey.py”, line 446, in adeptkeys
    raise ADEPTError(“Could not find ADE activation.dat file.”)
    __main__.ADEPTError: Could not find ADE activation.dat file.
    shellcommand: /usr/bin/python ‘/Applications/DeDRM.app/Contents/Resources/kindlekey.py’ ‘/Users/BBBBB/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i’ > ‘/Users/BBBBB/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: kindlekey.py v1.9
    Copyright © 2010-2013 some_updates and Apprentice Alf
    No k4Mac kindle-info/rainier/kinf2011 files have been found.
    Could not retrieve Kindle for Mac/PC key.

    shellcommand: /usr/bin/python ‘/Applications/DeDRM.app/Contents/Resources/ignoblekey.py’ ‘/Users/BBBBB/Library/Preferences/com.apprenticealf.dedrm/Nook Study Key.b64′ > ‘/Users/BBBBB/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: ignoblekey.py v1.1
    Copyright © 2015 Apprentice Alf
    No nook Study log files have been found.
    Could not retrieve nook Study key.

    shellcommand: /usr/bin/python ‘/Applications/DeDRM.app/Contents/Resources/ignoblekeyfetch.py’ ‘BBBBB@gmail.com’ ‘tsH81rn64d9KKv’ ‘/Users/BBBBB/Library/Preferences/com.apprenticealf.dedrm/BBBBB@gmail.com.b64′ > ‘/Users/BBBBB/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: The command exited with a non-zero status. Failed to fetch key.

    shellcommand: /usr/bin/python ‘/Applications/DeDRM.app/Contents/Resources/ignoblekeyfetch.py’ ‘BBBBB@gmail.com’ ‘ tsH81rn64d9KKv’ ‘/Users/BBBBB/Library/Preferences/com.apprenticealf.dedrm/BBBBB@gmail.com.b64′ > ‘/Users/BBBBB/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: The command exited with a non-zero status. Failed to fetch key.

    • Nix the first problem as it doesn’t relate to the plug in.

      Second problem: I found the instructions for installing the plug in into Calibre, but the zip file didn’t have the int py file in it. I did see an int py file in the folder, but the add plug in feature wouldn’t let me select anything except the zip file.

          • Paul. THANK YOU for pointing this out. I reread your comment and looked at the installation instructions again.

            The MAC **** automatically *** unzips the downloaded file. So when I unzipped the file – I was actually unzipping the very file Calibre was looking for. (It may have been obvious to MAC readers what I was missing, but I couldn’t figure it out.)

            I removed everything, downloaded tools again and was able to install the plug in without problem.

            (SECOND problem has been solved.) Thanks to everyone.

    • For Nook books, the latest version of the tools can either retrieve your key automatically from an installation of Nookstudy OR you can enter your B&N account email address and password into the configuration dialog.

      • I did enter my email and password into the configuration dialog. The script I attached was what I got back when I tried to run the DRM tool as a stand alone.

        Thanks, Briget

        • Are the nookbooks ones that you downloaded recently? If you’ve had them for a while, you could try downloading new copies. B&N doesn’t store any older keys on their server so the tools retrieve only the current one.

    • Briget:

      You’ve had three people try to help, but asking about several different problems in the same message makes it difficult for you and people helping you to keep track. I suggest that it you continue to have problems you make separate posts for the different kinds of ebooks.

      Now, as for your nook books. The important part of the log was

      shellcommand: /usr/bin/python ‘/Applications/DeDRM.app/Contents/Resources/ignoblekeyfetch.py’ ‘BBBBB@gmail.com’ ‘tsH81rn64d9KKv’ ‘/Users/BBBBB/Library/Preferences/com.apprenticealf.dedrm/BBBBB@gmail.com.b64′ > ‘/Users/BBBBB/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
      shellresult: The command exited with a non-zero status. Failed to fetch key.

      Your computer needs to be connected to the internet when doing this, and the email address and password must be your current B&N/nook email address and password. Check that you can log in to the B&N/nook web site with the username and password you’re using.

      If the key retrieval still fails, you might have better luck obtaining and installing nookStudy for Mac.

      You won’t be able to remove the DRM from Kindle books downloaded to an iPad. You’ll need to download them through Kindle for Mac or to a E-Ink based Kindle. Kindle for Mac is still available at http://www.amazon.co.uk/gp/help/customer/display.html?nodeId=201246110

  13. I installed a VM with python 2.7 and all prerequisites. DeDRM tool is running fine :) Any chance of making a setup.py script for py2exe?

    • I have no interest in creating and supporting a windows binary version. People are nervous enough of running open source python scripts. It would be a brave or foolhardy person who ran an unsigned windows binary application from an anonymous (if long standing) blog.

      • That´s exactly why a setup.py script with py2exe target would be nice. No python installation needed. Python is very common in the *nix world, but not among windows users.

  14. $ calibre-debug -g
    calibre 2.32.1 isfrozen: True is64bit: False
    Linux-4.1.2-2-ARCH-i686-with-glibc2.0 Linux (’32bit’, ‘ELF’)
    (‘Linux’, ‘4.1.2-2-ARCH’, ‘#1 SMP PREEMPT Wed Jul 15 08:51:45 UTC 2015′)
    Python 2.7.9
    Linux: (”, ”, ”)
    Successfully initialized third party plugins: DeDRM
    Starting up…
    libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    Started up in 8.31 seconds with 2 books
    Worker Launch took: 0.519397974014
    Job: 1 Convert book 1 of 1 (BookTitle) finished
    Convert book 1 of 1 (BookTitle)
    Resolved conversion options
    calibre version: 2.32.1
    {‘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’/tmp/calibre_2.32.1_tmp_fAqV3S/9H65Q5.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': ,
    ‘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': ,
    ‘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’/tmp/calibre_2.32.1_tmp_fAqV3S/DWvR2S.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,
    ‘unsmarten_punctuation': False,
    ‘unwrap_lines': True,
    ‘use_auto_toc': False,
    ‘verbose': 2}
    InputFormatPlugin: MOBI Input running
    on /tmp/calibre_2.32.1_tmp_fAqV3S/Qm0RZN.azw
    Found KF8 MOBI of type ‘standalone’
    Traceback (most recent call last):
    File “site.py”, line 63, in main
    File “site-packages/calibre/utils/ipc/worker.py”, line 193, in main
    File “site-packages/calibre/gui2/convert/gui_conversion.py”, line 31, in gui_convert_override
    File “site-packages/calibre/gui2/convert/gui_conversion.py”, line 25, in gui_convert
    File “site-packages/calibre/ebooks/conversion/plumber.py”, line 1042, in run
    File “site-packages/calibre/customize/conversion.py”, line 241, in __call__
    File “site-packages/calibre/ebooks/conversion/plugins/mobi_input.py”, line 43, in convert
    File “site-packages/calibre/ebooks/mobi/reader/mobi8.py”, line 81, in __call__
    File “site-packages/calibre/ebooks/mobi/reader/mobi6.py”, line 143, in check_for_drm
    DRMError: BookTitle

    Convert book 1 of 1 (BookTitle)
    Resolved conversion options
    calibre version: 2.32.1
    {‘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’/tmp/calibre_2.32.1_tmp_fAqV3S/9H65Q5.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': ,
    ‘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': ,
    ‘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’/tmp/calibre_2.32.1_tmp_fAqV3S/DWvR2S.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,
    ‘unsmarten_punctuation': False,
    ‘unwrap_lines': True,
    ‘use_auto_toc': False,
    ‘verbose': 2}
    InputFormatPlugin: MOBI Input running
    on /tmp/calibre_2.32.1_tmp_fAqV3S/Qm0RZN.azw
    Found KF8 MOBI of type ‘standalone’
    Traceback (most recent call last):
    File “site.py”, line 63, in main
    File “site-packages/calibre/utils/ipc/worker.py”, line 193, in main
    File “site-packages/calibre/gui2/convert/gui_conversion.py”, line 31, in gui_convert_override
    File “site-packages/calibre/gui2/convert/gui_conversion.py”, line 25, in gui_convert
    File “site-packages/calibre/ebooks/conversion/plumber.py”, line 1042, in run
    File “site-packages/calibre/customize/conversion.py”, line 241, in __call__
    File “site-packages/calibre/ebooks/conversion/plugins/mobi_input.py”, line 43, in convert
    File “site-packages/calibre/ebooks/mobi/reader/mobi8.py”, line 81, in __call__
    File “site-packages/calibre/ebooks/mobi/reader/mobi6.py”, line 143, in check_for_drm
    DRMError: BookTitleFile

  15. I want to remove the DRM of a .azw3 book. I downloaded calibre and the plugin for the DRM removal tool. But when I check to see that it worked by viewing the book in the internal viewer, an error message pops up saying that the book is protected by DRM. Any advice?

  16. Okay so when I try to convert I get the this file is protected by DRM and cannot be converted.
    The debug only says:
    Using Library AlfCrypto DLL/DYLIB/SO
    Searching for kinfoFiles in C:\User\Johnny\AppData\Local
    No K4PC kindle.info/kinf/kinf2011 files have been found.
    No nook Study log files have been found.

      • It seems DRM removal on import is failing but without giving an error, People with the errors, can you convert a book you have had in calibre library for months, can you still convert it to a different type of file.

        David

          • Laura,

            Could you or someone else take a look at the debug script I posted.

            Does it show what I am missing? Maybe a dependency?

            I posted it two days ago immediately after someone asked me to post the import as well as the convert (which gave me the error.)

            David

            • David, you have not posted an import log, which is the only thing that will tell us and you what is going wrong with DRM removal. Once the book is in calibre, it’s too late. DRM removal happens ONLY on import, not on conversion.

  17. Hello Paul and everyone else.

    I’ve done that, Paul, about six times. I’ve also reinstalled calibre twice. I’m using calibre from the calibre web site.

    NOTE: This error happens on Linux. It does not happen on Windows 7.

    # uname -a
    4.1.2-2-ARCH #1 SMP PREEMPT Wed Jul 15 08:51:45 UTC 2015 i686 GNU/Linux

    But you’re right I did not post the errors on import. I don’t think the error is occuring there, I think it is an error that is caused by even conversions of books already in my Calibre Library and books that I have previously converted to other type files.

    But I have done as you asked. I have deleted the book, exited calibre, started calibre again, imported the book which imports as it did before without error, then I tried to convert azw Kindle format to epub at which time I received the error.

    Thanks,

    David

    calibre-debug -g
    calibre 2.32.1 isfrozen: True is64bit: False
    Linux-4.1.2-2-ARCH-i686-with-glibc2.0 Linux (’32bit’, ‘ELF’)
    (‘Linux’, ‘4.1.2-2-ARCH’, ‘#1 SMP PREEMPT Wed Jul 15 08:51:45 UTC 2015′)
    Python 2.7.9
    Linux: (”, ”, ”)
    Starting up…
    libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    Started up in 3.71 seconds with 2 books
    Added BookTitle to db in: 0.6
    Added 1 books in 1.4 seconds
    Worker Launch took: 0.161735057831
    Job: 1 Convert book 1 of 1 (BookTitle) finished
    Convert book 1 of 1 (BookTitle)
    Resolved conversion options
    calibre version: 2.32.1
    {‘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’/tmp/calibre_2.32.1_tmp_ALnG6p/ofsByd.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': ,
    ‘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': ,
    ‘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’/tmp/calibre_2.32.1_tmp_ALnG6p/MhpOob.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,
    ‘unsmarten_punctuation': False,
    ‘unwrap_lines': True,
    ‘use_auto_toc': False,
    ‘verbose': 2}
    InputFormatPlugin: MOBI Input running
    on /tmp/calibre_2.32.1_tmp_ALnG6p/xvQTcq.azw
    Found KF8 MOBI of type ‘standalone’
    Traceback (most recent call last):
    File “site.py”, line 63, in main
    File “site-packages/calibre/utils/ipc/worker.py”, line 193, in main
    File “site-packages/calibre/gui2/convert/gui_conversion.py”, line 31, in gui_convert_override
    File “site-packages/calibre/gui2/convert/gui_conversion.py”, line 25, in gui_convert
    File “site-packages/calibre/ebooks/conversion/plumber.py”, line 1042, in run
    File “site-packages/calibre/customize/conversion.py”, line 241, in __call__
    File “site-packages/calibre/ebooks/conversion/plugins/mobi_input.py”, line 43, in convert
    File “site-packages/calibre/ebooks/mobi/reader/mobi8.py”, line 81, in __call__
    File “site-packages/calibre/ebooks/mobi/reader/mobi6.py”, line 143, in check_for_drm
    DRMError: BookTitle

    Convert book 1 of 1 (BookTitle)
    Resolved conversion options
    calibre version: 2.32.1
    {‘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’/tmp/calibre_2.32.1_tmp_ALnG6p/ofsByd.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': ,
    ‘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': ,
    ‘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’/tmp/calibre_2.32.1_tmp_ALnG6p/MhpOob.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,
    ‘unsmarten_punctuation': False,
    ‘unwrap_lines': True,
    ‘use_auto_toc': False,
    ‘verbose': 2}
    InputFormatPlugin: MOBI Input running
    on /tmp/calibre_2.32.1_tmp_ALnG6p/xvQTcq.azw
    Found KF8 MOBI of type ‘standalone’
    Traceback (most recent call last):
    File “site.py”, line 63, in main
    File “site-packages/calibre/utils/ipc/worker.py”, line 193, in main
    File “site-packages/calibre/gui2/convert/gui_conversion.py”, line 31, in gui_convert_override
    File “site-packages/calibre/gui2/convert/gui_conversion.py”, line 25, in gui_convert
    File “site-packages/calibre/ebooks/conversion/plumber.py”, line 1042, in run
    File “site-packages/calibre/customize/conversion.py”, line 241, in __call__
    File “site-packages/calibre/ebooks/conversion/plugins/mobi_input.py”, line 43, in convert
    File “site-packages/calibre/ebooks/mobi/reader/mobi8.py”, line 81, in __call__
    File “site-packages/calibre/ebooks/mobi/reader/mobi6.py”, line 143, in check_for_drm
    DRMError: BookTitle

  18. Can’t run , I need some help.

    calibre 2.32.1 [64bit] isfrozen: True is64bit: True
    Windows-7-6.1.7601-SP1 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ‘7’, ‘6.1.7601’)
    Python 2.7.9
    Windows: (‘7′, ‘6.1.7601’, ‘SP1′, ‘Multiprocessor Free’)
    Successfully initialized third party plugins: DeDRM
    Traceback (most recent call last):
    File “site-packages\calibre\gui2\actions\view.py”, line 234, in view_triggered
    File “site-packages\calibre\gui2\actions\view.py”, line 310, in _view_books
    File “site-packages\calibre\gui2\actions\view.py”, line 269, in _view_calibre_books
    File “site-packages\calibre\gui2\actions\view.py”, line 103, in view_format_by_id
    File “site-packages\calibre\gui2\actions\view.py”, line 152, in _view_file
    File “site-packages\calibre\gui2\actions\view.py”, line 142, in _launch_viewer
    File “site-packages\calibre\gui2\__init__.py”, line 1141, in open_local_file
    WindowsError: [Error 1155] N�o h� aplicativos associados ao arquivo especificado para esta opera��o: u’C:\\Users\\SAMARA MORAIS\\Nova pasta\\Unknown\\Guerra Irregular-epub (6)\\Guerra Irregular-epub – Unknown.acsm’

    No supported formats (Available formats: acsm)

    • You need to open the .acsm file with Adobe Digital Editions (authorized with your Adobe ID and on the same PC/user as calbre). Then it will download the epub file to the My Digital Editions folder inside the Documents folder. Import the epub into calibre.

  19. Where do I find the error log for import?

    Here is what I get when I import, isn’t this the same thing?

    $ calibre-debug -g
    calibre 2.32.1 isfrozen: True is64bit: False
    Linux-4.1.2-2-ARCH-i686-with-glibc2.0 Linux (’32bit’, ‘ELF’)
    (‘Linux’, ‘4.1.2-2-ARCH’, ‘#1 SMP PREEMPT Wed Jul 15 08:51:45 UTC 2015′)
    Python 2.7.9
    Linux: (”, ”, ”)
    Starting up…
    libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    Started up in 4.36 seconds with 1 books
    Added My Book to db in: 0.4
    Added 1 books in 1.2 seconds

      • The real problem is that I did not have Kindle for PC installed under WINE.

        I haven’t used the program for so long, I forgot calibre DRM Plug in gets a key from that installation. Duh.

        Thanks,

        David

  20. I am trying to backup a nook magazine. It seems to be different than the others and I can’t download it with Nook for PC or Nook Study (I get “This title is currently not available for download for this application (download:2138)”).

    It downloads fine to my rooted nook tablet (model after nook color) using the preinstalled B&N library apps and digging a bit I found the epub at /data/media/Barnesandnoble/Magazine at least all the other magainzes are there as well. But When I copy out the file and dump it into calibre it only shows the cover, nothing else. Very odd as normally if you get the epub you are good to go. Anyone else run into this?

  21. Received the following message when trying to load tools v6.2.2 on Calibre 2.32.1 64 Bit, Win7 Pro.

    calibre, version 2.32.1
    ERROR: Unhandled exception: InvalidPlugin:The plugin in u’C:/Users/Alberto/Downloads/Calibre/tools_v6.2.2.zip’ is invalid. It does not contain a top-level __init__.py file

    calibre 2.32.1 [64bit] isfrozen: True is64bit: True
    Windows-7-6.1.7601-SP1 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ‘7’, ‘6.1.7601’)
    Python 2.7.9
    Windows: (‘7′, ‘6.1.7601’, ‘SP1′, ‘Multiprocessor Free’)
    Traceback (most recent call last):
    File “site-packages\calibre\gui2\preferences\plugins.py”, line 316, in add_plugin
    File “site-packages\calibre\customize\ui.py”, line 388, in add_plugin
    File “site-packages\calibre\customize\ui.py”, line 53, in load_plugin
    File “site-packages\calibre\customize\zipplugin.py”, line 188, in load
    File “site-packages\calibre\customize\zipplugin.py”, line 286, in _locate_code
    InvalidPlugin: The plugin in u’C:/Users/Alberto/Downloads/Calibre/tools_v6.2.2.zip’ is invalid. It does not contain a top-level __init__.py file

  22. Thank you very much, gave me the freedom to read this eBook (that I paid for no less, I’m not used to buying eBooks or even the idea of paying for one) on any platform.

  23. Sure Paul

    DeDRM v6.1.0: In __init__
    DeDRM v6.1.0: In load_resources
    DeDRM v6.1.0: verdir C:\Users\dob\AppData\Roaming\calibre\plugins\DeDR
    M\6.1.0
    DeDRM v6.1.0: In initialize
    DeDRM v6.1.0: Trying to decrypt 2940041060893_drp.v1.epub
    DeDRM v6.1.0: Verifying zip archive integrity
    DeDRM v6.1.0: “2940041060893_drp.v1.epub” is neither an Adobe Adept
    nor a Barnes & Noble encrypted ePub
    DeDRM v6.1.0: Successfully decrypted book after 10.8 seco
    Added Writer’s Digest September 2015 to db in: 6.28699994087 seconds
    Worker Launch took: 0.296999931335

    • Okay I did a bit more digging and it would appear that this only images viewed with a DRP app instead of the usual book reader (I had a feeling since the interface was different but wasn’t sure. I found the images to the book in /data/books/nameofmagazineinquestion. In that folder (which you need root to view) is all the images to the book. So it is in two pieces, the epub and the images themselves. Rather odd method to not even have the images in the book file? I also didn’t like how you can’t zoom in enough in the DRP app. You could zoom but not enough for my tastes. They advertise “high resolution” but I got a pdf (also no DRM) direct from the publisher’s website and that has much better resolution and I can zoom in further. Very odd B&N couldn’t do better.

      Anyway thanks for looking at this.

      • I’m glad you got a solution. The ePub didn’t contain the required drm files (which is why it wasn’t recognised as Adobe or B&N DRMed). Sometimes B&N seems to do this with books and store the required files separately in a database. Very strange.

  24. I am on Linux Mint 17.1. I have installed Kindle 4 PC through wine and it is working fine. Upon importing DRM ebooks I get the following output:
    calibre 2.30 isfrozen: True is64bit: True
    Linux-3.13.0-48-generic-x86_64-with-debian-jessie-sid Linux (’64bit’, ‘ELF’)
    (‘Linux’, ‘3.13.0-48-generic’, ‘#80-Ubuntu SMP Thu Mar 12 11:16:15 UTC 2015′)
    Python 2.7.9
    Linux: (‘debian’, ‘jessie/sid’, ”)
    Successfully initialized third party plugins: DeDRM && Goodreads
    Starting up…
    libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    Started up in 3.85 seconds with 8018 books
    DeDRM v6.2.2: Trying to decrypt B008BTC5E6_EBOK.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 8, header length 256
    Extra Data Flags: 3
    Decrypting Kindle Format 8 ebook: Eat and Run: My Unlikely Journey to Ultramarathon Greatness
    Found 2 keys to try after 0.0 seconds
    Crypto Type is: 2
    DeDRM v6.2.2: Failed to decrypt with error: No key found in 2 keys tried.
    DeDRM v6.2.2: Looking for new default Kindle Key after 0.0 seconds
    DeDRM v6.2.2: Running kindlekey.py under Wine
    DeDRM v6.2.2: Command line: “wine python.exe “/home/saurabh/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py” “/home/saurabh/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir””
    wine: cannot find L”C:\\windows\\system32\\python.exe”
    DeDRM v6.2.2: Found and decrypted 0 key files
    DeDRM v6.2.2: Ultimately failed to decrypt after 0.1 seconds.
    Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
    Running file type plugin 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.dedrm.__init__”, line 579, in run
    File “calibre_plugins.dedrm.__init__”, line 530, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.2.2: Ultimately failed to decrypt after 0.1 seconds
    Added Eat and Run: My Unlikely Journey to Ultramarathon Greatness to db in: 2.9
    Added 1 books in 3.7 seconds

    Please tell me how I can get this plugin working.
    Thank you.

    • Hi … It sounds as though you did as instructed and ‘followed the defaults’ when installing Python. This is now a wrong instruction. Python MUST be installed to ”C:\\windows\\system32\\python.exe” The new default puts it in the wrong path. When this happened to me, I had to completely purge Wine and re-intstall from scratch in order to get the Python installer to allow me to input a path. Also, I had to use the version of Python from Python org. The recommended alternative wouldn’t install to the right path. Sorry.

      • If you would be willing to write some ‘fool proof’ instructions for installing Kindle for PC under wine, I’d like to include them in the next release of the tools.

        • I will be happy to write some instructions for Linux. It will need to wait a while though. At the moment, Wine was broken in Ubuntu 15.04, and won’t yet install at all under 15.10 testing. The problem seems to be caused by porting to the latest complier (GCC) set. The current version of Linux Mint seems OK, and I gather the problem is now fixed in Debian (which I am not now using). I’m expecting the problem to be properly fixed soon – but as some 5,000 packages need to be re-built and tested … we may need to wait a bit longer. Currently, I’m running Mint and Ubuntu 15.10, but don’t currently have a copy of Wine running at all. My own use of the Calibre plugin is now for Adobe epub books only. I’ve dropped Kindle books, although I can still download for my wife’s Kindle, and use her serial number. When I get Wine in operation under Ubuntu, I’ll re-do the installation and write down the details. The indication is always “wine: cannot find L”C:\\windows\\system32\\python.exe” and python will instead be found in C:\\windows\\python* – maybe someone could add this path to the search script in the plugin? (Not me – my coding is not up to that). The new path seems to be to allow different python versions to co-exist in Windows. A workaround may be found by setting an environment variable to the default python path. I imagine that’s what Windows is doing. When I am next able to use Wine, I’ll follow the defaults, and see if I can get an environment variable to do anything – it depends on whether the script in the plugin would respond to that, or if it is hard-coded to the system32 path. As it seems to work in Windows, it must be finding python OK – so I’ll try.

          • Good news – Ubuntu 15.10 (Alpha testing) now runs Wine properly. I installed everything I need, then installed the Calibre plugin. It nearly worked ‘out of the box’ BUT – it fails to copy the necessary python files to the path: ~/.config/calibre/plugins/DeDrm/libraryfiles/ These files are: adobekey.py kindlekey.py libalfcrypto32.so libalfcrypto64.so subasyncio.py I have had this problem in the past, and I know it was reported. It doesn’t seem to have been fixed. The plugin does create the path, but doesn’t copy the files over. The earlier problem with the Python path (in Wine) has now been fixed.

        • A bit of further research. I have Windows 7 on a removable hard drive that plugs into my main computer. I fired it up – knowing that Windows would disable the machine for hours doing upgrades I didn’t want – but I got the answer I wanted. Python 2.7 currently installs to Windows path C:\Python27\ (equivalent to Wine path C:\\windows\\Python27\\python.exe). This path is added to the front of the Windows ‘Path’ environment variable by the Python installer. So far, it has failed to do this within Wine. When Wine works again, I’ll have a go and see what’s actually need to make it work there. If things haven’t changed, it may simply be a case of editing the path variable within Wine.

            • It will work in the current version of Linux Mint. Wine is an older build, and is OK. The Python installer also correctly adds the Python path to the Windows environment, so it works there out of the box. I’m hoping that by the October release date, the Ubuntu Wine team have sorted Wine and I can do tests there. If it follows what currently happens in Mint, ‘following the defaults’ is still the right course. Yesterday, I re-installed everything under Wine in Mint, and followed the readme exactly. No problem. I tested with a drm’d epub downloaded to ADE running under Wine and it worked just fine.

              • I am on Linux Mint 17.1 and I have installed everything as default from the software channel. But it didn’t really work for me. Can you look at the output I have posted above and make some recommendations? Should I completely remove wine and reinstall it?

                • No. You can alter the Windows ‘path’ in the Windows environment (under Wine) to add the Python path (C://Python27// ?) or you can completely uninstall Python under Wine and re-install just that. Check the Windows path (Wine cmd) and do ‘set’ to see all the environment variables including ‘path’. When installing Python, you can get the option to install it to a particular path. The default worked for me, but you could tell it to put it in the system32 directory if you want. Barry.

  25. Thanks for the tool to strip the drm from my azw books for calibre.
    The only problem I have is that it worked on about half of my books and the others just say locked by drm.
    It converted Treasure Island but not The Art of War
    There is no further output related to the ones that stay locked.
    I have tried conversion of these to several formats, but none work

  26. Please help with the following debug output:

    calibre-debug -g
    calibre 2.5 isfrozen: False is64bit: False
    Linux-3.16.0-4-686-pae-i686-with-debian-8.0 Linux (’32bit’, ‘ELF’)
    (‘Linux’, ‘3.16.0-4-686-pae’, ‘#1 SMP Debian 3.16.7-ckt9-2 (2015-04-13)’)
    Python 2.7.9
    Linux: (‘debian’, ‘8.0’, ”)
    Successfully initialized third party plugins: DeDRM
    Starting up…
    Unable to open ~/.mtpz-data for reading, MTPZ disabled.
    Started up in 2.78 seconds with 1 books
    Worker Launch took: 0.241147994995
    QXcbWindow: Unhandled client message: “_GTK_LOAD_ICONTHEMES”
    QXcbWindow: Unhandled client message: “_GTK_LOAD_ICONTHEMES”
    Job: 1 Read metadata (0 of 1) finished
    Read metadata (0 of 1)
    DeDRM v6.2.2: Trying to decrypt B00X06QDYS_EBOK.azw
    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: 50 Human Studies, in Utero, Conducted in Modern China, Indicate Extreme Risk for Prenatal Ultrasound: A New Bibliography
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.2.2: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.2.2: Looking for new default Kindle Key after 0.1 seconds
    DeDRM v6.2.2: Running kindlekey.py under Wine
    DeDRM v6.2.2: Command line: “wine python.exe “/home/bonky/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py” “/home/bonky/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir””
    kindlekey.py v1.9
    Copyright © 2010-2013 some_updates and Apprentice Alf
    searching for kinfoFiles in C:\users\bonky\Local Settings\Application Data
    Found K4PC 1.9+ kinf2011 file: C:\users\bonky\Local Settings\Application Data\Amazon\Kindle\storage\.kinf2011
    Decrypted key file using IDString ‘0’ and UserName ‘626f6e6b79′
    Saved a key to Z:\home\bonky\.config\calibre\plugins\DeDRM\libraryfiles\winekeysdir\kindlekey1.k4i
    DeDRM v6.2.2: Found and decrypted 1 key file
    DeDRM v6.2.2: Found 1 new key
    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: 50 Human Studies, in Utero, Conducted in Modern China, Indicate Extreme Risk for Prenatal Ultrasound: A New Bibliography
    Found 4 keys to try after 1.6 seconds
    Crypto Type is: 2
    DeDRM v6.2.2: Ultimately failed to decrypt after 1.6 seconds.
    Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “/usr/lib/calibre/calibre/customize/ui.py”, line 154, in _run_filetype_plugins
    nfp = plugin.run(path_to_file)
    File “calibre_plugins.dedrm.__init__”, line 579, in run
    File “calibre_plugins.dedrm.__init__”, line 530, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.2.2: Ultimately failed to decrypt after 1.6 seconds

    Added 50 Human Studies, in Utero, Conducted in Modern China, Indicate Extreme Risk for Prenatal Ultrasound: A New Bibliography to db in: 2.59515404701 seconds
    Worker Launch took: 0.151390075684
    InputFormatPlugin: MOBI Input running
    on /home/bonky/Calibre Library/Jim West/50 Human Studies, in Utero, Conducted in Modern China, Indicate Extreme Risk for Prenatal Ultras (7)/50 Human Studies, in Utero, Conducted in M – Jim West.azw
    Found KF8 MOBI of type ‘standalone’
    QXcbWindow: Unhandled client message: “_GTK_LOAD_ICONTHEMES”
    Traceback (most recent call last):
    File “/usr/lib/calibre/calibre/gui2/ui.py”, line 952, in closeEvent
    self.shutdown(write_settings=False)
    File “/usr/lib/calibre/calibre/gui2/ui.py”, line 896, in shutdown
    self.update_checker.terminate()
    AttributeError: ‘Main’ object has no attribute ‘update_checker’

    • Well, you have your wine set up correctly to get the key, and it does so successfully. It just doesn’t work with this book. Could this be because you didn’t download this book with that copy of Kindle for PC under wine? Kindle decryption keys are individual per device – so books downloaded for any other device won’t get decrypted.

      • I think you’ve nailed it. I accidentally set up the kindle package under Root, then I manually copied the downloaded text to my user directory. I’m working on removing all of the kindle accounts from amazon, then creating a new one under the user, instead of root, then I’ll try decoding it. I’ll comment again if I hit another snag. Thanks for making note of the user dependent key function.

        • I got it to work!!! Thank you again Paul!! That was outrageously aggravating and time wasting! You made my evening!

  27. Just a heads up that the DeDRM_App_ReadMe.txt (for Windows) section about installing Python on Windows does not include a notice not to download Python for Windows 64 bit, even if the computer is running 64 bit windows. I followed the instructions exactly, but had no luck accessing the .bat file. Only after much googling, I discovered that I needed the Win 32 version and of course it works as advertised.

    And thanks for providing us with these fabulous tools!

  28. Thanks very much guys for this tool that gives us control of the e-books that we paid for. Your sharing your time, knowledge, skills and support is truly appreciated.

    I am using DeDRM 6.21 and so far, I do not own any books from B&N (I have not purchased any as yet). Is it imperative that I install 6.22 anyway?

    • No, you don’t need to update. But if you ever do get some B&N ebooks, don’t forget to update (& read the readme) before importing the ebooks.

    • As apprenticeharper said make sure you get the latest tool set before trying to do anything with Nook books. I ended up buying a commercial product back at the beginning of June because we couldn’t get DeDRM 6.21 to work with 3 books I had bought from B&N. I now have version 6.22 and just to check I bought a book from B&N on Monday – 6.22 worked just fine.

  29. Could someone tell me where to find the Calibre import log(s) for Mac OS 10.7.5? I know I should be able to extract stuff from Console but it logs everything in Mac OS X!

      • OK. A couple of follow-up questions:
        1. Does Calibre have to be running while I run that command (I’m assuming yes but want to make certain).
        2. How far back does that command show results? Just the current session?

        • 1. No, in fact it must not be running, since that command launches calibre.
          2. It gives no history at all. Use it to run calibre and then import a book to get a log of that import.

          • Well, I just tried it and that command did not work:

            Last login: Fri Jul 24 06:49:11 on console
            [Dennis-B-Swaneys-Intel-iMac:~] dbswaney% calibre-debug -g
            calibre-debug: Command not found.

            • Then I guess you haven’t got the command-line tools installed. Which is odd, as calibre has installed them by default on Mac for some time now. Somewhere in the preferences (I’m guessing in some advanced or miscellaneous option – I can’t check since my calibre no longer has it) there’ll be an option to install the calibre command-line tools. The FAQs here are probably old enough that they give details. Or perhaps you can find the info at the calibre site.

              • Well looking at the package contents they are there. There is also an option under the Preferences Menu in Calibre to restart in debug mode or you can use Cmd-Shift-R. I’ll have to try that next time.

                • Of course the command-line Mac OS X tools are in the calibre package. The question is whether they’ve been installed on your system. No, just restarting calibre in debug mode isn’t going to help, as you won’t have anywhere for the log to be displayed.

                  Don’t make life hard for yourself. Just read the FAQs and the ReadMes and do what they say.

                  • Dennis,

                    The confusion perhaps arises on the fact that calibre-debug will not run unless you know where it is ;-)
                    See, http://manual.calibre-ebook.com/cli/cli-index.html.
                    So, in terminal (where “$” is your prompt), try
                    $ cd /Applications/calibre.app/Contents/MacOS/calibre
                    $ ls
                    $ ./calibre-debug -g

                    the “ls” will list the programs in that directory (you should see calibre-debug listed), and the “.” before the command will ensure that the shell knows where to find calibre-debug

                    • Thanks, Marc but it turns out my path is a little different: /Applications/calibre.app/Contents/console.app/Contents/MacOS/ and there isn’t a calibre-debug -g command; only a calibre-debug one. Please see my more detailed reply to Paul with DTG July 26, 2015 at 5:02 pm

                  • Hi, Paul

                    First, I have read your FAQs, but I did not see anything about the command-line Calibre for Mac OS X
                    Next, I went to the Calibre User Manual 2.12.0 and found this: “Note: On OS X, the command line tools are inside the calibre bundle, for ex- ample, if you installed calibre in /Applications the command line tools are in
                    /Applications/calibre.app/Contents/console.app/Contents/MacOS/.” I checked that path and found these tools there:

                    calibre
                    calibre-complete
                    calibre-customize
                    calibre-debug
                    calibre-parallel
                    calibre-parallel-placeholder-for-codesigning
                    calibre-server
                    calibre-smtp
                    calibredb
                    ebook-convert
                    ebook-device
                    ebook-edit
                    ebook-meta
                    ebook-polish
                    ebook-viewer
                    fetch-ebook-metadata
                    lrf2lrs
                    lrfviewer
                    lrs2lrf
                    markdown-calibre
                    web2disk

                    Clicking on the calibre-debug tool launched terminal and gave me this:

                    Last login: Sun Jul 26 09:55:29 on ttys001
                    [Dennis-B-Swaneys-Intel-iMac:~] dbswaney% /Applications/Calibre/calibre\ 2.32.app/Contents/MacOS/calibre-debug ; exit;
                    Welcome to the interactive calibre shell!

                    >>>

                    So it looks like the entire path needs to be used in Terminal (at least in Mac OS 10.7.5) rather than just the command line plus the ” -g” needs to be added to “calibre-debug” before entering Terminal. When I copied the line ” /Applications/Calibre/calibre\ 2.32.app/Contents/MacOS/calibre-debug ” added the ” -g” and THEN pasted the whole /Applications/Calibre/calibre\ 2.32.app/Contents/MacOS/calibre-debug -g into Terminal, when I hit “return”, the Calibre app launched.

                    • well, a couple of points….
                      1. You installed calibre into a custom directory, so yes, you would need to cd in to that directory.
                      2. the application is calibre-debug. -g is a flag
                      3. once you cd in to the directory in which the application lives, you don’t need to state the entire path in your command, just the ./calibre-debug -g that I explained above

                      so…. for your custom case…. from terminal (remember, the “$” is just an OS prompt)

                      $cd /Applications/Calibre/calibre\ 2.32.app/Contents/MacOS
                      $ ./calibre-debug -g

                      OSX is unix; so running

                      $./calibre-debug –help

                      will print out the explanation of the usage of calibre-debug (including its flags)

                    • No, Mark, Calibre is installed in the default ~/Applications folder (directory) not in a custom one. This whole thing is moot anyway as I will probably never use Terminal.

                    • ohhhhh – wordpress makes an em out of two dashes
                      you can do calibre-debug -h (with one dash) or calibre-debug –help (that is TWO dashes)

  30. Seems to be some trouble…..

    $ ./calibre-debug -g
    calibre 2.33 isfrozen: True is64bit: True
    Darwin-14.4.0-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘14.4.0’, ‘Darwin Kernel Version 14.4.0: Thu May 28 11:35:04 PDT 2015; root:xnu-2782.30.5~1/RELEASE_X86_64′)
    Python 2.7.9
    OSX: (‘10.10.4′, (”, ”, ”), ‘x86_64′)
    Successfully initialized third party plugins: DeDRM
    Starting up…
    libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    Started up in 2.29 seconds with 1543 books
    DeDRM v6.2.2: Trying to decrypt B00B6FBS6I_EBOK.azw4
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 4, header length 248
    Decrypting Mobipocket 4 ebook: yyyyyyyyyyyyy
    Found 4 keys to try after 0.3 seconds
    Crypto Type is: 2
    DeDRM v6.2.2: Failed to decrypt with error: Cannot decode library or rented ebooks.
    DeDRM v6.2.2: Looking for new default Kindle Key after 0.3 seconds
    Found k4Mac kinf2011 file: /Users/xxxx/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2011
    Decrypted key file using IDString ‘XXXXXXXXXXXXXX’ and UserName ‘xxxx’
    DeDRM v6.2.2: Found 1 new key
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 4, header length 248
    Decrypting Mobipocket 4 ebook: yyyyyyyyyyyy
    Found 4 keys to try after 0.9 seconds
    Crypto Type is: 2
    DeDRM v6.2.2: Ultimately failed to decrypt after 0.9 seconds.
    Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
    Running file type plugin 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.dedrm.__init__”, line 579, in run
    File “calibre_plugins.dedrm.__init__”, line 530, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.2.2: Ultimately failed to decrypt after 0.9 seconds
    Added yyyyyyyyyyy to db in: 0.6
    Added 1 books in 2.4 seconds

    any ideas?

    • The problem is shown in the line:

      DeDRM v6.2.2: Failed to decrypt with error: Cannot decode library or rented ebooks.

      This is only an error if the book you’re trying to remove the DRM from is not a rented or library book.

      • I saw that but when I tested library books distributed via amazon it worked fine, so thought it might have more to do with the azw4 format though I was under the impression that your kindle-unpack plugin didn’t care whether the book was rental/library and was rolled into the current 6.2.2 plugin. Frankly, I don’t want to recommend that folk pop $300 for a textbook if they are limited to using it via Kindle app or device….. (pricey experiment…)

        • I’ve never been able to test with library books, so I can only go from what the error message said.

          KindleUnpack is a completely separate plugin to the DeDRM plugin. And it’s a great exaggeration to call it mine. Kevin (on the main code) and Doug (on the plugin part) have done far more work on it than me. Although IIRC, the azw4 PDF extraction was mine originally.

          If you can remove DRM from other books, a bought textbook should work as well. $300! Wow.

          • Overdrive books in azw3 format served up by Amazon deDRM just fine, so the question becomes whether it is an intentional aspect of the plugin (i. e. borking at DRM text indicating that the azw4 is a rental or library book) or a generic failure with azw4. Do you have any experience with purchased azw4 textbooks that have decrypted?

            On the other hand, as their are manual ways in which to address pdf DRM, will the kindle-unpack plugin unpack a rented text, for example, and if so, will the resulting pdf be with or without DRM (i.e. is the DRM applied to the azw4 file, or to the pdf file around which it is wrapped?

            Yes, the ebook versions of these texts (freshman Math and Science texts) often sell for the same price as the hard cover ($240-$290), and you can’t print anything out of the ebook version unless you do a screen shot — and of course the ebook is offered only in pdf because we are still married to 15th century technology ;-)

  31. I have an Adobe Digital Editions book that will not decrypt with the plugin.
    Here is the log from debug mode:

    calibre 2.33 [64bit] isfrozen: True is64bit: True
    Windows-7-6.1.7601-SP1 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ‘7’, ‘6.1.7601’)
    Python 2.7.9
    Windows: (‘7′, ‘6.1.7601’, ‘SP1′, ‘Multiprocessor Free’)
    Successfully initialized third party plugins: DeDRM && KindleUnpack – The Plugin && EpubSplit && EpubMerge
    Starting up…
    macmenuhack file_path:C:\Users\User\AppData\Roaming\calibre\plugins\fanficfare_macmenuhack.txt
    Started up in 2.32 seconds with 29 books
    DeDRM v6.2.2: Trying to decrypt Clinical Pharmacists Guide to Biostatistics and Literature Evalu.epub
    DeDRM v6.2.2: Verifying zip archive integrity
    DeDRM v6.2.2: “Clinical Pharmacists Guide to Biostatistics and Literature Evalu.epub” is neither an Adobe Adept nor a Barnes & Noble encrypted ePub
    Added Clinical Pharmacist’s Guide to Biostatistics and Literature Evaluation, Second Edition to db in: 0.2
    Added 1 books in 2.5 seconds

    The encryption.xml file from the epub looks like it should be Adobe Adept:

    urn:uuid:**deleted for posting**

    • I wrote the code that detects encryption type that the Apprentices used. Let me check. OK, as well as an encryption.xml, there also needs to be a rights.xml, containing and encryptedKey XML member that’s 186 characters long.

      • The key in the rights.xml is jvrYqu3SlSatPTv6Kwsx90Fsk2TiVLAEi5i7cH142HuT+u095CqyKdA0OFbZC8p+malNUiMTNbKVGJ/Tz5O0A5Z9kEluhbb1q4/NfmHRPwfwAYYd7isWGH4ycBRx9dhi7IdEwYZRl5uRfXpPecjtLD11CjgnkrtGm5a1ckoT0yJr14eAUl14Mz9nB+qv2wzb

        • That’s interesting. I wonder if that is, at long last, the new Adobe DRM scheme? I’ve never seen an Adobe ePub with that many characters in the encryptedKey secion – only 186 not 192. Can you read that ePub in Adobe Digital Editions 2.x?

              • ADE 2.0 gives the following error
                “Error getting License. License Server Communication Problem:
                E_ADEPT_CORE_DECRYPT_LICENSE_KEY”

                • Where did you buy the book? I only use ADE 2.x, so I wouldn’t get the new drm, but I want to know what store to avoid.

                  • I was getting the same error with Google books. I had an earlier version of 2.0. I downloaded a newer version 2.0.1.78765 from the Adobe website & I don’t have the error anymore.

                    • I thought the Google problem was a different error, but that’s a good point. Using 2.0.1.78765 did solve a problem.

                • That sounds like you might have encountered the new encryption scheme, in which case the current tools can’t help you. If it becomes widespread, I hope that some clever person will reverse engineer it and release a new tool.

  32. I have installed your DeDRM_plugin.zip on Calibre on linux.
    Then I have downloaded a book from the kindle app for windows and imported the .azw file in calibre. When I try to convert it I get an error. At the description of the problem I get is:

    …calibre, version 1.25.0 (linux2, isfrozen: False)

    File “/usr/lib/calibre/calibre/ebooks/mobi/reader/mobi6.py”, line 75, in __init__
    raise TopazError(_(‘This is an Amazon Topaz book. It cannot be processed.’))
    calibre.ebooks.mobi.reader.mobi6.TopazError: Questo è un libro Amazon Topaz. Non può essere elaborato.

    Can you help me?
    Many thanks.

    • DRM removal happens on import, not conversion. An import log will give more information, but see the other comments here about problems with some current Linux versions.

  33. I have just purchased my first Kindle Paperwhite; installed Calibre and Tools, I followed your instructions to the letter and tried to convert an epub book (Jeffrey Archer) downloaded to PC from local library via Bolinda, no luck, I received a message “cannot convert, locked by DRM)
    i am using Wndows 7, is the DRM not able to be bypassed on some publications.
    The program has worked OK so far on unprotected epub publications.

    • As far as I have read the FAQ and this Blog, books from the library cannot be DeDRMed with the tools, the log should say so.

  34. Thank you for that, I saw this quote in FAQ;
    “The DRM only gets removed when the ebook is imported into calibre. If the book is already in calibre, you must delete the book from calibre and import the ebook again. It is not enough to just import the book again: calibre will discard the newly imported DRM-free version as a duplicate, leaving only the original DRMed version” I
    I removed the book from Calibre, imported again and all is well..
    When all else fails read the instructions!!!

  35. I have an ebook in azw format bought by my friend who shared it with me through an email
    I downloaded calibre and the DeDRM plugin and K4PC and restarted all three a Gazillion times.
    I can never get rid of the DRM. Below is the code. Kindly help:

    Successfully initialized third party plugins: DeDRM
    Starting up…
    Started up in 8.99 seconds with 5 books
    DeDRM v6.2.2: Trying to decrypt The Method Method.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 8, header length 256
    Extra Data Flags: 3
    Decrypting Kindle Format 8 ebook: The Method Method: Seven Obsessions That Helpe
    d Our Scrappy Start-up Turn an Industry Upside Down
    Found 4 keys to try after 0.3 seconds
    Crypto Type is: 2
    DeDRM v6.2.2: Failed to decrypt with error: No key found in 4 keys tried.
    DeDRM v6.2.2: Looking for new default Kindle Key after 0.3 seconds
    searching for kinfoFiles in C:\Users\u657796\AppData\Local
    Found K4PC 1.9+ kinf2011 file: C:\Users\u657796\AppData\Local\Amazon\Kindle\stor
    age\.kinf2011
    Decrypted key file using IDString ‘3389151817’ and UserName ‘55363537373936’
    DeDRM v6.2.2: Found 1 new key
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 8, header length 256
    Extra Data Flags: 3
    Decrypting Kindle Format 8 ebook: The Method Method: Seven Obsessions That Helpe
    d Our Scrappy Start-up Turn an Industry Upside Down
    Found 4 keys to try after 0.6 seconds
    Crypto Type is: 2
    DeDRM v6.2.2: Ultimately failed to decrypt after 0.6 seconds.
    Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 155, in _run_filetype_plugi
    ns
    File “calibre_plugins.dedrm.__init__”, line 579, in run
    File “calibre_plugins.dedrm.__init__”, line 530, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.2.2: Ultimately failed to decrypt after 0.6 seconds
    Added The Method Method: Seven Obsessions That Helped Our Scrappy Start-up Turn
    an Industry Upside Down to db in: 3.4
    Added 1 books in 7.7 seconds

    • From the post you’re commenting on: “Please only use this application for gaining full access to your own ebooks for archiving/converson/convenience.”

      This isn’t your ebook. The tools won’t work on it.

  36. Calibre plugin didn’t remove the DRM, but had success with the standalone windows/python version. This rocks, I’m now not restricted to any one device. Thank you for your hard work!

  37. Microsoft Windows [Version 6.3.9600]
    (c) 2013 Microsoft Corporation. All rights reserved.

    C:\Users\sachlani>calibre-debug -g
    calibre 2.33 [64bit] isfrozen: 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
    Starting up…
    Started up in 2.62 seconds with 2 books
    DeDRM v6.2.2: Trying to decrypt MyDRMbook.pdf
    DeDRM v6.2.2: MyDRMbook.pdf is a PDF ebook
    DeDRM v6.2.2: Looking for new default Adobe Digital Editions Keys after 0.1 seco
    nds
    Found 1 keys
    DeDRM v6.2.2: Trying a new default key
    Error serializing pdf MyDRMbook.pdf. Probably wrong key.
    DeDRM v6.2.2: Failed to decrypt with new default key after 0.4 seconds
    DeDRM v6.2.2: Ultimately failed to decrypt after 0.4 seconds.
    Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 155, in _run_filetype_plugi
    ns
    File “calibre_plugins.dedrm.__init__”, line 586, in run
    File “calibre_plugins.dedrm.__init__”, line 467, in PDFDecrypt
    DeDRMError: DeDRM v6.2.2: Ultimately failed to decrypt after 0.4 seconds.
    Syntax Error: Couldn’t find the ‘EBX_HANDLER’ security handler
    pdfinfo errored out with return code: 1
    Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 349, in get_file_type_metad
    ata
    File “site-packages\calibre\customize\builtins.py”, line 326, in get_metadata
    File “site-packages\calibre\ebooks\metadata\pdf.py”, line 101, in get_metadata

    ValueError: Could not read info dict from PDF
    Added MyDRMbook to db in: 0.1
    Added 1 books in 1.6 seconds
    Exception TypeError: “‘NoneType’ object is not callable” in <bound method Native
    Function.__del__ of > ignored
    Exception TypeError: “‘NoneType’ object is not callable” in <bound method Native
    Function.__del__ of > ignored

      • Yes. It is a backup copy of the file and I rename it. I got a problem to read it after I de-authorized previously without Adobe ID to change authorization using Adobe ID. The file can not be opened with error said ““The vendor account you entered is not associated with the ite, you are trying to open. Try again.” Hope you can help. Thank you.

        • The tools can’t help. Since you downloaded it with a copy of ADE that wasn’t authorised with an Adobe ID, it was tied to that particular installation of ADE. As you no longer have that installation, the book is now unreadable by anything. Your best bet is to explain this to the company you bought it from, and they might reset things to allow you to download it again using your now Adobe ID-authorised copy of ADE. But since this does cost them money, you’ll need to be persuasive.

  38. All praise be to Alf! Finally managed to purchase a B+N ebook from within Europe (not so easy) and with Alf’s wonderful plugin, I now have it on my Voyage and ‘Bath’ Kindle. Top work.

  39. Hi Alf, thanks for the nice tool and helpful site!

    Quite recently I have recurring problems with ADE pdf’s. They reside in my local ADE directory and I try importing them into calibre via the “add book” button, have tried dragging w/ mouse, but it doesn’t make any difference. Here’s the log

    ———————-
    Windows: (‘XP’, ‘5.1.2600’, ‘SP3′, ‘Multiprocessor Free’)
    Successfully initialized third party plugins: DeDRM && Barnes & Noble && Fiction
    DB
    Starting up…
    Failed to load recipe from: u’Unknown News Source_1000.recipe’
    Traceback (most recent call last):
    File “site-packages\calibre\web\feeds\recipes\collection.py”, line 110, in get
    _custom_recipe_collection
    IOError: [Errno 2] No such file or directory: u’C:\\Dokumente und Einstellungen\
    \SHS\\Anwendungsdaten\\calibre\\custom_recipes\\Unknown News Source_1000.recipe’

    Started up in 4.14 seconds with 580 books
    Worker Launch took: 0.594000101089
    Job: 1 Read metadata (0 of 1) finished
    Read metadata (0 of 1)
    DeDRM v6.2.2: Trying to decrypt MERIAN_06_2015.pdf
    DeDRM v6.2.2: MERIAN_06_2015.pdf is a PDF ebook
    DeDRM v6.2.2: Trying Encryption key calibre-adeptkey
    DeDRM v6.2.2: Successfully decrypted book after 19.7 seconds

    Added Unknown to db in: 3.59399986267 seconds
    E:\Regal\Calibre\pylib.zip\dateutil\parser.py:339: UnicodeWarning: Unicode equal
    comparison failed to convert both arguments to Unicode – interpreting them as b
    eing unequal
    ————————–

    The book is added, but has no metadata and no cover plus I get an error which I copy below:

    ————
    calibre, version 2.0.0
    WARNING: Failed to read metadata: Failed to read metadata from the following:

    MERIAN_06_2015.pdf
    Traceback (most recent call last):
    File “site-packages\calibre\ebooks\metadata\worker.py”, line 68, in do_read_metadata
    File “shutil.py”, line 82, in copyfile
    IOError: [Errno 13] Permission denied: u’D:\\Temp\\calibre_rphtal\\egbw6b.pdf’
    ——————

    I am not aware that I have changed anything in my ADE installation — it’s still version 1.7.2 — nor calibre, apart from updating your tool. I had this problem before though and thought a fresh version might be useful w/ that. Thanks for reading, Hendrik

      • I cannot, as it would require updating Windows from the XP I am still using (we don’t want to go into that, do we). Also, an epub-file also coming in via ADE is dedrm’d just as it should. If calibre was the culprit, why should the problem only exist for pdf’s?

        • Because the import routine for the metadataof PDFs is not the same as the import routine for the metadata of PDFs.

          It *is* possible that it’s a problem with the plugin. But in that case it’s in the low-level PDF De-DRMing routine. And I’d also expect it to mess up more than the cover and metadata. If that’s the case, then you’re unlikely to be able to do anything to improve the situation.

          But as I said, it’s far more likely to be a calibre problem. In which case you can probably work around it by re-creating the metadata and importing a cover from elsewhere.

          • (Sorry Paul, your 1st sentence doesn’t make sense. )
            I should have been a little more elaborate in my OP. It isn’t just “The book is added, but has no metadata and no cover”. The file cannot be opended, neither via “path” nor by clicking “pdf” in the right pane. It results in an empty Acrobat window and a tab on my Firefox opening for “http://www.adobe.com/solutions/ebook/digital-editions.html?source=acrofile”. Go figure … So, the book is added, but there is no book, while the import of an epub just a minute earlier works just fine.

          • In the meantime … I went searching for some other options and came across epubee, which publishes plugins per media-type (pdf, epub, kindle etc.). On installing them in calibre I noticed that their credits read very much like Alf’s — stands to reason they have a common source. Anyway, much to my surprise all of the six ADE pdf’s I tried earlier with Alf’s DeDRM in vain, came out quite nicely, thank you. There were some glitches, two didn’t have cover or metadata, but the actual book/ magazine was there alright. I did the 1st in debug mode and the log was the same as the one I posted above. But (!) no error pop-up about “Permission denied: u’D:\\Temp\\calibre_rphtal\\egbw6b.pdf” ladida.

            • How interesting. As far as I know, the epubee stuff uses the exact same scripts. The log you posted showed no errors from the DeDRM. All the errors were from calibre. But if the DRM removal hadn’t worked properly, that’s what you’d expect.

            • I would be interested in getting your original (DRMed) ePub, and a copy of your Adobe Digital Editions key (the .der file, either from the key generation tool, or exported from the plugin). You could attach them to a report on github, or your could email them to me.

              Many thanks for your report.

              Harper.

        • As a sidenote, the calibre website says “calibre 2.x uses Qt 5 which is known to be incompatible with Windows XP machines. If you are using Windows XP please, use calibre 1.48″. I know downgrading would cause problems with the DeDRM plug-in (and undoubtedly others too). But since you’re already using calibre 2.0, maybe an upgrade would work??? Obviously, proceed at your own risk, but it’s just a thought.

          • I agree with Laura. In my case, Calibre for Mac OS X is supposed to only work with Mac OS 10.8 and higher, yet version 2.32 is very happy running on my iMac with Mac OS 10.7. So you may find that a newer version of Calibre will still run on WinXP (which was the apex of Windows in my opinion).

  40. calibre Debug log
    calibre 2.33 [64bit] isfrozen: 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
    Starting up…
    Started up in 40.21 seconds with 2 books
    Worker Launch took: 0.118999958038
    Job: 1 Convert book 1 of 1 (Medical Billing and Coding For Dummies) finished
    Convert book 1 of 1 (Medical Billing and Coding For Dummies)
    Resolved conversion options
    calibre version: 2.33.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’C:\\Users\\Gary\\AppData\\Local\\Temp\\calibre_vteyrw\\8unkku.jpeg’,
    ‘custom_size': None,
    ‘debug_pipeline': None,
    ‘dehyphenate': True,
    ‘delete_blank_paragraphs': True,
    ‘disable_font_rescaling': False,
    ‘duplicate_links_in_toc': False,
    ’embed_all_fonts': False,
    ’embed_font_family': None,
    ‘enable_heuristics': False,
    ‘expand_css': False,
    ‘extra_css': None,
    ‘filter_css': u”,
    ‘fix_indents': True,
    ‘font_size_mapping': None,
    ‘format_scene_breaks': True,
    ‘html_unwrap_factor': 0.4,
    ‘input_encoding': None,
    ‘input_profile': ,
    ‘insert_blank_line': False,
    ‘insert_blank_line_size': 0.5,
    ‘insert_metadata': False,
    ‘isbn': None,
    ‘italicize_common_cases': True,
    ‘keep_ligatures': False,
    ‘language': None,
    ‘level1_toc': None,
    ‘level2_toc': None,
    ‘level3_toc': None,
    ‘line_height': 0.0,
    ‘linearize_tables': False,
    ‘margin_bottom': 5.0,
    ‘margin_left': 5.0,
    ‘margin_right': 5.0,
    ‘margin_top': 5.0,
    ‘markup_chapter_headings': True,
    ‘max_toc_links': 50,
    ‘minimum_line_height': 120.0,
    ‘no_chapters_in_toc': False,
    ‘no_inline_navbars': False,
    ‘old_pdf_engine': False,
    ‘output_profile': ,
    ‘override_profile_size': False,
    ‘page_breaks_before': u”//*[name()=’h1′ or name()=’h2′]”,
    ‘paper_size': u’letter’,
    ‘pdf_add_toc': False,
    ‘pdf_default_font_size': 20,
    ‘pdf_footer_template': None,
    ‘pdf_header_template': None,
    ‘pdf_mark_links': False,
    ‘pdf_mono_family': u’Courier New’,
    ‘pdf_mono_font_size': 16,
    ‘pdf_page_numbers': False,
    ‘pdf_sans_family': u’MS Shell Dlg 2′,
    ‘pdf_serif_family': u’Times New Roman’,
    ‘pdf_standard_font': u’serif’,
    ‘prefer_metadata_cover': False,
    ‘preserve_cover_aspect_ratio': False,
    ‘pretty_print': False,
    ‘pubdate': None,
    ‘publisher': None,
    ‘rating': None,
    ‘read_metadata_from_opf': u’C:\\Users\\Gary\\AppData\\Local\\Temp\\calibre_vteyrw\\hrzbgi.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,
    ‘uncompressed_pdf': False,
    ‘unit': u’inch’,
    ‘unsmarten_punctuation': False,
    ‘unwrap_lines': True,
    ‘use_auto_toc': False,
    ‘verbose': 2}
    InputFormatPlugin: MOBI Input running
    on C:\Users\Gary\AppData\Local\Temp\calibre_vteyrw\ubuynz.azw3
    Found KF8 MOBI of type ‘standalone’
    Python function terminated unexpectedly
    Medical Billing and Coding For Dummies (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 193, in main
    File “site-packages\calibre\gui2\convert\gui_conversion.py”, line 31, in gui_convert_override
    File “site-packages\calibre\gui2\convert\gui_conversion.py”, line 25, in gui_convert
    File “site-packages\calibre\ebooks\conversion\plumber.py”, line 1042, in run
    File “site-packages\calibre\customize\conversion.py”, line 241, in __call__
    File “site-packages\calibre\ebooks\conversion\plugins\mobi_input.py”, line 43, in convert
    File “site-packages\calibre\ebooks\mobi\reader\mobi8.py”, line 81, in __call__
    File “site-packages\calibre\ebooks\mobi\reader\mobi6.py”, line 143, in check_for_drm
    calibre.ebooks.DRMError: Medical Billing and Coding For Dummies

    • DRM removal happens when you add the book to calibre, not during conversion. You’ll need to remove the book, reopen calibre in debug mode, and add the book again for us to see what went wrong.

  41. A note for Linux users of Nook: the Calibre plugin was not working, and even with debugging, it wasn’t clear to me what was going wrong. I did two things, either or both seem to have helped. I ran ignoblekeyfetch.py manually, which seemed to work: it retrieved a 28-byte b64 string. Secondly, I installed Nook Study with Wine and started it up. It would go no further than the login screen, complaining “Failed to retrieve adobe account” (should I have installed some Adobe stuff?) but inspection of the log showed a successful login to B&N. This time, I imported the fetched key and gave my login details to the plugin, opened the book in Calibre, and it worked!
    I’m not sure whether the plugin actually used the imported key or the Nook Study logs (I’m not clear on how it all works) but the above is what worked for me, on the one book I’ve purchased so far.

  42. August 2015. Using windows 7 32 bit, I Installed, as instructed and linked to in the instructions, the latest version of ActivePython (i.e. Active Python 2.7.8). Then tried to install, as instructed and linked to in the instructions, the latest version of Precrypto, (i.e pycrypto-2.6.1.win32-py2.6). However, it complains that it requires Python 2.6, which was not found in the registry (?? I just installed the recommended Python 2.7.X) and I can’t find any ActivePython 2.6 version, it is not available on their site anymore, other than as business version. What’s wrong here? And more importantly, what’s the solution? Kind regards

    • Problem solved. My fault. Rather than selecting the top link (pycrypto-2.6.1.win32-py2.6), there was another version further down the list, i.e. PyCrypto 2.6 for Python 2.7 32bit (as linked to in the instructions)

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