DRM Removal Tools for eBooks

Last updated on 12 August, 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.

DeDRM_tools_6.3.3.zip can be downloaded from
https://github.com/apprenticeharper/DeDRM_tools/releases/tag/v6.3.3

Changes in 6.3.3:

  • A quick bug fix for the plugin when first getting the Kindle for PC/Mac key.

Changes in 6.3.2:

  • Documentation (in the help file) for the Kindle for Android enhancements.
  • Additional translations added to the obok plug-in.

Changes in 6.3.1:

  • Support for getting decryption keys for Kindle for Android files from a backup.ab file.
  • The .pobi Kindle file extension should now be recognized by all tools.
  • Some of the key scripts should now work as stand-alone TkInter script again.
  • Some of the log messages should now be clearer.
  • Minor typo fixes in the documentation.

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.

375 thoughts on “DRM Removal Tools for eBooks

    • Hi! I have attempted to use the DeDRM tool, but it does not appear to be working. I have installed/uninstalled a few times, just to make sure I haven’t screwed up (including a full uninstall of Calibre). Please help! Thank you!

      ==========================
      ==========================
      ==========================

      Microsoft Windows [Version 6.1.7601]
      Copyright (c) 2009 Microsoft Corporation. All rights reserved.

      C:\Users\owner>calibre-debug -g
      calibre 2.34 isfrozen: True is64bit: False
      Windows-7-6.1.7601-SP1 Windows (’32bit’, ‘WindowsPE’)
      32bit process running on 64bit windows
      (‘Windows’, ‘7’, ‘6.1.7601’)
      Python 2.7.9
      Windows: (‘7’, ‘6.1.7601’, ‘SP1’, ‘Multiprocessor Free’)
      Successfully initialized third party plugins: DeDRM
      Starting up…
      Started up in 2.93 seconds with 0 books

      Debugging DND event
      application/x-qt-windows-mime;value=”Shell IDList Array” 286 ‘\x01\x00\x00\x00\x
      0c\x00\x00\x00\xaa\x00\x00\x00\x14\x00\x1fDG\x1a\x03Yr?\xa7D\x89\xc5U\x95\xfek0\
      xee \x00\x00\x00\x1a\x00\xee\xbb\xfe#\x00\x00\x10\x00\xd0\x9a\xd3\xfd\x8f#\xafF\
      xad\xb4l\x85H\x03i\xc7\x00\x00h\x001\x00\x00\x00\x00\x00\x0bGR\x10\x10\x00MYKIND
      ~1\x00\x00P\x00\x08\x00\x04\x00\xef\xbe\nG\xb4\x89\x0bGR\x10*\x00\x00\x00+B\x02\
      x00\x00\x00;\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00M\x00y\x
      00 \x00K\x00i\x00n\x00d\x00l\x00e\x00 \x00C\x00o\x00n\x00t\x00e\x00n\x00t\x00\x0
      0\x00\x18\x00\x00\x00r\x002\x00\x841f\x02\x0bG\x06\x0f B00HQO~1.AZW\x00\x00V\x0
      0\x08\x00\x04\x00\xef\xbe\x0bG\xec\x0e\x0bG\xec\x0e*\x00\x00\x000\x8d\x02\x00\x0
      0\x00\x14\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00B\x000\x000
      \x00H\x00Q\x00O\x000\x005\x00E\x00Y\x00_\x00E\x00B\x00O\x00K\x00.\x00a\x00z\x00w
      \x004\x00\x00\x00\x1c\x00\x00\x00’

      application/x-qt-windows-mime;value=”UsingDefaultDragImage” 4 ‘\x01\x00\x00\x00’

      application/x-qt-windows-mime;value=”DragImageBits” 36896 ‘`\x00\x00\x00`\x00\x0
      0\x000\x00\x00\x00Y\x00\x00\x00@\r\x05\x0e\x00\x00\x00\x00\xff\xff\xff\xff\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00’

      application/x-qt-windows-mime;value=”DragContext” 16 ‘\x00\x00\x00\x00\x01\x00\x
      00\x00\x00\x00\x00\x00\x00\x00\x00\x00’

      application/x-qt-windows-mime;value=”DragSourceHelperFlags” 4 ‘\x01\x00\x00\x00’

      application/x-qt-windows-mime;value=”InShellDragLoop” 4 ‘\x01\x00\x00\x00’

      text/uri-list 77 ‘file:///C:/Users/owner/Documents/My%20Kindle%20Content/B00HQO0
      5EY_EBOK.azw4\r\n’

      application/x-qt-windows-mime;value=”FileName” 46 ‘C:\\Users\\owner\\DOCUME~1\\M
      YKIND~1\\B00HQO~1.AZW\x00’

      application/x-qt-windows-mime;value=”FileNameW” 128 ‘C\x00:\x00\\\x00U\x00s\x00e
      \x00r\x00s\x00\\\x00o\x00w\x00n\x00e\x00r\x00\\\x00D\x00o\x00c\x00u\x00m\x00e\x0
      0n\x00t\x00s\x00\\\x00M\x00y\x00 \x00K\x00i\x00n\x00d\x00l\x00e\x00 \x00C\x00o\x
      00n\x00t\x00e\x00n\x00t\x00\\\x00B\x000\x000\x00H\x00Q\x00O\x000\x005\x00E\x00Y\
      x00_\x00E\x00B\x00O\x00K\x00.\x00a\x00z\x00w\x004\x00\x00\x00’

      Firefox rurl: None None
      URLS: [‘file:///C:/Users/owner/Documents/My%20Kindle%20Content/B00HQO05EY_EBOK.a
      zw4′]
      Paths: [u’C:/Users/owner/Documents/My Kindle Content/B00HQO05EY_EBOK.azw4′]
      Extensions: frozenset([u’azw4’])
      DeDRM v6.3.2: Trying to decrypt B00HQO05EY_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: The Bedford Book of Genres
      Found 0 keys to try after 1.1 seconds
      Crypto Type is: 2
      DeDRM v6.3.2: Failed to decrypt with error: No key found in 0 keys tried.
      DeDRM v6.3.2: Looking for new default Kindle Key after 1.1 seconds
      searching for kinfoFiles in C:\Users\owner\AppData\Local
      Found K4PC 1.9+ kinf2011 file: C:\Users\owner\AppData\Local\Amazon\Kindle\storag
      e\.kinf2011
      Decrypted key file using IDString ‘2564380972’ and UserName ‘6f776e6572’
      DeDRM v6.3.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: The Bedford Book of Genres
      DeDRM v6.3.2: Ultimately failed to decrypt after 1.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 588, in run
      File “calibre_plugins.dedrm.__init__”, line 538, in KindleMobiDecrypt
      DeDRMError: DeDRM v6.3.2: Ultimately failed to decrypt after 1.4 seconds
      Added The Bedford Book of Genres to db in: 2.4
      Added 1 books in 4.8 seconds

    • Hi All,

      6.3.2 didn’t work for me.

      I used 6.2.2 and this worked.

      The errors reported in 6.3.2 reports issues as below
      File “calibre_plugins.dedrm.__init__”, line 588, in run
      File “calibre_plugins.dedrm.__init__”, line 538, in KindleMobiDecrypt

      When you see these. use 6.2.2

      Found 4 keys to try after 0.4 seconds
      Crypto Type is: 2
      File is encoded with PID **************.
      Decrypting. Please wait . . . . . . . . done
      Decryption succeeded after 0.5 seconds
      DeDRM v6.2.2: Saving 1 new key
      DeDRM v6.2.2: Successfully decrypted book after 0.6 seconds

      • Improvements to the tools or new tools are welcome. I don’t ask for any other contributions. I don’t think Alf does either.

          • You aren’t telling me very much. Different Linux distros work in different ways. The missing files are: adobekey.py kindlekey.py libalfcrypto32.so libalfcrypto64.so subasyncio.py You will have to find them. They need to be put in your ~/.config/calibre/plugins/DeDrm/libraryfiles/ directory.

            • I’m using ubuntu, last release stable.but where can i find these file that you told me?in the plugin folder? Tomorow i’ll try and let you know.thanks from italy.

                • I could have said more. If you want the files that are missing, you unpack the plugin and extract them. But – do a search on this blog page for my contributions in the last two weeks. Wine is currently broken in 15.04 so you won’t be able to do the things you will want to do. There is a problem with Calibre that I’ve described. Look at those before proceeding. I’m sure Ubuntu will fix the problem eventually, but for now, it will cause you problems. You will still need to extract the missing files from the plugin – they don’t install in the new version, or in Linux Mint so far. This is a known bug in the plugin.

    • Hi,
      i’ve tried to remove drm from pdf unsuccesfully with Calibre.
      This is debug info, can you help?

      Microsoft Windows [Versione 6.2.9200]
      (c) 2012 Microsoft Corporation. Tutti i diritti riservati.

      C:\Users\daniele>cd \

      C:\>cd C:\Program Files\Calibre2

      C:\Program Files\Calibre2>calibre-debug -g
      calibre 2.32.1 [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…
      Key u’A’ for shortcut Apri la cartella contenente is already used by Aggiungi li
      bri, ignoring
      Started up in 2.81 seconds with 592 books
      DeDRM v6.3.3: Trying to decrypt Original.pdf
      DeDRM v6.3.3: Original.pdf is a PDF ebook
      DeDRM v6.3.3: Looking for new default Adobe Digital Editions Keys after 0.1 seco
      nds
      Found 1 keys
      DeDRM v6.3.3: Trying a new default key
      Error serializing pdf Original.pdf. Probably wrong key.
      DeDRM v6.3.3: Failed to decrypt with new default key after 0.1 seconds
      DeDRM v6.3.3: 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_plugi
      ns
      File “calibre_plugins.dedrm.__init__”, line 596, in run
      File “calibre_plugins.dedrm.__init__”, line 471, in PDFDecrypt
      DeDRMError: DeDRM v6.3.3: Ultimately failed to decrypt after 0.1 seconds.
      Traceback (most recent call last):
      File “site-packages\calibre\utils\ipc\simple_worker.py”, line 274, in main
      File “site-packages\calibre\ebooks\metadata\pdf.py”, line 33, in read_info
      WindowsError: [Error 5] Accesso negato: u’C:\\Users\\daniele\\AppData\\Local\\Te
      mp\\calibre_djtkok\\whqovp_pdf_metadata_read’

      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 94, in get_metadata
      RuntimeError: Failed to run pdfinfo
      Added Original to db in: 0.1
      Added 1 books in 1.0 seconds
      Exception TypeError: “‘NoneType’ object is not callable” in <bound method Native
      Function.__del__ of > ignored

    • Hi Alf
      I am trying to get 6.3.2 and i get this error on loading the plugin

      calibre, version 2.35.0
      ERROR: Unhandled exception: InvalidPlugin:The plugin in u’C:/Users/Davenew/Downloads/DeDRM_tools_6.3.3.zip’ is invalid. It does not contain a top-level __init__.py file

      calibre 2.35 [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/Davenew/Downloads/DeDRM_tools_6.3.3.zip’ is invalid. It does not contain a top-level __init__.py file

    • Hello,

      Thank you for this useful tool.
      I’ve tried to use as described in the the help file, but I got an error message. I’m pasting it below.
      Kindly let me know what I’m doing wrong. Thank you for your help.

      libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
      calibre Debug log
      calibre 2.35 isfrozen: True is64bit: True
      Darwin-12.6.0-x86_64-i386-64bit Darwin (’64bit’, ”)
      (‘Darwin’, ‘12.6.0’, ‘Darwin Kernel Version 12.6.0: Wed Mar 18 16:23:48 PDT 2015; root:xnu-2050.48.19~1/RELEASE_X86_64’)
      Python 2.7.9
      OSX: (‘10.8.5’, (”, ”, ”), ‘x86_64’)
      Successfully initialized third party plugins: DeDRM
      Starting up…
      DeDRM v6.3.3: Trying to decrypt Heart.epub
      DeDRM v6.3.3: Verifying zip archive integrity
      DeDRM v6.3.3: “Heart.epub” is neither an Adobe Adept nor a Barnes & Noble encrypted ePub
      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 600, in run
      File “calibre_plugins.dedrm.__init__”, line 376, in ePubDecrypt
      DeDRMError: DeDRM v6.3.3: Couldn’t decrypt after 0.1 seconds. DRM free perhaps?
      Started up in 16.37 seconds with 35 books
      Added Heart to db in: 0.2
      Added 1 books in 0.9 seconds
      libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
      InputFormatPlugin: EPUB Input running
      on /Volumes/iMac TMBackups/yleibu/Calibre Library/Dick Cheney/Heart (88)/Heart – Dick Cheney.epub

      Ygal Leibu

      • Find the DeDRM.log file that’s in your home directory and post the contents here. Tell us what kind of book you’re trying to dedrm, and where you bought it, and how you downloaded it.

    • I am a new user for Ubuntu. I installed Calibre and then dried to install the DeDRM zip plug in file. I followed the steps and clicked on the zip file. I get this error message: u’tom/downloads/de_DRM_tools_6.3.3.zip’ is invalid. It does not contain a top-level_init_.py file What do I need to get this to work?

      • I was reading the other comments and found one with the same error message. Thanks to your response the that question, I now have an answer to my problem. THANKS for your program and advice.

    • Thanks for your work! Can i ask one thing? I tried on ubuntu linux but doesn’t work:
      DeDRM v6.0.8: Trying to decrypt Accabadora.epub
      DeDRM v6.0.8: Verifying zip archive integrity
      DeDRM v6.0.8: Accabadora.epub is a secure Adobe Adept ePub
      DeDRM v6.0.8: Looking for new default Adobe Digital Editions Keys after 0.1 seconds
      DeDRM v6.0.8: Running adobekey.py under Wine
      DeDRM v6.0.8: Command line: “wine python.exe “/home/pelotudo/.config/calibre/plugins/DeDRM/libraryfiles/adobekey.py” “/home/pelotudo/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir””
      wine: cannot find L”C:\\windows\\system32\\python.exe”
      DeDRM v6.0.8: Found and decrypted 0 key files
      Traceback (most recent call last):
      File “calibre_plugins.dedrm.__init__”, line 226, in ePubDecrypt
      IndexError: list index out of range
      DeDRM v6.0.8: Ultimately failed to decrypt after 0.5 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 482, in run
      File “calibre_plugins.dedrm.__init__”, line 268, in ePubDecrypt
      DeDRMError: DeDRM v6.0.8: Ultimately failed to decrypt “Accabadora.epub” after 0.5 seconds.
      Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
      Added Accabadora to db in: 0.5
      Added 1 books in 10.2 seconds

      how can i resolve this?

      ThankS!

    • Dear Alf,
      I come from China, really thanks for your work so I can keep and store my ebook in my computer.
      Acctually, we have a new software called “suning reading”. We can get ebooks from it with really cheap price. The format of the books is “sue”, but I think it’s real type is epub. So can you help me to dedrm that? I really want to read the book on my kindle.(we can read them only on cellphone right now) The website of the software is http://app.suning.com/android/app/page?pack=com.suning.mobile.subook
      Please check.
      Thank you very much!
      Frank

    • How long does de-drming take? I’ve been trying to convert/de-drm a book for over an hour now, and calibre still says the job is 1% complete. If this is not normal, what can I do to troubleshoot?

      • DRM removal happens on import, not during conversion. Try opening the book with calibre’s viewer to see if it’s DRM-free. If so, then you can ask over at calibre’s MobileRead forum about conversion problems. If not, then post an import log, and we’ll take a look.

    • Today I installed a new Kindle for Mac-Version (ok, my mistake), Version 1.12.0 (40961).
      This asked me for my login, although it should have found the old config, well, I logged in, and it told me for most of my books, it could not open them, to delete them and download them new.
      After I did that, I tried to DeDRM them, the Standalone tool could not find the new key (6.3.2). On downloading the tools new, I saw this:
      “A quick bug fix for the plugin when first getting the Kindle for PC/Mac key.”. Well, the Calibre plugin works with the changed new key and newly downloaded books, the Standalone Tool for Mac does not.
      Please check, wether the bug in the plugin in 6.3.2 which was fixed in 6.3.3 exists in the Standalone tool 6.3.3 (and earlier), I hope then it is fixed easily.
      I tried with a new user, new downloads of Kindle for Mac, DeDRM, Calibre and a new download of a few ebooks, result is the same:
      for the new Kindle Key on my Mac the Calibre Plugin 6.3.3 works, the Standalone tool does not.

      Fun fact: of 888 books which I re-downloaded 238 where DRM free, just about 25% (these where identified with the DeDRM standalone tool).

      • Also, I tried, deleting the old key, I am not sure that worked in the Standalone DeDRM for Mac, it always displayed in the config dialog:
        “Current Kindle for Mac key files:
        Local Kindle Key.k4i”, even after I deleted it with the “Forget All” Tool-Dialogue. Add the key with the Add… -> K4i file does not work, as the current file is named differently, “.kinf2011” and is not shown selection of the Tool.

        • When you delete all the keys, it automatically goes and gets the current Kindle for Mac key again.

          If, after doing that, the standalone still isn’t working for you, I suspect the plugin isn’t either. You really need to check the log files.

          • I used the same book, here are both logs. Standalone has a few Kindle eInk Keys,

            Fail: Standalone DeDRM.Log
            There is 1 ebook to be decrypted.
            Processing file: B007W3HE84_EBOK.azw
            shellcommand: /usr/local/bin/python ‘/Applications/DeDRM_tools_6.3.3/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py’ -k ‘/Users/ingolembcke/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i’ -s ‘B0130907442200XU,B0111608231403TV,B024150325130E17,B0D42204348404B4’ ‘/Users/ingolembcke/Documents/My Kindle Content/B007W3HE84_EBOK.azw’ ‘/Users/ingolembcke/Documents/My Kindle Content/xKindleNoDRM/’ > ‘/Users/ingolembcke/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
            shellresult: Using Library AlfCrypto DLL/DYLIB/SO
            K4MobiDeDrm v5.3.
            Copyright © 2008-2013 The Dark Reverser et al.
            MobiDeDrm v0.41.
            Copyright © 2008-2012 The Dark Reverser et al.
            MOBI header version 7, header length 232
            Extra Data Flags: 2
            Decrypting Mobipocket 7 ebook: Unforgivable (Part One)
            Found 12 keys to try after 0.0 seconds
            Crypto Type is: 2
            Error decrypting book after 0.0 seconds: No key found in 12 keys tried.
            Traceback (most recent call last):
            File “/Applications/DeDRM_tools_6.3.3/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py”, line 248, in decryptBook
            book = GetDecryptedBook(infile, kDatabases, androidFiles, serials, pids, starttime)
            File “/Applications/DeDRM_tools_6.3.3/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py”, line 222, in GetDecryptedBook
            mb.processBook(totalpids)
            File “/Applications/DeDRM_tools_6.3.3/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 12 keys tried.
            There was an error with 1 ebook:
            B007W3HE84_EBOK.azw couldn’t be decrypted.

            Success: Calibre -g
            There is 1 ebook to be decrypted.
            Processing file: B007W3HE84_EBOK.azw
            shellcommand: /usr/local/bin/python ‘/Applications/DeDRM_tools_6.3.3/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py’ -k ‘/Users/ingolembcke/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i’ -s ‘B0130907442200XU,B0111608231403TV,B024150325130E17,B0D42204348404B4’ ‘/Users/ingolembcke/Documents/My Kindle Content/B007W3HE84_EBOK.azw’ ‘/Users/ingolembcke/Documents/My Kindle Content/xKindleNoDRM/’ > ‘/Users/ingolembcke/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
            shellresult: Using Library AlfCrypto DLL/DYLIB/SO
            K4MobiDeDrm v5.3.
            Copyright © 2008-2013 The Dark Reverser et al.
            MobiDeDrm v0.41.
            Copyright © 2008-2012 The Dark Reverser et al.
            MOBI header version 7, header length 232
            Extra Data Flags: 2
            Decrypting Mobipocket 7 ebook: Unforgivable (Part One)
            Found 12 keys to try after 0.0 seconds
            Crypto Type is: 2
            Error decrypting book after 0.0 seconds: No key found in 12 keys tried.
            Traceback (most recent call last):
            File “/Applications/DeDRM_tools_6.3.3/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py”, line 248, in decryptBook
            book = GetDecryptedBook(infile, kDatabases, androidFiles, serials, pids, starttime)
            File “/Applications/DeDRM_tools_6.3.3/DeDRM_Macintosh_Application/DeDRM.app/Contents/Resources/k4mobidedrm.py”, line 222, in GetDecryptedBook
            mb.processBook(totalpids)
            File “/Applications/DeDRM_tools_6.3.3/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 12 keys tried.
            There was an error with 1 ebook:
            B007W3HE84_EBOK.azw couldn’t be decrypted.

            calibre, version 2.36.0
            Fehlerdiagnosemodus: Sie haben Calibre im Fehlerdiagnosemodus gestartet. Beim Verlassen des Programms wird ein Fehlerdiagnoseprotokoll erstellt: /var/folders/tj/mzc8qbxd0fggz3v8qf1cts9r0000gn/T/tmpkCAIKl.txtDas Protokoll wird automatisch angezeigt.

            2015-08-30 22:45:17.490 calibre-debug[8412:47780] ApplePersistence=YES
            libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
            calibre Fehlerdiagnoseprotokoll
            calibre 2.36 isfrozen: True is64bit: True
            Darwin-14.5.0-x86_64-i386-64bit Darwin (’64bit’, ”)
            (‘Darwin’, ‘14.5.0’, ‘Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64’)
            Python 2.7.9
            OSX: (‘10.10.5’, (”, ”, ”), ‘x86_64’)
            Successfully initialized third party plugins: DeDRM && Goodreads Sync && Goodreads && KindleUnpack – The Plugin
            Starting up…
            2015-08-30 22:46:01.632 calibre-debug[8412:47780] Unable to simultaneously satisfy constraints:
            (
            “”,
            “”,
            “”,
            “”,
            “”,
            “”,
            “”
            )

            Will attempt to recover by breaking constraint

            Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens. And/or, break on objc_exception_throw to catch this in the debugger.
            2015-08-30 22:46:01.633 calibre-debug[8412:47780] Unable to simultaneously satisfy constraints:
            (
            “”,
            “”,
            “”,
            “”,
            “”
            )

            Will attempt to recover by breaking constraint

            Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens. And/or, break on objc_exception_throw to catch this in the debugger.
            2015-08-30 22:46:56.951 calibre-debug[8412:47780] Layout still needs update after calling -[FI_TListScrollView layout]. FI_TListScrollView or one of its superclasses may have overridden -layout without calling super. Or, something may have dirtied layout in the middle of updating it. Both are programming errors in Cocoa Autolayout. The former is pretty likely to arise if some pre-Cocoa Autolayout class had a method called layout, but it should be fixed.
            2015-08-30 22:50:47.356 calibre-debug[8412:47780] Unable to simultaneously satisfy constraints:
            (
            “”,
            “”,
            “”,
            “”,
            “”
            )

            Will attempt to recover by breaking constraint

            Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens. And/or, break on objc_exception_throw to catch this in the debugger.
            DeDRM v6.3.3: Trying to decrypt B007W3HE84_EBOK.azw
            Using Library AlfCrypto DLL/DYLIB/SO
            MobiDeDrm v0.41.
            Copyright © 2008-2012 The Dark Reverser et al.
            MOBI header version 7, header length 232
            Extra Data Flags: 2
            Decrypting Mobipocket 7 ebook: Unforgivable (Part One)
            Found 20 keys to try after 0.3 seconds
            Crypto Type is: 2
            File is encoded with PID qwN8Sw89Q8.
            Decrypting. Please wait . . . done
            Decryption succeeded after 0.3 seconds
            DeDRM v6.3.3: Finished after 0.3 seconds
            Started up in 40.99 seconds with 155 books
            Added Unforgivable (Part One) to db in: 0.1
            Added 1 books in 1.2 seconds
            libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
            2015-08-30 22:52:28.520 calibre-parallel[8802:52830] ApplePersistence=YES
            InputFormatPlugin: MOBI Input running
            on /Users/ingolembcke/Documents/My Kindle Content/Calibre DeDRM/James Fuller/Unforgivable (Part One) (302)/Unforgivable (Part One) – James Fuller.mobi
            Worker Launch took: 0.164346933365

            And after import in Calibre I was able to open it (as you see by the last entries in the Calibre Log).
            I will gladly provide more logs, or change something, if you can tell me what – as said before, I tried it with a different user, new downloads and a clean install of Kindle for Mac, Calibre, DeDRM 6.3.3 with the same result:
            DeDRM Standlone does not find the (right) Key from Kindle for Mac, DeDRM Plugin for Calibre finds it and it works.

            What makes me wonder is the line in the failed log says 12 keys found, none works, but in the Calibre output from the Plugin it says 20 keys found – and one of them works. So there you have one difference between the Standalone and the Plugin.

            • Clearly the standalone isn’t trying all the keys that the plugin has found. The trick will be to find the difference. The python scripts the two tools use are identical, so it’s something in how they’re being called.

              In my experience, the tools generate 4 keys from a Kindle for Mac key file and 2 keys from each serial number. So 12 keys for 1 key file and 4 serial numbers is right.

              So clearly you must have more things entered for the plugin. You could try to see what they are, and you could also compare the contents of the local key file that the stand-alone is using with the one(s) that the plugin are using.

              • Ok, I was able to find a solution, and to compare the keys, I exported the k4i-Files (3 in my normal installation) from the Calibre DeDRM plugin and imported them in the Standalone DeDRM, which now works, then I switched Users and tested everything with the clean install.
                In hindsight, I should have used the logs from that test.

                DeDRM there has two Keys in dedrm.json, while the Standalone DRM for Mac only had one k4i-file. The Key in the file Local Kindle Key.k4i is the same one as the SECOND one, named “default_key_2” in the dedrm.json -file. I exported that one and imported it in the Standalone, and it works there now.
                On my normal User (my work User), before the export/import I did not touch the configuration for both DeDRM for a long time (last time I entered a serial number of a Kindle eInk Device).

                Still begs for me (!) the question, why the Plugin for Calibre finds the Key by itself, and DeDRM standalone does not?!
                As far as I remember, it did work the last time I installed Kindle for Mac and had to login with my account, but that was with Mac OS X 10.6, so quite long ago, I may be wrong.
                Well, ok, if you do not consider this a bug, I can live with it, no further answer necessary.

                Thanks for the help and the great work on the whole package.

                  • Tried it again, Standalone DeDRM for Mac, Configure – Kindle for Mac EBooks – “Forget All”, it shows “Local Kindle Kindle Key.k4i”, then I click “close” – “finished” – “quit” and try a few books with DRM – no, this k4i does not work, but where does it find it?

                    Importing the exported 3 k4i-Files from the Plugin and testing after each one and then using “Forget All” I can safely say, the only Key, that is working on the newest downloaded books with the new Kindle for Mac (Version 1.12.0), is in the file “default_key_3.k4i”, if that helps.

                    Also, just to be sure, this behavior is the same on the clean, new User Install of the whole shebang (Calibre, Kindle, DeDRM, Plugin for Calibre installed, Standalone for Mac installed, Kindle-program logged into my Amazon-Account). Unless i export the K4i from the plugin, and import it in DeDRM Standalone, it will not work.

                    • Please post the Mac DeDRM log when doing a Forget All, and a log of the plugin when clicking the add button for Kindle for Mac. They should be calling the exact same code, so I don’t understand at the moment how the Mac DeDRM could possibly pick up an older version of the key.

                      Harper.

                    • OK, sure. To get shorter and cleaner logs, I used the “Clean Install”, a different user logged in with Mac OS X, but I tested with my normal account and the results where the still the same.

                      DeDRM-Standalone_01-Sep-2015_15h19.log
                      shellcommand: /usr/local/bin/python ‘/Users/kaischnobel/Applications/DeDRM.app/Contents/Resources/adobekey.py’ ‘/Users/kaischnobel/Library/Preferences/com.apprenticealf.dedrm/Local Adept Key.der’ > ‘/Users/kaischnobel/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/kaischnobel/Applications/DeDRM.app/Contents/Resources/adobekey.py”, line 602, in
                      sys.exit(cli_main())
                      File “/Users/kaischnobel/Applications/DeDRM.app/Contents/Resources/adobekey.py”, line 525, in cli_main
                      keys = adeptkeys()
                      File “/Users/kaischnobel/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/local/bin/python ‘/Users/kaischnobel/Applications/DeDRM.app/Contents/Resources/ignoblekey.py’ ‘/Users/kaischnobel/Library/Preferences/com.apprenticealf.dedrm/Nook Study Key.b64’ > ‘/Users/kaischnobel/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/local/bin/python ‘/Users/kaischnobel/Applications/DeDRM.app/Contents/Resources/kindlekey.py’ ‘/Users/kaischnobel/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i’ > ‘/Users/kaischnobel/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
                      shellresult: kindlekey.py v1.9
                      Copyright © 2010-2013 some_updates and Apprentice Alf
                      Found k4Mac kinf2011 file: /Users/kaischnobel/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2011
                      Found k4Mac kinf2011 file: /Users/kaischnobel/Library/Application Support/Kindle/storage/.kinf2011
                      Decrypted key file using IDString ‘b57814624fda’ and UserName ‘kaischnobel’
                      Decrypted key file using IDString ‘b57814624fda’ and UserName ‘kaischnobel’
                      Saved a key to /Users/kaischnobel/Library/Preferences/com.apprenticealf.dedrm/Local Kindle Key.k4i

                      Calibre-DeDRM-Plugin_01-Sep-2015_15h24
                      calibre, version 2.36.0
                      Fehlerdiagnosemodus: Sie haben Calibre im Fehlerdiagnosemodus gestartet.
                      Beim Verlassen des Programms wird ein Fehlerdiagnoseprotokoll erstellt:
                      /var/folders/70/_kmkczwd66v33vvb9vfdvrxw0000h1/T/tmplpYqpm.txtDas Protokoll wird automatisch angezeigt.

                      calibre, version 2.36.0
                      DeDRM 6.3.3: Duplicate Kindle for Mac and PC Key: The new Kindle for Mac and PC Key is the same as the existing Kindle for Mac and PC Key named default_key_2 and has not been added.

                      libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
                      calibre Fehlerdiagnoseprotokoll
                      calibre 2.36 isfrozen: True is64bit: True
                      Darwin-14.5.0-x86_64-i386-64bit Darwin (’64bit’, ”)
                      (‘Darwin’, ‘14.5.0’, ‘Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64’)
                      Python 2.7.9
                      OSX: (‘10.10.5’, (”, ”, ”), ‘x86_64’)
                      Successfully initialized third party plugins: DeDRM
                      Starting up…
                      Started up in 18.35 seconds with 61 books
                      Found k4Mac kinf2011 file: /Users/kaischnobel/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2011
                      Found k4Mac kinf2011 file: /Users/kaischnobel/Library/Application Support/Kindle/storage/.kinf2011
                      Decrypted key file using IDString ‘b57814624fda’ and UserName ‘kaischnobel’
                      Decrypted key file using IDString ‘b57814624fda’ and UserName ‘kaischnobel’

                      To be sure that was still the same with Standalone DeDRM and still working with the Calibre Plugin, I used the books I downloaded yesterday, DeDRM Standalone could not decrypt them, while the Calibre Plugin could. I could import the k4i-file into standalone to get it working again.
                      And, to be sure, no other settings where used from anywhere else, I tried to DeCrypt a few books copied directly from my Kindles (Paperwhite 1, Voyage). As I did not enter the serial numbers of the Kindles into the Plugin (nor the Standalone), they could not be decrypted by both, as expected (both are working and Decrypting at my real User).

                      I hope I did nothing to confuse matters too much, and that the info points in the right direction.
                      Compared the logs till my eyes crossed and I do not see it. Sorry.

                      Another Log, I deleted both Keys in the Calibre Plugin, started in Debug-Mode and imported a book known to have DRM.
                      libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
                      calibre Fehlerdiagnoseprotokoll
                      calibre 2.36 isfrozen: True is64bit: True
                      Darwin-14.5.0-x86_64-i386-64bit Darwin (’64bit’, ”)
                      (‘Darwin’, ‘14.5.0’, ‘Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64’)
                      Python 2.7.9
                      OSX: (‘10.10.5’, (”, ”, ”), ‘x86_64’)
                      Successfully initialized third party plugins: DeDRM
                      Starting up…
                      DeDRM v6.3.3: Trying to decrypt B00ITVYYKE_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: How to Build a Girl
                      Found 4 keys to try after 0.0 seconds
                      Crypto Type is: 2
                      DeDRM v6.3.3: Failed to decrypt with error: No key found in 4 keys tried.
                      DeDRM v6.3.3: Looking for new default Kindle Key after 0.0 seconds
                      Found k4Mac kinf2011 file: /Users/kaischnobel/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2011
                      Found k4Mac kinf2011 file: /Users/kaischnobel/Library/Application Support/Kindle/storage/.kinf2011
                      Decrypted key file using IDString ‘b57814624fda’ and UserName ‘kaischnobel’
                      Decrypted key file using IDString ‘b57814624fda’ and UserName ‘kaischnobel’
                      DeDRM v6.3.3: 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: How to Build a Girl
                      Found 4 keys to try after 0.5 seconds
                      Crypto Type is: 2
                      File is encoded with PID 2f/vojrKSC.
                      Decrypting. Please wait . . . . done
                      Decryption succeeded after 0.5 seconds
                      DeDRM v6.3.3: Saving 1 new key
                      DeDRM v6.3.3: Finished after 0.5 seconds
                      Started up in 4.67 seconds with 60 books
                      Found k4Mac kinf2011 file: /Users/kaischnobel/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2011
                      Found k4Mac kinf2011 file: /Users/kaischnobel/Library/Application Support/Kindle/storage/.kinf2011
                      Decrypted key file using IDString ‘b57814624fda’ and UserName ‘kaischnobel’
                      Decrypted key file using IDString ‘b57814624fda’ and UserName ‘kaischnobel’
                      Added How to Build a Girl to db in: 0.1
                      Added 1 books in 1.2 seconds

                      Last try for today, I need to do something different. Good luck and do not dig too long, I still have a workaround (exporting the k4i-files and importing).

                    • Thank you very much. I suspect the problem is that there seem to be two .kinf2011 files on the system. The plugin code is clever enough to extract and try keys from both files. The Mac stand-alone just takes one of the files.

                      I have been thinking about updating the Mac standalone to handle multiple keys better for some time – both for Kindle for Mac and ADE. Thank you for showing that this is a real-world problem and not just an abstract ‘nice to have’. It’s pushed it further up my to do list.

    • Hi! Thank you for your wonderful tools! I have tried version 6.3.3. on Windows7 for Kindle for PC books (drag-and-dropped from My Kindle Books folder), and it works perfectly for most books, but in some cases (generally for 1 of 6-7 books) gives error “Could not open ebook. Invalid continuation byte” (these books do open in kindle.exe program, but not in Calibre, and they were all bought at Amazon Kindle). Here is a log:

      calibre Debug log
      calibre 0.8.60
      Windows-7-6.1.7601-SP1
      Windows
      (‘Windows’, ‘7’, ‘6.1.7601’)
      Python 2.7.3
      Windows: (‘7’, ‘6.1.7601’, ‘SP1’, ‘Multiprocessor Free’)
      Starting up…
      ======= MobileRead Parse Error =======
      Traceback (most recent call last):
      File “site-packages\calibre\gui2\dialogs\plugin_updater.py”, line 77, in read_available_plugins
      File “site-packages\calibre\gui2\dialogs\plugin_updater.py”, line 225, in __init__
      ValueError: month must be in 1..12
      Author Book CountUI plugin to create a count of the total number of books for each author.
      Version: 2.0.2; Released: 2014-09-05; Calibre: 1.48.0; Author: DaltonST; History: Yes;
      Platforms: Windows, OSX, Linux;

      ======= MobileRead Parse Error =======
      Traceback (most recent call last):
      File “site-packages\calibre\gui2\dialogs\plugin_updater.py”, line 77, in read_available_plugins
      File “site-packages\calibre\gui2\dialogs\plugin_updater.py”, line 225, in __init__
      ValueError: month must be in 1..12
      Clean MetadataPlugin to perform various cleanups on the metadata in your calibre library
      Version: 0.0.6; Released: 2014-11-22; Calibre: 2.0.0; Author: WS64; History: Yes;
      Platforms: Windows, OSX, Linux

      ======= MobileRead Parse Error =======
      Traceback (most recent call last):
      File “site-packages\calibre\gui2\dialogs\plugin_updater.py”, line 77, in read_available_plugins
      File “site-packages\calibre\gui2\dialogs\plugin_updater.py”, line 225, in __init__
      ValueError: month must be in 1..12
      MultiColumnSearchUI plugin to Search Across Multiple Columns Interactively, Collectively and Simultaneously.
      Version: 1.0.0; Released: 2015-06-13; Calibre: 2.30.0; Author: DaltonST; History: Yes;
      Platforms: Windows, OSX, Linux;

      ======= MobileRead Parse Error =======
      Traceback (most recent call last):
      File “site-packages\calibre\gui2\dialogs\plugin_updater.py”, line 77, in read_available_plugins
      File “site-packages\calibre\gui2\dialogs\plugin_updater.py”, line 225, in __init__
      ValueError: month must be in 1..12
      OPML ImporterUI plugin to create recipes for RSS feeds from an OPML file from feedly or google reader.
      Version: 1.0.0; Released: 23-03-2014; Calibre: 1.0.0; Author: fem; History: Yes;
      Platforms: Windows, OSX, Linux; Donate: PayPal

      ======= MobileRead Parse Error =======
      Traceback (most recent call last):
      File “site-packages\calibre\gui2\dialogs\plugin_updater.py”, line 77, in read_available_plugins
      File “site-packages\calibre\gui2\dialogs\plugin_updater.py”, line 225, in __init__
      ValueError: month must be in 1..12
      ADLIBRIS_NOMetadata Source plugin that reads book metadata and covers from Adlibris.com for Norwegian books (to supplement or replace the Calibre supplied plugins like Amazon & Google).
      Version: 0.0.6 (beta); Released: 18-01-2014; Calibre: 2.5; Author: Pr. BarnArt; History: Yes;
      Platforms: Windows, OSX, Linux; Donate: PayPal

      Started up in 6.03 seconds with 107 books
      Worker Launch took: 0.241999864578
      Job: 1 Read metadata (0 of 1) finished
      Read metadata (0 of 1)
      DeDRM v6.0.5: Trying to decrypt B00JGWFE90_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: Baldr’s Magic: The Power of Norse Shamanism and Ecstatic Trance
      Found 4 keys to try after 0.3 seconds
      Crypto Type is: 2
      File is encoded with PID OKTIMIi3JK.
      Decrypting. Please wait . . . . done
      Decryption succeeded after 0.3 seconds
      DeDRM v6.0.5: Successfully decrypted book after 0.3 seconds

      Added Baldr’s Magic: The Power of Norse Shamanism and Ecstatic Trance to db in: 0.579999923706 seconds

      • You seem to have DeDRM 6.0.5 installed, not 6.3.3, and the decryption of the book worked perfectly.

        You also seem to be using a very old version of calibre, which is almost certainly why it’s having problems with some of your Kindle ebooks. Since you’re running Windows 7, there’s no reason for you not to update to the latest calibre which will probably solve your problems.

  1. @Johan

    The only way that I’ve ever heard of removing Apple’s DRM is through use of Requiem and the appropriate version of iTunes. You should still be able to find them for download, but I don’t know whether Apple still allows the old iTunes to work. I expect it does.

  2. Hmm, maybe I’m missing a help/txt-file somewhere, but I can’t seem to understand how to use it on Android. Can someone nice please describe the steps, or point me to where I can find more information? TIA :)

    • After you’ve installed the plugin –
      From Calibre’s main screen click preferences
      Under Advanced click Plugins
      Expand File Type Plugins, highlight DeDRM (6.3.2) and click Customize Plugin
      Click Kindle for Android ebooks
      Click Plugin Help which will open a browser window with instructions.

      The instructions seem rather complicated; I haven’t tried them yet.

  3. SFBC now sells eBooks that can be read on the Readwell app.

    It seems that SFBC members are to purchase eBooks from SFBC and then are to Log in to Readwell’s web site and using their SFBC.com credentials (email and password) will then have access to any eBook that they’ve purchased on SFBC.

    So my question is, does tools version 6.3.2 have support for Readwell eBooks?

  4. On OSX 11.10.4

    I follow instructions:
    From the Preferences menu, do NOT select “Get plugins to enhance calibre” as this is reserved for ‘official’ calibre plugins. Instead select “Change calibre behavior” to go to Calibre’s Preferences page. Under “Advanced” click on the Plugins button. Use the “Load plugin from file” button to select the plugin’s zip file (DeDRM_plugin.zip) and click the “Add” button.

    Then I get:
    calibre, version 2.34.0
    ERROR: Unhandled exception: InvalidPlugin:The plugin in u’/Users/nickquin/Downloads/DeDRM_tools.6.3.2.zip’ is invalid. It does not contain a top-level __init__.py file

    calibre 2.34 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: Kindle and Mobipocket DeDRM && KindleUnpack – The Plugin && Kindle Collections
    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’/Users/nickquin/Downloads/DeDRM_tools.6.3.2.zip’ is invalid. It does not contain a top-level __init__.py file

    Should I not have upgraded to calibre 2.34 ?

    Regards

      • Thank you for your suggestion.

        The same thing happened even when I subsequently removed all other user installed plugins:

        calibre, version 2.34.0
        ERROR: Unhandled exception: InvalidPlugin:The plugin in u’/Users/nickquin/Downloads/DeDRM_tools.6.3.2.zip’ is invalid. It does not contain a top-level __init__.py file

        calibre 2.34 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: KindleUnpack – The Plugin && Kindle Collections
        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’/Users/nickquin/Downloads/DeDRM_tools.6.3.2.zip’ is invalid. It does not contain a top-level __init__.py file

        regards,

  5. Trying to convert Amazon MOBI ebook. Running Calibre 2.34 with latest tools v6.3.2. The following is what I get running in debug mode. Says it successfully decrypted the book but cannot convert to epub format. Information from log file from attempt to convert is also below.

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\Tim>calibre-debug -g
    calibre 2.34 isfrozen: True is64bit: False
    Windows-7-6.1.7601-SP1 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ‘7’, ‘6.1.7601’)
    Python 2.7.9
    Windows: (‘7’, ‘6.1.7601’, ‘SP1’, ‘Multiprocessor Free’)
    Successfully initialized third party plugins: DeDRM
    Starting up…
    Started up in 2.10 seconds with 100 books
    DeDRM v6.3.2: Trying to decrypt B007MB5JP6_EBOK.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 6, header length 232
    Extra Data Flags: 2
    Decrypting Mobipocket 6 ebook: The One Year Chronological Bible NIV
    Found 9 keys to try after 0.1 seconds
    Crypto Type is: 2
    File is encoded with PID /kJPXSJx2F.
    Decrypting. Please wait . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    . . . done
    Decryption succeeded after 0.8 seconds
    DeDRM v6.3.2: Finished after 0.8 seconds
    Added 0 books in 6.3 seconds
    DeDRM v6.3.2: Trying to decrypt B007MB5JP6_EBOK.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 6, header length 232
    Extra Data Flags: 2
    Decrypting Mobipocket 6 ebook: The One Year Chronological Bible NIV
    Found 9 keys to try after 0.1 seconds
    Crypto Type is: 2
    File is encoded with PID /kJPXSJx2F.
    Decrypting. Please wait . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    . . . done
    Decryption succeeded after 0.8 seconds
    DeDRM v6.3.2: Finished after 0.8 seconds
    Added The One Year Chronological Bible NIV to db in: 1.2
    Added 1 books in 2.4 seconds

    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    AFTER trying to convert to ePub format the following was in the conversion error log:

    calibre, version 2.34.0 (win32, isfrozen: True)
    Conversion Error: Failed: Convert book 1 of 1 (The One Year Chronological Bible NIV)

    Convert book 1 of 1 (The One Year Chronological Bible NIV)
    Resolved conversion options
    calibre version: 2.34.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\\Tim\\AppData\\Local\\Temp\\calibre_khtgsc\\szdngr.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’: True,
    ‘preserve_cover_aspect_ratio’: False,
    ‘pretty_print’: True,
    ‘pubdate’: None,
    ‘publisher’: None,
    ‘rating’: None,
    ‘read_metadata_from_opf’: u’C:\\Users\\Tim\\AppData\\Local\\Temp\\calibre_khtgsc\\olmz7k.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 C:\Users\Tim\AppData\Local\Temp\calibre_khtgsc\oyhfyx.mobi
    Extracting text…
    Adding anchors…
    Extracting images…
    Cleaning up HTML…
    Parsing HTML…
    Converting style information to CSS…
    Creating OPF…
    Parsing all content…
    Parsing index.html …
    Forcing index.html into XHTML namespace
    Parsing styles.css …
    Reading TOC from NCX…
    Merging user specified metadata…
    Detecting structure…
    Flattening CSS and remapping font sizes…
    Source base font size is 12.00000pt
    Removing fake margins…
    Found 55550 items of level: div_2
    Found 57592 items of level: div_3
    Found 2386 items of level: div_1
    Found 1171 items of level: p_5
    Found 147744 items of level: p_4
    Found 501 items of level: p_7
    Found 592 items of level: p_6
    Found 14140 items of level: p_3
    div_2 left margin stats: Counter({u”: 463})
    div_2 right margin stats: Counter({u”: 463})
    div_3 left margin stats: Counter({u”: 57592})
    div_3 right margin stats: Counter({u”: 57592})
    div_1 left margin stats: Counter({u”: 1183})
    div_1 right margin stats: Counter({u”: 1183})
    p_5 left margin stats: Counter({u’0′: 1171})
    p_5 right margin stats: Counter({u’0′: 1171})
    Negative text indent detected at level p_4, ignoring this level
    p_7 left margin stats: Counter({u’0′: 501})
    p_7 right margin stats: Counter({u’0′: 501})
    p_6 left margin stats: Counter({u’0′: 592})
    p_6 right margin stats: Counter({u’0′: 592})
    Negative text indent detected at level p_3, ignoring this level
    Cleaning up manifest…
    Trimming unused files from manifest…
    Trimming u’images/00003.jpg’ from manifest
    Creating EPUB Output…
    Splitting markup on page breaks and flow limits, if any…
    Splitting on page-break at id=calibre_pb_0

    • Are you sure the conversion failed because the book is still DRMed? Is the file extension now .mobi instead of .azw? Can you open it in calibre’s ebook viewer? I usually see the conversion log specifically say there’s a DRM error.

      • File is now MOBI instead of azw. I can open the MOBI file in calibre therefore I agree with Paul Durrant that the DRM was removed but calibre will not convert for some reason. I have converted other files, just can’t convert this one after updating to latest calibre and tools.
        Thoughts?
        Thanks.

    • “… could not be added because it could not be decrypted.”
      “ERROR: Obok DeDRM v3.1.3: No userkeys found to decrypt books with. No point in proceeding”

    • Hmmm, just tested the current Obok calibre plugin with the latest Kobo desktop program, and it worked fine with a DRMed book I just bought today. I’m using Windows 8.1 64-bit and the latest version of calibre.

      • Kobo Desktop 3.17.0 (white interface), Calibre 2.34, Obok 3.1.3, Windows 7 64-bit, currently inoperable. The userkey seems to have been shuffled.

        • Ahh, updating the Kobo Desktop app from within the version I already had only took me to version 3.15. I had to download a new setup file from Kobo’s website to get 3.17. And then it said the book I was trying to add couldn’t be decrypted.

          Thanks for reporting this so it can be looked into. (I see it’s been added to the issues at GitHub too.)

            • No, not yet. If you’ve had Kobo Desktop installed for a while though, then that version should only update to 3.15 which still works fine with the Obok plugin. It’s only if you’ve downloaded and installed Kobo Desktop recently that you’ll have 3.17. (Not sure when Kobo released 3.17 or if there ever was a 3.16.)

              • Thanks Laura. I don’t even know what version I’m running and I fear to open it now in case it auto updates.
                thanks always to you guys for offering up your valuable time in such a way. lots and lots of gratitude to you all!

              • I had Kobo installed for a while, but it forces you to update to 3.17 when you run it with a prompt. I’m not sure how you could keep it at 3.15. I tried blocking the update (Kobo is very buggy), but then the ebooks wouldn’t completely download.

                • Funny that. I found I indeed have 3.15. I checked it after my post to Laura after all, but I didn’t get a prompt to update. It just synced my books as it always does. I installed it back in May or June -so not so long ago. Don’t know what will happen when I open it again. Hope it doesn’t ‘auto update’.

                • I just looked at the old setup file I have and discovered it’s from almost a year ago. It forced me to update, but it is only at 3.15 after the update. I don’t know what version it was initially. I’ve opened it a few times now, but so far it hasn’t tried to update again. Do you know what version you have before it updates?

  6. I am trying to remove a DRM from this book but with no so success. I don’t have a Kindle device (and I never had it), and all the books I’ve bought from Amazon, I’ve read them in Amazon for PC application without any problems, so according to your guide there is no need to set up the plug-in (after I imported it and restarted calibre). Here is the log.

    ………………………………………
    C:\Program Files\Calibre2>calibre-debug -g
    calibre 2.34 [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 && Kindle and Mobipocket DeD
    RM
    Starting up…
    Started up in 2.41 seconds with 0 books

    Debugging DND event
    application/x-qt-windows-mime;value=”Shell IDList Array” 310 ‘\x01\x00\x00\x00\x
    0c\x00\x00\x00\xc0\x00\x00\x00\x14\x00\x1fP\xe0O\xd0 \xea:i\x10\xa2\xd8\x08\x00+
    00\x9d2\x00.\x80\x1c\xff\xcd\xa8xH\xbeC\xb5\xfd\xf8\t\x1c\x1c`\xd0\x1e\x00\x00\x
    00%\x00\xef\xbe\x11\x00\x00\x00..\xbc\x9f\xb4\x1f\xd0\x01f\x0c\xe3\xae\x0f\xd4\x
    d0\x01\x14\x00l\x001\x00\x00\x00\x00\x00\nG\xf1\xbc\x10\x00MYKIND~1\x00\x00T\x00
    \t\x00\x04\x00\xef\xbe\x98EJ\xb5\nG\xf1\xbc.\x00\x00\x00)U\x01\x00\x00\x00\x03\x
    00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05i\x05\x00M\x00y\x0
    0 \x00K\x00i\x00n\x00d\x00l\x00e\x00 \x00C\x00o\x00n\x00t\x00e\x00n\x00t\x00\x00
    \x00\x18\x00\x00\x00t\x002\x00\x96r\x03\x00\x9aEy\xb9 \x00B00HBX~1.AZW\x00\x00X\
    x00\t\x00\x04\x00\xef\xbe\x9aEx\xb9\x9aEx\xb9.\x00\x00\x00q[\x02\x00\x00\x00\x19
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00h\xb75\x00B\x000\x00
    0\x00H\x00B\x00X\x00P\x00T\x00E\x00G\x00_\x00E\x00B\x00O\x00K\x00.\x00a\x00’

    application/x-qt-windows-mime;value=”UsingDefaultDragImage” 4 ‘\x01\x00\x00\x00’

    application/x-qt-windows-mime;value=”DragImageBits” 36888 ‘`\x00\x00\x00`\x00\x0
    0\x000\x00\x00\x00Y\x00\x00\x00P\x19\x05)\xff\xff\xff\xff\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00’

    application/x-qt-windows-mime;value=”DragContext” 16 ‘\x00\x00\x00\x00\x01\x00\x
    00\x00\x00\x00\x00\x00\x00\x00\x00\x00’

    application/x-qt-windows-mime;value=”DragSourceHelperFlags” 4 ‘\x01\x00\x00\x00’

    application/x-qt-windows-mime;value=”InShellDragLoop” 4 ‘\x01\x00\x00\x00’

    text/uri-list 75 ‘file:///C:/Users/fila/Documents/My%20Kindle%20Content/B00HBXPT
    EG_EBOK.azw\r\n’

    application/x-qt-windows-mime;value=”FileName” 45 ‘C:\\Users\\fila\\DOCUME~1\\MY
    KIND~1\\B00HBX~1.AZW\x00’

    application/x-qt-windows-mime;value=”FileContents” 0 ”

    application/x-qt-windows-mime;value=”FileNameW” 124 ‘C\x00:\x00\\\x00U\x00s\x00e
    \x00r\x00s\x00\\\x00R\x00u\x00d\x00i\x00\\\x00D\x00o\x00c\x00u\x00m\x00e\x00n\x0
    0t\x00s\x00\\\x00M\x00y\x00 \x00K\x00i\x00n\x00d\x00l\x00e\x00 \x00C\x00o\x00n\x
    00t\x00e\x00n\x00t\x00\\\x00B\x000\x000\x00H\x00B\x00X\x00P\x00T\x00E\x00G\x00_\
    x00E\x00B\x00O\x00K\x00.\x00a\x00z\x00w\x00\x00\x00’

    application/x-qt-windows-mime;value=”FileGroupDescriptorW” 596 ‘\x01\x00\x00\x00
    l\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0
    0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00\x00\x
    92\xe4Ra!\xd0\x01\x00\x00\x00\x00\x00\x00\x00\x00\x98\x07\xe0Sa!\xd0\x01\x00\x00
    \x00\x00\x96r\x03\x00B\x000\x000\x00H\x00B\x00X\x00P\x00T\x00E\x00G\x00_\x00E\x0
    0B\x00O\x00K\x00.\x00a\x00z\x00w\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00’

    application/x-qt-windows-mime;value=”IsShowingLayered” 4 ‘\x01\x00\x00\x00’

    application/x-qt-windows-mime;value=”DragWindow” 4 ‘\x90\x072\x00’

    application/x-qt-windows-mime;value=”IsComputingImage” 4 ‘\x00\x00\x00\x00’

    application/x-qt-windows-mime;value=”DropDescription” 1044 ‘\xff\xff\xff\xff\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
    \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00’

    application/x-qt-windows-mime;value=”DisableDragText” 4 ‘\x01\x00\x00\x00’

    application/x-qt-windows-mime;value=”IsShowingText” 4 ‘\x00\x00\x00\x00’

    application/x-qt-windows-mime;value=”ComputedDragImage” 4 ‘P\x19\x05)’

    Firefox rurl: None None
    URLS: [‘file:///C:/Users/fila/Documents/My%20Kindle%20Content/B00HBXPTEG_EBOK.az
    w’]
    Paths: [u’C:/Users/fila/Documents/My Kindle Content/B00HBXPTEG_EBOK.azw’]
    Extensions: frozenset([u’azw’])
    DeDRM v6.3.2: Trying to decrypt B00HBXPTEG_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: World Quizzing Championships 2012 – Quiz Book
    Found 0 keys to try after 2.4 seconds
    Crypto Type is: 2
    DeDRM v6.3.2: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.3.2: Looking for new default Kindle Key after 2.4 seconds
    searching for kinfoFiles in C:\Users\fila\AppData\Local
    Found K4PC 1.9+ kinf2011 file: C:\Users\fila\AppData\Local\Amazon\Kindle\storage
    \.kinf2011
    Decrypted key file using IDString ‘3527824333’ and UserName ‘52756469’
    DeDRM v6.3.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: World Quizzing Championships 2012 – Quiz Book
    DeDRM v6.3.2: Ultimately failed to decrypt after 2.5 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 588, in run
    File “calibre_plugins.dedrm.__init__”, line 538, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.3.2: Ultimately failed to decrypt after 2.5 seconds
    Kindle and Mobipocket DeDRM v0.4.13: Trying to decrypt B00HBXPTEG_EBOK.azw.
    Using Library AlfCrypto DLL/DYLIB/SO
    Running file type plugin Kindle and Mobipocket DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 155, in _run_filetype_plugi
    ns
    File “calibre_plugins.k4mobidedrm.__init__”, line 116, in run
    File “calibre_plugins.k4mobidedrm.__init__”, line 249, in config
    File “site-packages\calibre\customize\zipplugin.py”, line 179, in load_module
    File “calibre_plugins.k4mobidedrm.config”, line 4, in
    ImportError: No module named PyQt4.Qt
    Added World Quizzing Championships 2012 – Quiz Book to db in: 12.6
    Added 1 books in 16.8 seconds
    —————————————————-

    The following is displayed after I try conversion to EPUB.

    —————————————————————————————————–

    Worker Launch took: 0.450000047684
    Job: 1 Convert book 1 of 1 (World Quizzing Championships 2012 – Quiz Book) finis
    hed
    Convert book 1 of 1 (World Quizzing Championships 2012 – Quiz Book)
    Resolved conversion options
    calibre version: 2.34.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*((ch
    apter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))’, ‘i’)) or @c
    lass = ‘chapter’]”,
    ‘chapter_mark’: u’pagebreak’,
    ‘comments’: None,
    ‘cover’: u’C:\\Users\\fila\\AppData\\Local\\Temp\\calibre_pzbckz\\qf9pe
    a.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’C:\\Users\\fila\\AppData\\Local\\Temp\\cali
    bre_pzbckz\\ft6rin.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 C:\Users\fila\AppData\Local\Temp\calibre_pzbckzz9p0q.azw
    Found KF8 MOBI of type ‘standalone’
    Python function terminated unexpectedly
    World Quizzing Championships 2012 – Quiz Book (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 __c
    all__
    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: World Quizzing Championships 2012 – Quiz Book

    • I just did removed the old “Kindle and Mobipocket DRM” plugin as suggested. No success unfortunately. I also tried reinstalling the DRM plugin as well, still no success. Here is the new log

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

      C:\Program Files\Calibre2>calibre-debug -g
      calibre 2.34 [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.51 seconds with 0 books
      DeDRM v6.3.2: Trying to decrypt B00HBXPTEG_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: World Quizzing Championships 2012 – Quiz Book
      Found 0 keys to try after 2.2 seconds
      Crypto Type is: 2
      DeDRM v6.3.2: Failed to decrypt with error: No key found in 0 keys tried.
      DeDRM v6.3.2: Looking for new default Kindle Key after 2.2 seconds
      searching for kinfoFiles in C:\Users\fila\AppData\Local
      Found K4PC 1.9+ kinf2011 file: C:\Users\fila\AppData\Local\Amazon\Kindle\storage
      \.kinf2011
      Decrypted key file using IDString ‘3527824333’ and UserName ‘52756469’
      DeDRM v6.3.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: World Quizzing Championships 2012 – Quiz Book
      DeDRM v6.3.2: Ultimately failed to decrypt after 2.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 588, in run
      File “calibre_plugins.dedrm.__init__”, line 538, in KindleMobiDecrypt
      DeDRMError: DeDRM v6.3.2: Ultimately failed to decrypt after 2.2 seconds
      Added World Quizzing Championships 2012 – Quiz Book to db in: 12.2
      Added 1 books in 15.8 seconds

      • Hmm… for some reaosn the key the plugin is picking up isn’t the key that Kindle for PC is using. The usual advice in this case is to unregister and uninstall Kindle for PC from your computer (including deleting the entire C:\Users\fila\AppData\Local\Amazon folder), and then reinstall, re-register and re-download the book. That way the only key the Kindle for PC folders should contain is the current active key.

  7. Will this work with Windows 10, Barnes & Nobel epubs downloaded using Nook PC app? The downloaded epubs are location in D:\Users\MyName\AppData\Local\Packages\BarnesNoble.Nook_ahnzqzva31enc\LocalState

    Installed the DeDRM plugin, created the user email/pass in plugin configuration, and installed python because I received the same debug error before having python installed (so installing did nothing different).

    Nook Study does not work with Windows 10

    The following is the debug information:

    D:\Users\MyUser>calibre-debug -g
    calibre 2.34 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’)
    Qt: Untested Windows version 10.0 detected!
    Successfully initialized third party plugins: DeDRM
    Starting up…
    Started up in 2.29 seconds with 1 books
    DeDRM v6.3.2: Trying to decrypt 9781451606409.epub
    DeDRM v6.3.2: Verifying zip archive integrity
    DeDRM v6.3.2: ���9781451606409.epub��� is a secure Barnes & Noble ePub
    DeDRM v6.3.2: Trying Encryption key barnes&noble
    DeDRM v6.3.2: Exception when trying to decrypt after 0.2 seconds
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.__init__”, line 198, in ePubDecrypt
    File “calibre_plugins.dedrm.ignobleepub”, line 258, in decryptBook
    File “calibre_plugins.dedrm.ignobleepub”, line 180, in __init__
    File “site-packages\pycrypto-2.6.1-py2.7-win32.egg\Crypto\Cipher\AES.py”, line 95, in new
    File “site-packages\pycrypto-2.6.1-py2.7-win32.egg\Crypto\Cipher\AES.py”, line 59, in __init__
    File “site-packages\pycrypto-2.6.1-py2.7-win32.egg\Crypto\Cipher\blockalgo.py”, line 141, in __init__
    ValueError: Key cannot be the null string DeDRM v6.3.2: Failed to decrypt with key barnes&noble after 0.2 seconds
    DeDRM v6.3.2: Looking for new NOOK Study Keys after 0.2 seconds
    No nook Study log files have been found.
    DeDRM v6.3.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 599, in run
    File “calibre_plugins.dedrm.__init__”, line 275, in ePubDecrypt
    DeDRMError: DeDRM v6.3.2: Ultimately failed to decrypt after 0.2 seconds.
    Added Plunder and Deceit to db in: 1.2
    Added 1 books in 1.8 seconds

      • Is that reply to my post? Because I’m not using Kindle. I’m using Nook from the Windows Store. Nook Study doesn’t work anymore.

        In either case, I uninstalled Nook this morning before restarting this whole process. Reinstalled, downloaded my books, and still have that log message above.

        • Apologies, yes I meant to type nook for Pc and Kindle for Pc came from my fingers. :)

          Others have reported nook Study working with Windows 10.

          It seems that the key that’s being tried isn’t the right key for your books. I suppose it’s just possible that B&N aren’t using the new encryption scheme for you. In which case you’d need to try an earlier version of the toold that lets you make a B&N key using your name and CC#. But I had thought everyone got moved a few months ago.

          • Well, there is only one book I bough recently… last night… the others were from a year ago. So which older version of the plugin in tool should I try?

            As for Nook Study, I downloaded that this morning and received an internal error failing to retrieve adobe account. Not sure what relevance that is as I only have a B&N account… not Adobe.

            • I suggest that if you continue to have no joy with nook for PC, you should install Adobe Digital editions version 2.x, register it with your Adobe ID (get one if you don’t have one) and then try installing nook study again.

              • I guess I’m SOL. I did like you said… removed everything, installed ADE 2.0, created an Adobe account, downloaded Nook Study, tried to log in and it wouldn’t work. Tried several times. Now I get a message saying my account has been locked. So it obviously doesn’t work. B&N must have changed something so this stuff no longer works.

          • Just at a whim, I checked the key created by using email/password in the Barnes & Noble configuration. Is it suppose to be empty? Or does it try to create the key right when you make it, and it’s failing so coming up blank? When I tried a different email, it would not let me create it. Saying a duplicate key existed even though named differently and using different values.

          • I got it!! You were right. My BN email and the credit card number worked. Using Nook from Windows Store on Windows 10. I logged in Nook using my email and regular account password. Downloaded the books. Then in the Calibre plugin, I created the key using my email login and the credit card number as the password. This enabled me to import the books with the DRM stripped.

            Thank you.

            • Glad you got it. I imagine the plugin was actually able to finally pull your key from Nookstudy rather than because of the key you created. Was this still the current plug-in 6.3.2?

              • Yes, it was done using the current plugin. However, it was not NookStudy. That didn’t work for me even after reinstalling everything, installing Adobe Digitial and creating an Adobe account. All that failed. So I uninstalled all of it. Reinstalled Nook from Windows app store, downloaded the books, then used the plugin with my B&N email and credit card. My B&N email and password would not work in the plugin.

  8. I can’t seem to get the dedrm program to work at all. If I double click DeDRM_App.pyc or DeDRM_Drop_Target.bat (which should get me a preference menu?), a black screen pops up and closes immediately. It doesn’t seem to do anything for any ebooks, either.

    • DeDRM_App.pyc? It should be .pyw. Try opening a command window, and running the application in the window (i.e. type python and a space and then drag the DeDRM_App.pyw file into the window (which will insert its full path) and then press return). The window should stay open after the program tries to run and may give some useful info about what went wrong. My guess would be an incorrect or incomplete python installation.

      • Having done that, i get “ImportError: dll load failed: 1% is not a valid win32 application”. I’m told the solution for that is adding my opencv binary to the windows path environment. Unfortunately, I don’t seem to have openCV binaries, so I may need to install those.

        As far as the Python installation goes, I have regular Python (3.4.3), Activepython 2.7 (64-bit) and Activepython 2.7 (32-bit) all installed, in addition to pycrypto for both 64-bit and 32-bit. In hindsight, perhaps redundant. Could those be in conflict? I have a 64-bit system. (Windows 7).

  9. I’m running windows 10 pro I have installed the new tools DeDRM_tools.6.3.2 in calibre (calibre 2.34 (64bit)) and I think I got all the old versions out first but it still won’t decrypt a kindle book

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

    C:\Windows\System32>calibre-debug -g
    calibre 2.34 [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.74 seconds with 286 books
    [0x7FFCEB054450] ANOMALY: meaningless REX prefix used
    DeDRM v6.3.2: Trying to decrypt B012OS8WBE_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: Sideswiped (The Peri Reed Chronicles)
    Found 4 keys to try after 0.2 seconds
    Crypto Type is: 2
    DeDRM v6.3.2: Failed to decrypt with error: No key found in 4 keys tried.
    DeDRM v6.3.2: Looking for new default Kindle Key after 0.2 seconds
    searching for kinfoFiles in C:\Users\Bryan\AppData\Local
    Found K4PC 1.9+ kinf2011 file: C:\Users\Bryan\AppData\Local\Amazon\Kindle\storage\.kinf2011
    Decrypted key file using IDString ‘49670496’ and UserName ‘427279616e’
    DeDRM v6.3.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: Sideswiped (The Peri Reed Chronicles)
    DeDRM v6.3.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 588, in run
    File “calibre_plugins.dedrm.__init__”, line 538, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.3.2: Ultimately failed to decrypt after 0.3 seconds
    Added Sideswiped (The Peri Reed Chronicles) to db in: 1.3
    Added 1 books in 2.0 seconds
    Worker Launch took: 0.133000135422

    C:\Windows\System32>

    • If that file is from the Kindle for PC downlaoded books folder, then my advice would be the same as for Filantro – unregister, uninstall completely, re-install, re0register and re-download the book before trying to import again.

      • I just followed your advice, and did all of what you suggested (unregister, uninstall Kindle for PC, completely delete folder where it is installed and where it downloads ebooks, install and re-register), but unfortunately still without success. Do you maybe have some other idea that what might be the issue? I include the new log.

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

        C:\Program Files\Calibre2>calibre-debug -g
        calibre 2.34 [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.74 seconds with 1 books
        DeDRM v6.3.2: Trying to decrypt B00HBXPTEG_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: 1
        Decrypting Kindle Format 8 ebook: World Quizzing Championships 2012 – Quiz Book
        Found 0 keys to try after 2.2 seconds
        Crypto Type is: 2
        DeDRM v6.3.2: Failed to decrypt with error: No key found in 0 keys tried.
        DeDRM v6.3.2: Looking for new default Kindle Key after 2.2 seconds
        searching for kinfoFiles in C:\Users\fila\AppData\Local
        Found K4PC 1.9+ kinf2011 file: C:\Users\fila\AppData\Local\Amazon\Kindle\storage
        \.kinf2011
        Decrypted key file using IDString ‘3527824333’ and UserName ‘52756469’
        DeDRM v6.3.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: 1
        Decrypting Kindle Format 8 ebook: World Quizzing Championships 2012 – Quiz Book
        DeDRM v6.3.2: Ultimately failed to decrypt after 2.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_plugi
        ns
        File “calibre_plugins.dedrm.__init__”, line 588, in run
        File “calibre_plugins.dedrm.__init__”, line 538, in KindleMobiDecrypt
        DeDRMError: DeDRM v6.3.2: Ultimately failed to decrypt after 2.3 seconds
        Added World Quizzing Championships 2012 – Quiz Book to db in: 10.9
        Added 1 books in 14.5 seconds

  10. Hi. I’m not currently able to decrypt. I have tried fresh installations on both Win8.1 and Win10 with the same result:
    Debug output is as follows:

    calibre 2.34 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.91 seconds with 1 books
    DeDRM v6.3.2: Trying to decrypt [FILENAME].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: [BOOK TITLE]
    Found 0 keys to try after 0.2 seconds
    Crypto Type is: 2
    DeDRM v6.3.2: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.3.2: Looking for new default Kindle Key after 0.2 seconds
    searching for kinfoFiles in C:\Users\[USERNAME]\AppData\Local
    Found K4PC 1.9+ kinf2011 file: C:\Users\[USERNAME]\AppData\Local\Amazon\Kindle\storage\.[FILENAME]
    Decrypted key file using IDString ‘[IDSTRING]’ and UserName ‘[USERNAME]’
    DeDRM v6.3.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: [BOOK TITLE]
    DeDRM v6.3.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 588, in run
    File “calibre_plugins.dedrm.__init__”, line 538, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.3.2: Ultimately failed to decrypt after 0.3 seconds
    Added [BOOK TITLE] to db in: 0.1
    Added 1 books in 1.6 seconds

    Thanks in advance for any assistance.

  11. I’m not interested in backup so much as I am interested in being able to feed the ebooks I buy to epubReader and read using a interface that feels like plain HTML’d text, not some stupid slick app. Unfortunately I can’t seem to make this workaround, well, work. In the debug mode output, I’m seeing some tracebacks for both versions that I installed one after the other while traipsing about the internet in desperation? What’s going on?

    (Beg pardon for the frustrated tone, which is not aimed at you but at goddamn persnickety DRM fussing and at the fact that it is now officially way too late to be butting heads with aforementioned goddamn persnickety DRM fussings…. )

    calibre 2.34 isfrozen: True is64bit: False
    Windows-7-6.1.7601-SP1 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ‘7’, ‘6.1.7601’)
    Python 2.7.9
    Windows: (‘7’, ‘6.1.7601’, ‘SP1’, ‘Multiprocessor Free’)
    Successfully initialized third party plugins: DeDRM && Kindle and Mobipocket DeD
    RM
    Starting up…
    Started up in 4.12 seconds with 2 books
    DeDRM v6.3.2: Trying to decrypt B00X6AXV84_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: —
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.3.2: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.3.2: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\—\AppData\Local
    Found K4PC 1.9+ kinf2011 file: C:\Users\—\AppData\Local\Amazon\Kindle\stor
    age\.kinf2011
    Decrypted key file using IDString ‘646988280’ and UserName ‘416e6168746172’
    DeDRM v6.3.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: —
    DeDRM v6.3.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_plugi
    ns
    File “calibre_plugins.dedrm.__init__”, line 588, in run
    File “calibre_plugins.dedrm.__init__”, line 538, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.3.2: Ultimately failed to decrypt after 0.3 seconds
    Using Library AlfCrypto DLL/DYLIB/SO
    Running file type plugin Kindle and Mobipocket DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 155, in _run_filetype_plugi
    ns
    File “calibre_plugins.k4mobidedrm.__init__”, line 68, in run
    File “calibre_plugins.k4mobidedrm.__init__”, line 239, in config
    File “site-packages\calibre\customize\zipplugin.py”, line 179, in load_module
    File “calibre_plugins.k4mobidedrm.config”, line 1, in
    ImportError: No module named PyQt4.Qt
    Added — to db in:
    0.2
    Added 1 books in 1.3 seconds
    Worker Launch took: 0.197000026703

    • Woke up and realized I had installed the wrong version of Calibre… downloaded the 64-bit version just in case that was it, and only installed the latest version of the plugin this time, but nope, same exact tracebacks.

  12. Have been using Calibre with no problems for over a year ( thank you apprenticealf and colleagues) to remove DRM from Adobe and Kindle so that I can read at leisure on my Boox reader. Recentley re installed and updated system (Acronis true image), down loaded a new book from Kindle — no joy in removing DRM. This is the first time Calibre plus plug- ins has failed to remove DRM
    Have tried all suggestions — reinstalling KIndle, deregistering account and deleting Amazon folders ,reinstalling Calibre etc with most recent versions
    Post Log — if anyone can see where maybe the error is occuring — would be very happy to have Calibre running back at full strength.

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\Meadowbrook>calibre-debug -g
    calibre 2.34 [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
    Starting up…
    Started up in 2.49 seconds with 0 books
    DeDRM v6.3.2: Trying to decrypt B0035OC826_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: A Walk In The Woods
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.3.2: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.3.2: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\Meadowbrook\AppData\Local
    Found K4PC 1.9+ kinf2011 file: C:\Users\Meadowbrook\AppData\Local\Amazon\Kindle\
    storage\.kinf2011
    Decrypted key file using IDString ‘787219558’ and UserName ‘4d6561646f7762726f6f
    6b’
    DeDRM v6.3.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: A Walk In The Woods
    DeDRM v6.3.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 588, in run
    File “calibre_plugins.dedrm.__init__”, line 538, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.3.2: Ultimately failed to decrypt after 0.2 seconds
    Added A Walk In The Woods to db in: 0.3
    Added 1 books in 1.1 seconds
    Worker Launch took: 0.199000120163
    Job: 1 Convert book 1 of 1 (A Walk In The Woods) finished
    Convert book 1 of 1 (A Walk In The Woods)
    Resolved conversion options
    calibre version: 2.34.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*((ch
    apter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))’, ‘i’)) or @c
    lass = ‘chapter’]”,
    ‘chapter_mark’: u’pagebreak’,
    ‘comments’: None,
    ‘cover’: u’C:\\Users\\MEADOW~1\\AppData\\Local\\Temp\\calibre_bzhsbq\\b
    irsre.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’C:\\Users\\MEADOW~1\\AppData\\Local\\Temp\\
    calibre_bzhsbq\\mleo8o.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 C:\Users\MEADOW~1\AppData\Local\Temp\calibre_bzhsbq\sarcuf.azw
    Found KF8 MOBI of type ‘standalone’
    Python function terminated unexpectedly
    A Walk In The Woods (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 __c
    all__
    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: A Walk In The Woods

  13. I was having the same problem with 6.3.2 (Calibre 2.34 64bit on Win7). Reverting to 6.2.2 resolved the problem. Upgrading to 6.3.3 seems to work as well. THANK YOU!

  14. I was having trouble decrypting an Amazon Kindle to PC book on Linux 32 bit (Ubuntu 15) using Calibre and the DRM removal plugin (v6.3.3).

    I noticed the debug output said the following where kindlekey.py was erroring out:

    IOError: [Errno 2] No such file or directory: u’C:\\home\\jsako\\.config\\calibre\\plugins\\DeDRM\\libraryfiles\\winekeysdir’

    Which is of course correct: no such file exists since ‘C:\’ is an alias for ‘~/.wine/drive_c’.

    What the program SHOULD be looking for is ‘~/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir’.

    I fixed the problem by creating a symlink in ~/.wine/drive_c/calibre/plugins/DeDRM/libraryfiles/ named ‘winekeysdir’ which redirected to the proper directory.

    So, if you’re having trouble on Linux and WINE, look at the error output and see if this is the case.

    Developers, I don’t know if this is a bug in your package or not; I had a previous python.org Python 2.7 install in the WINE directory before I used ActivePython. I did uninstall the previous Python before installing the ActivePython version, but something might’ve stayed around. Something to test in any case.

    • Those are not the only files. Here is the complete list: adobekey.py kindlekey.py libalfcrypto32.so libalfcrypto64.so subasyncio.py The bug has been around for three or four years at least to my own knowledge. Regards, Barry

  15. Get this trying to install 6.3.3 in Calibre 1.4.8

    calibre, version 1.48.0
    ERROR: Unhandled exception: InvalidPlugin:Initialization of plugin Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 544, in initialize_plugin
    File “calibre_plugins.dedrm.__init__”, line 151, in initialize
    AttributeError: ‘DeDRM’ object has no attribute ‘starttime’
    failed with traceback:
    Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 544, in initialize_plugin
    File “calibre_plugins.dedrm.__init__”, line 151, in initialize
    AttributeError: ‘DeDRM’ object has no attribute ‘starttime’

    calibre 1.48 isfrozen: True is64bit: False
    Windows-XP-5.1.2600-SP3 Windows (’32bit’, ‘WindowsPE’)
    (‘Windows’, ‘XP’, ‘5.1.2600’)
    Python 2.7.5
    Windows: (‘XP’, ‘5.1.2600’, ‘SP3’, ‘Multiprocessor Free’)
    Traceback (most recent call last):
    File “site-packages\calibre\gui2\preferences\plugins.py”, line 310, in add_plugin
    File “site-packages\calibre\customize\ui.py”, line 383, in add_plugin
    File “site-packages\calibre\customize\ui.py”, line 550, in initialize_plugin
    InvalidPlugin: Initialization of plugin Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 544, in initialize_plugin
    File “calibre_plugins.dedrm.__init__”, line 151, in initialize
    AttributeError: ‘DeDRM’ object has no attribute ‘starttime’
    failed with traceback:
    Traceback (most recent call last):
    File “site-packages\calibre\customize\ui.py”, line 544, in initialize_plugin
    File “calibre_plugins.dedrm.__init__”, line 151, in initialize
    AttributeError: ‘DeDRM’ object has no attribute ‘starttime’

    • This appears to be a long-standing bug in an error message that was introduced in version 6.2.0. It should have failed with an error message:

      Exception when copying needed library files

      I must admit I don’t know why that error message needed to be issued. We would have got a traceback if the error message bug wasn’t there. You could try manually copying the needed files from the zip.Those are alfcrypto.dll and alfcrypto64.dll and they need to be in /plugins/DeDRM/libraryfiles and you’ll also need to make an empty directory ‘6.3.3’ in /plugins/DeDRM

      • On Windows 7 with Calibre 2.34.0.0 and the latest tools (DeDRM_tools_6.3.3.zip) I just converted a KIndle to epub with no hassles at all — Calibre is back and working thank you thank you !

    • I know that calibre version 1.48 is recommended for Windows XP. However, I don’t think the DeDRM plugin will work with it. I’ve seen others report that they were using the latest version of calibre (or at least a much more recent version) with XP without trouble.

  16. At first it did not work for me because I was copying the file from my Kindle device. It worked when I download the bookdirectly to the Kindle PC, and then transfered it from the Kindle PC folder into Calibre. Hope this helps someone.

    Thanks!

  17. I may have stumbled onto a bug with DeDRM 6.3.3. I get the message “There was an error with 1 ebook: The Collector.epub couldn’t be decoded: The command exited with a non-zero status.” This is an ADE ePub located in a folder. Other ADE ePubs from the same source convert with no issues. As an alternative, ePubeeDRMRemoval successfully removed the DRM on the same book. I’m on Mac OS X 10.10.4 running DeDRM stand-alone. The log entry follows. Thanks for all your efforts.

    There is 1 ebook to be decrypted.
    Processing file: The Collector.epub
    shellcommand: /usr/bin/python ‘/Applications/DeDRM 6.3.3.app/Contents/Resources/zipfix.py’ ‘/Users/AllansHomeFolder/Documents/Digital Editions/The Collector.epub’ ‘/Users/AllansHomeFolder/Our Cloud Folders/Books/DeDRM/The Collector_fixed.epub’ > ‘/Users/AllansHomeFolder/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult:
    shellcommand: /usr/bin/python ‘/Applications/DeDRM 6.3.3.app/Contents/Resources/epubtest.py’ ‘/Users/AllansHomeFolder/Our Cloud Folders/Books/DeDRM/The Collector_fixed.epub’ > ‘/Users/AllansHomeFolder/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: Adobe

    shellcommand: /usr/bin/python ‘/Applications/DeDRM 6.3.3.app/Contents/Resources/ineptepub.py’ ‘/Users/AllansHomeFolder/Library/Preferences/com.apprenticealf.dedrm/Local Adept Key.der’ ‘/Users/AllansHomeFolder/Our Cloud Folders/Books/DeDRM/The Collector_fixed.epub’ ‘/Users/AllansHomeFolder/Our Cloud Folders/Books/DeDRM/The Collector_nodrm.epub’ > ‘/Users/AllansHomeFolder/Library/Preferences/com.apprenticealf.dedrm/DeDRM_temp.log’
    shellresult: Could not decrypt The Collector_fixed.epub because of an exception:
    Traceback (most recent call last):
    File “/Applications/DeDRM 6.3.3.app/Contents/Resources/ineptepub.py”, line 415, in decryptBook
    bookkey = rsa.decrypt(bookkey.decode(‘base64’))
    File “/Applications/DeDRM 6.3.3.app/Contents/Resources/ineptepub.py”, line 182, in decrypt
    raise ADEPTError(‘RSA decryption failed’)
    ADEPTError: RSA decryption failed

    The command exited with a non-zero status.
    There was an error with 1 ebook:
    The Collector.epub couldn’t be decoded:
    The command exited with a non-zero status.

  18. Hi, I’m on Linux (Xubuntu 14.04 LTS), and cannot for the life of me get the DeDRM plugin to work as advertised (or at all).

    I followed the instructions in the documentation, even the parts that were a bit vague. Already had WINE, installed Kindle for PC, Python and Pycrypt, downloaded the books I wanted to break out of jail, then loaded them into Calibre. Everything seemed fine, but when I tried to open one, got the “this file is protected by DRM” warning.

    Please help!

  19. kindlekey.py v1.9
    Copyright ? 2010-2013 some_updates and Apprentice Alf
    searching for kinfoFiles in C:\users\jason\Local Settings\Application Data
    Found K4PC 1.9+ kinf2011 file: C:\users\jason\Local Settings\Application Data\Amazon\Kindle\storage\.kinf2011
    Decrypted key file using IDString '0' and UserName '6a61736f6e'
    Saved a key to Z:\home\jason\.config\calibre\plugins\DeDRM\libraryfiles\winekeysdir\kindlekey1.k4i
    fixme:msvcrt:__clean_type_info_names_internal (0x1d1b520c) stub
    fixme:msvcrt:__clean_type_info_names_internal (0x100ab694) stub
    fixme:msvcrt:__clean_type_info_names_internal (0x1e24d5c4) stub
    DeDRM v6.3.2: Found and decrypted 1 key file
    DeDRM v6.3.2: Found 1 new key
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 7, header length 232
    Extra Data Flags: 7
    Decrypting Mobipocket 7 ebook: Supporting Character Secrets (Screenwriting Blue Books)
    DeDRM v6.3.2: Ultimately failed to decrypt after 35.5 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 588, in run
    File "calibre_plugins.dedrm.__init__", line 538, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.3.2: Ultimately failed to decrypt after 35.5 seconds
    Added Supporting Character Secrets (Screenwriting Blue Books) to db in: 3.7
    Added 1 books in 40.6 seconds

  20. I can confirm that Kobo Desktop 3.17 has changed the way the encryption key is stored, so that the obok plugin doesn’t work at present. It is still possible to download Kobo Desktop 3.15 from the Wayback Machine at

    https://web.archive.org/web/20150505234922/https://kbdownload1-a.akamaihd.net/desktop/kobodesktop/kobosetup.exe

    Initial tests suggest that it is just the way the key is stored that has changed, not the key itself nor the encryption method used.

  21. I installed version 6.3.3 and it still won’t convert kindle azw3 files. I followed the Read Me instructions but no luck.
    Here is the debug file:
    calibre Debug log
    calibre 2.30 [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
    Starting up…
    Started up in 7.80 seconds with 12 books
    Worker Launch took: 0.30999994278
    Job: 1 Convert book 1 of 1 (Renegade’s Magic (The Soldier Son Trilogy, Book 3)) finished
    Convert book 1 of 1 (Renegade’s Magic (The Soldier Son Trilogy, Book 3))
    Resolved conversion options
    calibre version: 2.30.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\petervg\AppData\Local\Temp\calibre_fgi5tt\tsq53u.jpeg’,
    ‘debug_pipeline’: None,
    ‘dehyphenate’: True,
    ‘delete_blank_paragraphs’: True,
    ‘disable_font_rescaling’: False,
    ‘dont_compress’: False,
    ‘duplicate_links_in_toc’: False,
    ’embed_all_fonts’: False,
    ’embed_font_family’: None,
    ‘enable_heuristics’: False,
    ‘expand_css’: False,
    ‘extra_css’: None,
    ‘extract_to’: 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,
    ‘mobi_file_type’: u’old’,
    ‘mobi_ignore_margins’: False,
    ‘mobi_keep_original_images’: False,
    ‘mobi_toc_at_start’: False,
    ‘no_chapters_in_toc’: False,
    ‘no_inline_navbars’: False,
    ‘no_inline_toc’: False,
    ‘output_profile’: ,
    ‘page_breaks_before’: u”//*[name()=’h1′ or name()=’h2′]”,
    ‘personal_doc’: u'[PDOC]’,
    ‘prefer_author_sort’: False,
    ‘prefer_metadata_cover’: False,
    ‘pretty_print’: False,
    ‘pubdate’: None,
    ‘publisher’: None,
    ‘rating’: None,
    ‘read_metadata_from_opf’: u’C:\Users\petervg\AppData\Local\Temp\calibre_fgi5tt\1fksp6.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,
    ‘share_not_sync’: False,
    ‘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 C:UserspetervgAppDataLocalTempcalibre_fgi5ttyhbq9v.azw3
    Found KF8 MOBI of type ‘standalone’
    Python function terminated unexpectedly
    Renegade’s Magic (The Soldier Son Trilogy, Book 3) (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-packagescalibreutilsipcworker.py”, line 193, in main
    File “site-packagescalibregui2convertgui_conversion.py”, line 31, in gui_convert_override
    File “site-packagescalibregui2convertgui_conversion.py”, line 25, in gui_convert
    File “site-packagescalibreebooksconversionplumber.py”, line 1042, in run
    File “site-packagescalibrecustomizeconversion.py”, line 241, in __call__
    File “site-packagescalibreebooksconversionpluginsmobi_input.py”, line 43, in convert
    File “site-packagescalibreebooksmobireadermobi8.py”, line 81, in __call__
    File “site-packagescalibreebooksmobireadermobi6.py”, line 143, in check_for_drm
    calibre.ebooks.DRMError: Renegade’s Magic (The Soldier Son Trilogy, Book 3)

    DeDRM v6.0.5: Trying to decrypt Fool’s Quest (Fitz and the Fool, Book 2).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: Fool’s Quest (Fitz and the Fool, Book 2)
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.0.5: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.0.5: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:UserspetervgAppDataLocal
    No K4PC kindle.info/kinf/kinf2011 files have been found.
    DeDRM v6.0.5: Ultimately failed to decrypt after 0.1 seconds.
    Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.__init__”, line 376, in KindleMobiDecrypt
    File “calibre_plugins.dedrm.k4mobidedrm”, line 214, in GetDecryptedBook
    File “calibre_plugins.dedrm.mobidedrm”, line 467, in processBook
    DrmException: No key found in 0 keys tried.
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packagescalibrecustomizeui.py”, line 155, in _run_filetype_plugins
    File “calibre_plugins.dedrm.__init__”, line 467, in run
    File “calibre_plugins.dedrm.__init__”, line 418, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.0.5: Ultimately failed to decrypt “Fool’s Quest (Fitz and the Fool, Book 2).azw3” after 0.1 seconds with error: No key found in 0 keys tried.
    Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
    Added Fool’s Quest (Fitz and the Fool, Book 2) to db in: 0.3
    Added 1 books in 2.2 seconds
    DeDRM v6.0.5: Trying to decrypt Fool’s Assassin (Fitz and the Fool, Book 1).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: Fool’s Assassin (Fitz and the Fool, Book 1)
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.0.5: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.0.5: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:UserspetervgAppDataLocal
    No K4PC kindle.info/kinf/kinf2011 files have been found.
    DeDRM v6.0.5: Ultimately failed to decrypt after 0.1 seconds.
    Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.__init__”, line 376, in KindleMobiDecrypt
    File “calibre_plugins.dedrm.k4mobidedrm”, line 214, in GetDecryptedBook
    File “calibre_plugins.dedrm.mobidedrm”, line 467, in processBook
    DrmException: No key found in 0 keys tried.
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “site-packagescalibrecustomizeui.py”, line 155, in _run_filetype_plugins
    File “calibre_plugins.dedrm.__init__”, line 467, in run
    File “calibre_plugins.dedrm.__init__”, line 418, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.0.5: Ultimately failed to decrypt “Fool’s Assassin (Fitz and the Fool, Book 1).azw3” after 0.1 seconds with error: No key found in 0 keys tried.
    Read the FAQs at Alf’s blog: https://apprenticealf.wordpress.com/
    Added Fool’s Assassin (Fitz and the Fool, Book 1) to db in: 0.3
    Added 1 books in 2.2 seconds
    Worker Launch took: 0.283999919891
    Worker Launch took: 0.27999997139
    Job: 2 Convert book 2 of 2 (Fool’s Quest (Fitz and the Fool, Book 2)) finished
    Convert book 2 of 2 (Fool’s Quest (Fitz and the Fool, Book 2))
    Resolved conversion options
    calibre version: 2.30.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\petervg\AppData\Local\Temp\calibre_fgi5tt\lmx9p2.jpeg’,
    ‘debug_pipeline’: None,
    ‘dehyphenate’: True,
    ‘delete_blank_paragraphs’: True,
    ‘disable_font_rescaling’: False,
    ‘dont_compress’: False,
    ‘duplicate_links_in_toc’: False,
    ’embed_all_fonts’: False,
    ’embed_font_family’: None,
    ‘enable_heuristics’: False,
    ‘expand_css’: False,
    ‘extra_css’: None,
    ‘extract_to’: 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,
    ‘mobi_file_type’: u’old’,
    ‘mobi_ignore_margins’: False,
    ‘mobi_keep_original_images’: False,
    ‘mobi_toc_at_start’: False,
    ‘no_chapters_in_toc’: False,
    ‘no_inline_navbars’: False,
    ‘no_inline_toc’: False,
    ‘output_profile’: ,
    ‘page_breaks_before’: u”//*[name()=’h1′ or name()=’h2′]”,
    ‘personal_doc’: u'[PDOC]’,
    ‘prefer_author_sort’: False,
    ‘prefer_metadata_cover’: False,
    ‘pretty_print’: False,
    ‘pubdate’: None,
    ‘publisher’: None,
    ‘rating’: None,
    ‘read_metadata_from_opf’: u’C:\Users\petervg\AppData\Local\Temp\calibre_fgi5tt\qwxosm.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,
    ‘share_not_sync’: False,
    ‘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 C:UserspetervgAppDataLocalTempcalibre_fgi5tthrb_li.azw3
    Found KF8 MOBI of type ‘standalone’
    Python function terminated unexpectedly
    Fool’s Quest (Fitz and the Fool, Book 2) (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-packagescalibreutilsipcworker.py”, line 193, in main
    File “site-packagescalibregui2convertgui_conversion.py”, line 31, in gui_convert_override
    File “site-packagescalibregui2convertgui_conversion.py”, line 25, in gui_convert
    File “site-packagescalibreebooksconversionplumber.py”, line 1042, in run
    File “site-packagescalibrecustomizeconversion.py”, line 241, in __call__
    File “site-packagescalibreebooksconversionpluginsmobi_input.py”, line 43, in convert
    File “site-packagescalibreebooksmobireadermobi8.py”, line 81, in __call__
    File “site-packagescalibreebooksmobireadermobi6.py”, line 143, in check_for_drm
    calibre.ebooks.DRMError: Fool’s Quest (Fitz and the Fool, Book 2)

    Job: 3 Convert book 1 of 2 (Fool’s Assassin (Fitz and the Fool, Book 1)) finished
    Convert book 1 of 2 (Fool’s Assassin (Fitz and the Fool, Book 1))
    Resolved conversion options
    calibre version: 2.30.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\petervg\AppData\Local\Temp\calibre_fgi5tt\pxwb7r.jpeg’,
    ‘debug_pipeline’: None,
    ‘dehyphenate’: True,
    ‘delete_blank_paragraphs’: True,
    ‘disable_font_rescaling’: False,
    ‘dont_compress’: False,
    ‘duplicate_links_in_toc’: False,
    ’embed_all_fonts’: False,
    ’embed_font_family’: None,
    ‘enable_heuristics’: False,
    ‘expand_css’: False,
    ‘extra_css’: None,
    ‘extract_to’: 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,
    ‘mobi_file_type’: u’old’,
    ‘mobi_ignore_margins’: False,
    ‘mobi_keep_original_images’: False,
    ‘mobi_toc_at_start’: False,
    ‘no_chapters_in_toc’: False,
    ‘no_inline_navbars’: False,
    ‘no_inline_toc’: False,
    ‘output_profile’: ,
    ‘page_breaks_before’: u”//*[name()=’h1′ or name()=’h2′]”,
    ‘personal_doc’: u'[PDOC]’,
    ‘prefer_author_sort’: False,
    ‘prefer_metadata_cover’: False,
    ‘pretty_print’: False,
    ‘pubdate’: None,
    ‘publisher’: None,
    ‘rating’: None,
    ‘read_metadata_from_opf’: u’C:\Users\petervg\AppData\Local\Temp\calibre_fgi5tt\yeupyp.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,
    ‘share_not_sync’: False,
    ‘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 C:UserspetervgAppDataLocalTempcalibre_fgi5tty1cgu9.azw3
    Found KF8 MOBI of type ‘standalone’
    Python function terminated unexpectedly
    Fool’s Assassin (Fitz and the Fool, Book 1) (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-packagescalibreutilsipcworker.py”, line 193, in main
    File “site-packagescalibregui2convertgui_conversion.py”, line 31, in gui_convert_override
    File “site-packagescalibregui2convertgui_conversion.py”, line 25, in gui_convert
    File “site-packagescalibreebooksconversionplumber.py”, line 1042, in run
    File “site-packagescalibrecustomizeconversion.py”, line 241, in __call__
    File “site-packagescalibreebooksconversionpluginsmobi_input.py”, line 43, in convert
    File “site-packagescalibreebooksmobireadermobi8.py”, line 81, in __call__
    File “site-packagescalibreebooksmobireadermobi6.py”, line 143, in check_for_drm
    calibre.ebooks.DRMError: Fool’s Assassin (Fitz and the Fool, Book 1)

    • The Kindle tools work on books from Kindle for PC/Mac, eInk Kindles, or Kindle for Android. That book isn’t from Kindle for PC, and you haven’t entered either the eInk Kindle’s serial number, nor set up for Kindle for Android decryption by importing a backup file.

  22. Not really an answer for the above, but I really would appreciate some help with this. I’d love to use the standalone tools, but they are no longer being offered as a commandline version for Linux. Anyway, if anyone can shed light on it, here’s the information.

    I installed Calibre on my netbook, and am getting the following problem that I don’t get on Calibre on Ubuntu 15.10 on my PC. I am away from home, so can’t access that, and so tried installing the Calibre plugin on the netbook. I got the following problems – Oh, I can’t use Wine on this installation – the Wine msi installer fix hasn’t been backported to 15.04 yet. Any kind thoughts on the above, so I can use the plugin while still away from home?

    Ubuntu 15.04 calibre, version 2.20.0 TRIED 6.3.3 calibre On attempting to add a book, it fails with the following error (Calibre, not debug output) :
    calibre, version 2.20.0
    ERROR: Cannot add books: Failed to add some books, click “Show details” for more information.
    Worker process crashed while executing job
    Traceback (most recent call last):
    File “/usr/lib/calibre/calibre/utils/ipc/pool.py”, line 103, in recv
    result = cPickle.loads(eintr_retry_call(self.conn.recv_bytes))
    File “/usr/lib/calibre/calibre/utils/ipc/__init__.py”, line 19, in eintr_retry_call
    return func(*args, **kwargs)
    EOFError

    Plugin version 6.0.9 fails with the following error:
    calibre, version 2.20.0
    ERROR: Cannot add books: Failed to add some books, click “Show details” for more information.

    Worker process crashed while executing job
    Traceback (most recent call last):
    File “/usr/lib/calibre/calibre/utils/ipc/pool.py”, line 103, in recv
    result = cPickle.loads(eintr_retry_call(self.conn.recv_bytes))
    File “/usr/lib/calibre/calibre/utils/ipc/__init__.py”, line 19, in eintr_retry_call
    return func(*args, **kwargs)
    EOFError

  23. Sorry . I forgot to include the commandline debug output when trying to use 6.3.3. It is:
    calibre, version 2.20.0
    calibre, version 2.20.0
    ERROR: Unhandled exception: KeyError:’androidkeys’

    calibre 2.20 isfrozen: False is64bit: True
    Linux-3.19.0-25-generic-x86_64-with-Ubuntu-15.04-vivid Linux (’64bit’, ‘ELF’)
    (‘Linux’, ‘3.19.0-25-generic’, ‘#26-Ubuntu SMP Fri Jul 24 21:17:31 UTC 2015’)
    Python 2.7.9
    Linux: (‘Ubuntu’, ‘15.04’, ‘vivid’)
    Successfully initialized third party plugins: DeDRM
    Traceback (most recent call last):
    File “/usr/lib/calibre/calibre/gui2/preferences/plugins.py”, line 292, in customize_plugin
    self.modify_plugin(op=’customize’)
    File “/usr/lib/calibre/calibre/gui2/preferences/plugins.py”, line 370, in modify_plugin
    if plugin.do_user_config(self.gui):
    File “/usr/lib/calibre/calibre/customize/__init__.py”, line 154, in do_user_config
    config_widget = self.config_widget()
    File “calibre_plugins.dedrm.__init__”, line 613, in config_widget
    File “calibre_plugins.dedrm.config”, line 57, in __init__
    File “calibre_plugins.dedrm.prefs”, line 50, in __getitem__
    File “/usr/lib/calibre/calibre/utils/config.py”, line 398, in __getitem__
    return self.defaults[key]
    KeyError: ‘androidkeys’

    • This might be a mismatch between the Python libraries. Are you sure you have 2.7 on the system and not just a 3.x? If you have both, are you sure it’s linking to the correct library?

    • Line 50 of config.py in the 6.3.3 version of the plugin is a blank line, not anything that could give that error (line 53 would – which was line 50 before the changes in 6.3.x). So I think that somehow calibre is getting confused with two versions of the plugin – perhaps you didn’t restart calibre after installing 6.3.3?

      All the stand-alone tools are still available – just unzip the plugin and you’ll find them all. I would advise running them from the unzipped plugin folder, as there are some dependencies, especially in the Kindle files.

      • Thanks. That will almost certainly get me out of trouble. deadman’s comment about the Python installation has pointed me to the problem. This installation is using the Ubuntu defaults, ans currently has only Python 3.4. My desktop back home has been running Ubuntu 1.10 since early pre-alpha. As it has all the updates since that time, it very likely has 3.4 and a earlier version installed. I’ll check when I get back home. Whatever, the plugin did not install properly on this machine, hence the problem. Calibre runs and converts OK, but the badly installed plugin causes the failure. I’ll make notes after I get home and post anything helpful I get. Thanks again.

          • Back home – so more to the story. Ubuntu 15.04 on my desktop has Python 2.7.10. The laptop has 3.4. This shows the problem. The standalone from the plugin zipfile worked just fine. The book it produces opens OK with the book reader supplied with Calibre.
            I now know that the problem occurs when importing the deDRMd book. This is a Calibre problem. Importing the same book into Calibre using ‘Add Books’ also causes a crash. I put a hack into ineptepub.py and _init_.py to show what it is doing and what it has by way of the user key etc. and it returns from that ineptepub.py just fine. The crash occurs when it calls the ‘Add Books’ method in Calibre. It crashes the plugin with a segmentation fault in Python.
            My own workaround will be to put Ubuntu 15.10 on the laptop. It is in the final pre-release version, so is very stable.
            The problem has been auto-reported as a Calbre bug, so hopefully, should be known.

            Thanks for all your help. And I’ve enjoyed re-visiting Python briefly. My main language was C – but I haven’t been an active programmer for years. I bought a couple of Python books and downloaded a few more three years or so back. I offered to help the year six kids in the local junior school, but they only get as far as playing with ‘Scratch’, so I never took my knowledge of Python any further than very simple stuff.

            • Great to hear you found out why things weren’t working.

              Though, out of curiosity… why not just install Python 2.7.x on the laptop alongside 3.x rather than Ubuntu 15.10? Both libraries should be able to live together in harmony, I believe.

              • Simple – there are several other annoying bugs. Wine has been broken in Ubuntu since 14.10 and has not been fixed in 15.05 yet. It cannot open Microsoft msi files so I can’t install Python etc. under Wine … and so on. I’ve been reporting this and pushing for a backport ever since the fix was finally included in 15.10, but so far no joy – and I’m surprised as 15.04 is supposed to be long term support.

                I’ve been using Mint on a dual boot (two hard drives) installation on my PC until the Wine fix got into 15.10.

                I think it is possible to have both versions of Python co-existing, but I was going to install 15.10 on the laptop anyhow at the end of October, so why not now?

                • I would recommend that you look into “playonlinux”. It allows you to manage multiple wine versions and different virtual drives for each application. Specifically, it doesn’t rely on the distribution’s version of wine, instead fetching, installing, and maintaining different versions of wine directly from the upstream source. It is by far the easiest way to install the Kindle app for PC under Linux. It has a built-in recipe for that, so it’s pretty much a one click and go, then you can add Python on top of that.

                  • Do you know, I’ve helped several people to re-install stuff under Wine, and not playonlinux. The problem is that the Calibre plugin can’t find stuff that’s installed under playonlinux unless you can give it the proper prefix – then you find that Kindle and ADE use a different prefix. I had three or four folk that had to get rid of playonlinux for that reason. Try it and see.

                    • Yes, you do need to configure Calibre with the correct paths to your virtual disks, but that’s comparatively easy to do, and the DeDRM plugins fully support having a separate wine prefix for ADE and Kindle. Just click “Customize plugin”, then “Adobe Digital Editions ebooks”, enter the WINEPREFIX for that (I have “/home/sharkey/PlayOnLinux’s virtual drives/ADE”) then click “Kindle for MacPC ebooks” and enter the WINEPREFIX for that (“/home/sharkey/PlayOnLinux’s virtual drives/amazonkindle”). The harder part seems to be just getting ADE 2.x to run at all given the state of .NET support.

                      Wine related stuff seems to be pretty fragile. It’s easy to break one application just by adding a library needed for another. With a completely separate prefix for each group of related applications that need to interoperate, if you screw things up too badly you can just blow away one disk and reinstall that one application without affecting other applications. Luckily disk space is cheap these days.

                  • I know it’s possible to use the right wineprefixes but hard to describe to someone who is lees than familiar with Unix styly conventions, or the directory structure within the playonlinux pseudo environments. As for me, I only need ADE to run under Wine. I’m going to be in trouble if they stop me from using the old version.

                    I no longer use Kindle, but I did get an email saying that the last Kindle-for-pc that I registered will shortly no longer be supported. That’s going to cause a headache for a lot of good folk! Regards, Barry,

                    • I know for sure that Google Play has already stropped the use of ADE 1.7.2 and requires the latest 2.0.1 version ADE to be able to download. It is very possible other shops have done or will do the same thing. So using ADE 1.7.2 my be not long for this world.

                    • Ditto Kindle for Mac. I wish what is their definition of “unsupported”; if it just means that no new features, bug fixes, etc., then fine, I could still use it on my Mac running Mac OS 10.8.5. If not, then I have the choice of ditching Kindle books or buying a new Mac just to run K4M.

                • Huh. I wasn’t even aware that Wine was broken on Ubuntu. Good to know. Thanks for taking the time to satisfy my curiosity!

                    • Ouch! Never, never, never again. Windows seems OK on the surface, but if you’re a programmer, you’ll know it as …. can’t say it without being inappropriate …. Regards, Barry.

  24. Thank you for this. It took a little while for me to realize that books downloaded for another Kindle device cannot be decrypted unless I download them again through my PC Kindle reading program. Once I figured that out, everything worked great on my Ubuntu 14.04 installation. Thank you very much for providing the detailed instructions in the readme file!

  25. I was unable to get Nook Study to work under wine, so I couldn’t use that approach to downloading the epubs and extracting the keys to decrypt them. However, I could install the Nook app onto my (rooted) Android phone and download the books that way (they end up in /data/data/bn.ereader/files/B&N Downloads/Books)… but they were of course still encrypted. Fortunately, the key wasn’t too hard to find. So if you have some B&N books and a *rooted* Android phone/tablet:
    1. Install the Nook app on your phone.
    2. Open the app, sign in, open the books in question.
    3. Connect to a PC; “adb root”; “adb shell”.
    4. Find the app’s data – it’s in /data/data/bn.ereader
    5. Find the DRM’d epubs – they’re in /data/data/bn.ereader/files/B&N Downloads/Books; copy them to your PC with “adb pull” (due to the space in the filename, you may need to make a copy somewhere else on your phone’s filesystem and pull from there).
    6. Find the key. It’s stored in /data/data/bn.ereader/databases/cchashdata.db and it’s easy to get out of there:
    sqlite3 /data/data/bn.ereader/databases/databases/cchashdata.db
    sqlite> select * from cc_hash_data;
    1|100|YOUR_KEY_WILL_BE_HERE|BLANK
    Wrap the key in some double quotes, put it into a file called “my_key.b64” on your PC, and import that into the DeDRM plugin, then add the epubs pulled off in step 5.

    • FYI, the tools now have a method to get the B&N key without Nookstudy. You just enter your B&N account email and password. Of course, this is still good to know for another method to get the actual book files. For most accounts, B&N has only one encryption key instead of having different keys for each device/app. (The only exception I’ve heard is that occasionally Nookstudy will have its own unique key.)

      • I have been having a similar problem to Robert’s without the happy result–I still can’t figure out how to get Nookstudy to let me log in. What is this other method for getting a B & N key? Where do I enter a BN account ID and password? I have found several places where this doesn’t work :-).

        thanks,

        Clair

          • I thought I had it–I created a new key in Calibre, and tried it with my B& N password (fail) and with my credit card # (fail). Am I not holding my mouth right?

            • It should be your B&N account email and password. On your way out of the dialog boxes be sure to click ok and apply. Then close and reopen calibre before importing your books. Also be sure they are new downloads of the books.

              (About logging in to Nookstudy, do you have Adobe Digital Editions installed? If the email for your Adobe ID and B&N account are different, it can cause a conflict. Of course, if you can get the key with the other method, then you don’t need to worry about it.)

  26. Obok alternative approach

    Since Kobo changed the desktop, wouldn’t it be possible to change the approach and try to decrypt directly from the device? I have adapted the obok.py script a bit so that it reads the database from the device, uses the MAC address from the device. After that I can run the script and get a selection of the books, but decryption failed, unfortunately.

    If we can find the encryption method from the device it would be easier, as they have to provide backward compatibility with older devices, and so the encryption method will not change (my guess).

    Anyone has an idea what could be different on the device?

    Thanks

    • Not everyone with Kobo books has a Kobo device. But it would be nice to have the option for both methods. I think Obok will be back in business with the new desktop app before too long though. In the meantime, people can try to install the older desktop app or use ADE — I haven’t seen or heard of any kepub only books in a while.

    • I’m pretty willing to dig into what changed in the new Kobo app that broke Obok, but before I do that, I’d like to make reasonably sure that Alf and friends aren’t already well into the case. Something like this actually happened to me with the original Obok version, because back then hardly anyone knew of its existence and nothing came on my Internet searches, so I ended up cracking the encryption code on my own, only to discover right after that it had already been done… While I enjoy doing this type of work, it does take some time and it’s better not to reinvent the wheel if it can be helped..

    • I’m quite willing to dig into what changed in the new Kobo app that broke Obok, but before I do that, I’d like to make reasonably sure that Alf and friends aren’t already well into the case. Something like this actually happened to me with the original Obok version, because back then hardly anyone knew of its existence and nothing came on my Internet searches, so I ended up cracking the encryption code on my own, only to discover right after that it had already been done… While I enjoy doing this type of work, it does take some time and it’s better not to reinvent the wheel if it can be helped..

      • Hey, would be great. I would love to have Obok enriched to work either with the Desktop installation on Windows, or the actual device. I have tried a few things, but lack the experience. If you have some hints, let me know.

  27. Don’t know if this makes any difference but Calibre has new version 2.35 out with the following included:

    Kobo driver: Add support for the new firmware version 3.17

    • The Kobo driver has not changed other than to not warn you about a newer database version. The database format has not changed but the change in the Kobo driver just removes the warning. So no difference at all.

  28. Hi ,drm removal is not working for me. I wanted to read a book my wife has bought on my Kindle rather than hers but no joy. I have bought a second hand copy but I’d rather have it on my Kindle, … anyway here is the debug log file from the input to Calibre:

    Microsoft Windows [Version 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. All rights reserved.

    C:\Users\ricobasso>calibre-debug -g
    calibre 2.35 [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
    Starting up…
    Started up in 2.45 seconds with 0 books
    DeDRM v6.3.3: Trying to decrypt The Silkworm (Cormoran Strike Book 2)_B00IHZNWZU
    .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 Silkworm (Cormoran Strike)
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.3.3: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.3.3: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\ricobasso\AppData\Local
    No K4PC kindle.info/kinf/kinf2011 files have been found.
    DeDRM v6.3.3: 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_plugi
    ns
    File “calibre_plugins.dedrm.__init__”, line 589, in run
    File “calibre_plugins.dedrm.__init__”, line 539, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.3.3: Ultimately failed to decrypt after 0.1 seconds
    Added The Silkworm (Cormoran Strike) to db in: 4.0
    Added 1 books in 5.2 seconds
    Worker Launch took: 0.307999849319
    Job: 1 Convert book 1 of 1 (The Silkworm (Cormoran Strike)) finished
    Convert book 1 of 1 (The Silkworm (Cormoran Strike))
    Resolved conversion options
    calibre version: 2.35.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*((ch
    apter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))’, ‘i’)) or @c
    lass = ‘chapter’]”,
    ‘chapter_mark’: u’pagebreak’,
    ‘comments’: None,
    ‘cover’: u’C:\\Users\\RICOBA~1\\AppData\\Local\\Temp\\calibre_1qfo0x\\s
    5je0l.jpeg’,
    ‘debug_pipeline’: None,
    ‘dehyphenate’: True,
    ‘delete_blank_paragraphs’: True,
    ‘disable_font_rescaling’: False,
    ‘dont_compress’: False,
    ‘duplicate_links_in_toc’: False,
    ’embed_all_fonts’: False,
    ’embed_font_family’: None,
    ‘enable_heuristics’: False,
    ‘expand_css’: False,
    ‘extra_css’: None,
    ‘extract_to’: 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,
    ‘mobi_file_type’: u’old’,
    ‘mobi_ignore_margins’: False,
    ‘mobi_keep_original_images’: False,
    ‘mobi_toc_at_start’: False,
    ‘no_chapters_in_toc’: False,
    ‘no_inline_navbars’: True,
    ‘no_inline_toc’: False,
    ‘output_profile’: ,
    ‘page_breaks_before’: u”//*[name()=’h1′ or name()=’h2′]”,
    ‘personal_doc’: u'[PDOC]’,
    ‘prefer_author_sort’: False,
    ‘prefer_metadata_cover’: False,
    ‘pretty_print’: False,
    ‘pubdate’: None,
    ‘publisher’: None,
    ‘rating’: None,
    ‘read_metadata_from_opf’: u’C:\\Users\\RICOBA~1\\AppData\\Local\\Temp\\
    calibre_1qfo0x\\ypnjkq.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,
    ‘share_not_sync’: False,
    ‘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 C:\Users\RICOBA~1\AppData\Local\Temp\calibre_1qfo0x\wkzwgz.azw3
    Found KF8 MOBI of type ‘standalone’
    Python function terminated unexpectedly
    The Silkworm (Cormoran Strike) (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 __c
    all__
    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: The Silkworm (Cormoran Strike)

    • If your wife’s Kindle is an E-ink model, then put its serial number into the configuration dialog. Otherwise, install Kindle for PC, log into it with her account, and download the book that way.

      (As an alternative, look at setting up Amazon Family Library.)

  29. Okay, I’ve been working on removing the DRM from an Adobe Digital Editions PDF & Epub (same book in both formats) for several hours today, but I haven’t had any luck. I’ve tried most of the DRM removal tools (e.g., ePUBee, etc.), in addition to the DeDRM 6.3.3 calibre plugin and Windows application. I just can’t get it to work. Below is an overview of the problem:

    – I cannot open the ADE file (PDF) by navigating to Documents > My Digital Editions and clicking on the downloaded file. ADE opens and displays a message that the file name would be too long and that I should try to shorten it. Shortening the file name only leads to an error that the file cannot be opened. HOWEVER, if I open ADE and then click on the book, it opens fine. I had this problem before with a different file but I cannot remember how I resolved it to remove the DRM.

    – Using another program (epubor) I received an error message that the book does not have a key. I tried to run the ADE keyscript (adobekey.pyw), but I got an error: Failed to decrypt use key key (sic).

    – The DeDRM Windows application fails to remove the DRM.

    I’ve de-authorized and reauthorized ADE. I’ve uninstalled and reinstalled ADE (tried with versions 2, 3, and 4, to no avail). And now I’m just stumped. I can’t figure out what the problem is. Does anyone have any suggestions?

    Below is my Calibre error log generated after I attempted to remove DRM from the ePub, but it’s not very useful since I don’t even believe the plugin could access the file to decrypt it. It looks like the problem is with the key (either the wrong one or the absence of a key) and I don’t know what to do about that.

    I greatly appreciate any help someone might be able to give me!

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

    calibre Debug log
    calibre 2.35 [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 && K4PC, K4Mac, Kindle Mobi and Topaz DeDRM && Inept Epub DeDRM && Inept PDF DeDRM && Ignoble Epub DeDRM && eReader PDB 2 PML
    Starting up…
    Started up in 16.19 seconds with 0 books
    DeDRM v6.3.3: Trying to decrypt Relations.epub
    DeDRM v6.3.3: Verifying zip archive integrity
    DeDRM v6.3.3: Relations.epub is a secure Adobe Adept ePub
    DeDRM v6.3.3: Trying Encryption key calibre-adeptkey
    Could not decrypt nyf4tb.epub. Wrong key
    DeDRM v6.3.3: Failed to decrypt with key calibre-adeptkey after 0.1 seconds
    DeDRM v6.3.3: Looking for new default Adobe Digital Editions Keys after 0.1 seconds
    DeDRM v6.3.3: Exception when getting default Adobe Key after 0.1 seconds
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.__init__”, line 317, in ePubDecrypt
    File “calibre_plugins.dedrm.adobekey”, line 378, in adeptkeys
    File “calibre_plugins.dedrm.adobekey”, line 358, in CryptUnprotectData
    ADEPTError: Failed to decrypt user key key (sic)
    DeDRM v6.3.3: 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 600, in run
    File “calibre_plugins.dedrm.__init__”, line 371, in ePubDecrypt
    DeDRMError: DeDRM v6.3.3: Ultimately failed to decrypt after 0.1 seconds.
    IneptEpub: Using pycrypto.
    IneptEpub: Calibre configuration directory = C:\Users\*User name*\AppData\Roaming\calibre
    IneptEpub: Keyfile calibre-adeptkey.der found in config folder.
    IneptEpub: Encryption key invalid… trying others.
    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
    IgnobleEpub: Using PyCrypto.
    IgnobleEpub: Calibre configuration directory = C:\Users\*User name*\AppData\Roaming\calibre
    IgnobleEpub: No keyfiles found. Checking plugin customization string.
    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 319, in run
    IGNOBLEError: IgnobleEpub – No keys found. Plugin not configured.
    Added Relations to db in: 1.4
    Added 1 books in 2.2 seconds
    Exception TypeError: “‘NoneType’ object is not callable” in <bound method NativeFunction.__del__ of > ignored
    Worker Launch took: 0.0889999866486

    • Work only on the ePub for a while. Remove all the DRM removal plugins except DeDRM. Make sure that the ePub will open in ADE. In the DeDRM plugin customisation dialog for ADE ePubs, try clicking the green + sign to add the default ADE key to the list.

      Then post another import log.

      Ummm… you did download the ePub by opening a .acsm file in ADE didn’t you?

  30. Paul,

    Thanks for the response.

    Yes, I downloaded the Epub by opening a .acsm file, and I can open the file through ADE.

    The problem is that I cannot add an ADE key. When I click the green plus to add a key, I get an error: The default encryption key for Adobe Digital Editions could not be found. Similarly, I tried to run the ADE keyscript (adobekey.pyw), but I got an error: Failed to decrypt use key key (sic). This same error is in the log.

    I removed all the other plugins and tried again. The log is below

    calibre Debug log
    calibre 2.35 [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 5.11 seconds with 0 books
    DeDRM v6.3.3: Trying to decrypt Relations.epub
    DeDRM v6.3.3: Verifying zip archive integrity
    DeDRM v6.3.3: Relations.epub is a secure Adobe Adept ePub
    DeDRM v6.3.3: Trying Encryption key calibre-adeptkey
    Could not decrypt 4g7i_w.epub. Wrong key
    DeDRM v6.3.3: Failed to decrypt with key calibre-adeptkey after 0.1 seconds
    DeDRM v6.3.3: Looking for new default Adobe Digital Editions Keys after 0.1 seconds
    DeDRM v6.3.3: Exception when getting default Adobe Key after 0.1 seconds
    Traceback (most recent call last):
    File “calibre_plugins.dedrm.__init__”, line 317, in ePubDecrypt
    File “calibre_plugins.dedrm.adobekey”, line 378, in adeptkeys
    File “calibre_plugins.dedrm.adobekey”, line 358, in CryptUnprotectData
    ADEPTError: Failed to decrypt user key key (sic)
    DeDRM v6.3.3: 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 600, in run
    File “calibre_plugins.dedrm.__init__”, line 371, in ePubDecrypt
    DeDRMError: DeDRM v6.3.3: Ultimately failed to decrypt after 0.1 seconds.
    Added Relations to db in: 1.6
    Added 1 books in 2.3 seconds
    Exception TypeError: “‘NoneType’ object is not callable” in <bound method NativeFunction.__del__ of > ignored
    Worker Launch took: 0.0929999351501

      • Paul,

        Yes, I am working with ADE 2.0.1 and I can read the ePub. I have also tried the most recent version, in which I can also read the book, but it does nothing to help the de-drm problem!

        Joseph

        • OK, since it’s not a new encryption scheme problem(since you can read the book with ADE 2), I suspect the problem is just a clutter of info from various versions in the registry. Try this: Delete ADE again, but this time make sure you clear any Adobe entries from the Preferences *and* from the registry. Make sure there’s no trace of ADE left on your computer. The install ADE 2.0.1 and register it with your Adobe ID. The plugin should then be able to retrieve your ADE decryption key. Check in the plugin’s preferences that this works (the green + sign). If it does, try importing the book again. If it doesn’t, post a log of what happens when you press the green + button in the plugin’s customisation dialog.

  31. I’m trying to test this out by decrypting a free book from Google Books. I’m running Linux and was able to get Adobe Digital Editions 1.7 installed under Wine and tried to import the .ascm file into ADE. That failed with a network error (IO Error on Network Request. Please check your network connection and try again.). It printed out URL that failed. I tried pasting the URL into a browser, and it downloaded an epub file, and this file opens and is readable in ADE.

    Now, when I open the same epub in Calibre, I can’t read it. The log says:

    DeDRM v6.3.3: Trying to decrypt The_War_of_the_Worlds.epub
    DeDRM v6.3.3: Verifying zip archive integrity
    DeDRM v6.3.3: “The_War_of_the_Worlds.epub” is neither an Adobe Adept nor a Barnes & Noble encrypted ePub
    Running file type plugin DeDRM failed with traceback:
    Traceback (most recent call last):
    File “/usr/lib/calibre/calibre/customize/ui.py”, line 155, in _run_filetype_plugins
    nfp = plugin.run(path_to_file)
    File “calibre_plugins.dedrm.__init__”, line 600, in run
    File “calibre_plugins.dedrm.__init__”, line 376, in ePubDecrypt
    DeDRMError: DeDRM v6.3.3: Couldn’t decrypt after 0.2 seconds. DRM free perhaps?
    Added The War of the Worlds to db in: 0.2
    Added 1 books in 1.4 seconds

    Trying to read the book in Calibre results in a “This book is locked by DRM” dialog.

    Any clue what I might have done wrong? Why does DeDRM not recognize the encryption?

    • I’ve seen this error on Adobe DRMed ebooks before. Something that it checks for doesn’t quite match what the plugin expects. Not sure how to fix it. But since it doesn’t think it’s an ADE epub, it doesn’t even try to open it with that key. Something might need to be adjusted with the plugin itself.

      • Thanks. I took a look.

        It looks like this is the function which makes the determination:

        # check file to make check whether it’s probably an Adobe Adept encrypted ePub
        def adeptBook(inpath):
        with closing(ZipFile(open(inpath, ‘rb’))) as inf:
        namelist = set(inf.namelist())
        if ‘META-INF/rights.xml’ not in namelist or \
        ‘META-INF/encryption.xml’ not in namelist:
        return False
        try:
        rights = etree.fromstring(inf.read(‘META-INF/rights.xml’))
        adept = lambda tag: ‘{%s}%s’ % (NSMAP[‘adept’], tag)
        expr = ‘.//%s’ % (adept(‘encryptedKey’),)
        bookkey = ”.join(rights.findtext(expr))
        if len(bookkey) == 172:
        return True
        except:
        # if we couldn’t check, assume it is
        return True
        return False

        marvin% unzip -v The_War_of_the_Worlds.epub
        Archive: The_War_of_the_Worlds.epub
        Length Method Size Cmpr Date Time CRC-32 Name
        ——– —— ——- —- ———- —– ——– —-
        20 Stored 20 0% 2015-08-16 14:42 2cab616f mimetype
        36062 Defl:N 974 97% 2015-08-16 14:42 cf9308e9 META-INF/encryption.xml
        248 Defl:N 156 37% 2015-08-16 14:42 bf70a63e META-INF/container.xml
        [lots of files under ops/]
        162 Defl:N 119 27% 2015-08-16 14:42 bb6a8f22 META-INF/com.apple.ibooks.display-options.xml
        ——– ——- — ——-
        2184154 2140219 2% 88 files

        There’s no META-INF/rights.xml, so it’s rejected. This file is required?

        • As far as I know, it’s an important piece of the DRM. But that’s pretty much the extent of my knowledge.

          Something to try: Download a new copy of the .acsm file. Make sure your copy of ADE 1.7 is authorized with your Adobe ID, and try opening the new .acsm file. Maybe it was just an issue with the epub fulfillment.

          • I repeated the steps and it repeated the same results. I now have a new epub file, also with no rights.xml.

            In any case, I don’t see how this could be a problem with epub fulfillment, since the book opens up and I can read it just fine in ADE 1.7. Clearly, the file must have everything in it necessary to be decrypted.

            • Yes, that’s true. But for whatever reason, ADE is able to find that info, and the plugin isn’t. Hopefully, someone else will have a better idea.

              I do remember someone mentioning that they downloaded comics with the B&N Windows Store Nook app, and the rights.xml was stored separately from the actual epub. Once they put it back, they were able to decrypt it. I haven’t seen or heard of this happening with Google though. But perhaps you’ve discovered something new. (I hope not!) Have you been able to DeDRM any other Adobe Adept epub files?

              • Ok, I’m really confused.

                ADE must have the key in RAM somewhere. If I delete the file from the ADE library, I can re-import the epub just fine, but if I delete it, then restart ADE, then import the epub, it fails with W_PKG_PAGEMAP_UNREADABLE. I need to re-paste the .acsm file (which again fails to download with a network error), and then I can load the same .epub which just failed to import previously. I do not need to download the epub again. Clearly the epub is not enough, something in the acsm is required to decrypt the book.

                The plugin appears to be looking for a 172 character base64 encoded string. I don’t see anything like that in the acsm file.

                I used tcpdump to monitor network activity when I paste the acsm file into ADE and verified that nothing happens on the network at all. No packets in or out. It doesn’t seem to be fetching the key from any external source.

                I tried three more books. Two were already unencrypted, and the third (The Time Machine) has the same behavior as The War of The Worlds. Weird.

                • Ok, I downloaded The War of the Worlds from Google via ADE 2.0, and it had rights.xml. I was able to decrypt it with no issues.

                  It seems that downloading the epub with the URL instead of through ADE is giving you a file that for whatever reason the tools can’t decrypt.

                  I would start completely over with ADE. And since the files you’ve been trying are freebies, I would delete them from your Google library and add them again (that way they’re reset just in case they weren’t tied to your Adobe ID or something). If you get ADE 2.0 or earlier working properly, then you should have a normal Adobe Adept epub that will work with the DeDRM plugin.

                  • Thanks, Laura. I’ll see if I can get a newer version of ADE running. I tried 4.0 and failed completely since I couldn’t seem to get .NET to install at all, and 4.0 needs .NET.

                    • You do not want to install any version of ADE past 2.x (I think the latest 2.x is 2.01). The reason being is that ADE 3 on up has the ability to use a new DRM that the tools cannot handle. You risk getting an ePub that cannot have the DRM removed.

                    • Thanks. I borrowed a Windows computer and installed ADE 2.0.1, re-downloaded the epub, copied it back to my Linux machine and loaded it in to Calibre and it decrypted just fine (this copy had a rights.xml).

                      Unfortunately, I’ve completely failed at getting it to install under wine (because the required .NET libraries fail to install), and although I did install it in a windows xp virtual box vm, the display was garbled and the menus non-responsive.

                    • ADE 1.7.2 does not work all the time. For example, when downloading ePub from Google, you have to have the latest version ADE 2.01 for the ePub download to work. If you cannot get ADE 2.01 to work under Wine, then it’s time to install Windows because there will most likely be more cases of needing ADE 2.01 and ADE 1.7.2 just won’t work.

                      For those running Linux, I suggest you dual boot with Windows.

            • Without a rights.xml file the decryption doesn’t work. ADE must be picking up the info from somewhere else.

              Although I suppose you could try changing the code to ignore the rights.xml file and see what happens.

            • I just downloaded and decrypted War of the Worlds from Google using ADE 2.0.1. I don’t see a rights.xml, only the META-INF/com.apple.ibooks.display-options.xml. I am still using the 6.1.0 dedrm – it still works so I haven’t updated.

  32. Hi Alf
    I ma trying to install the plug in but get this error

    calibre, version 2.35.0
    ERROR: Unhandled exception: InvalidPlugin:The plugin in u’C:/Users/Davenew/Downloads/DeDRM_tools_6.3.3.zip’ is invalid. It does not contain a top-level __init__.py file

    calibre 2.35 [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/Davenew/Downloads/DeDRM_tools_6.3.3.zip’ is invalid. It does not contain a top-level __init__.py file

    • Dave,

      Don’t use the top-level DeDRM folder when trying to install the plugin; instead, use the zip file in DeDRM_tools_6.3.3 > DeDRM_calibre_plugin.

  33. I have installed the DRM Tools but I receive an error using Linux.

    DeDRM is not finding Kindle for PC (under WINE) decrypt keys.

    calibre-debug -g
    calibre 2.32.1 isfrozen: True is64bit: False
    Linux-4.1.4-1-ARCH-i686-with-glibc2.0 Linux (’32bit’, ‘ELF’)
    (‘Linux’, ‘4.1.4-1-ARCH’, ‘#1 SMP PREEMPT Mon Aug 3 21:53:10 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 5.78 seconds with 4 books
    DeDRM v6.3.2: Trying to decrypt B0029XXT1I_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: MYBOOK
    Found 0 keys to try after 0.2 seconds
    Crypto Type is: 2
    DeDRM v6.3.2: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.3.2: Looking for new default Kindle Key after 0.2 seconds
    DeDRM v6.3.2: Running kindlekey.py under Wine
    DeDRM v6.3.2: Command line: “wine python.exe “/home/djringjr/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py” “/home/djringjr/.config/calibre/plugins/DeDRM/libraryfiles/winekeysdir””
    wine: cannot find L”C:\\windows\\system32\\python.exe”
    DeDRM v6.3.2: Found and decrypted 0 key files
    DeDRM v6.3.2: Ultimately failed to decrypt after 29.8 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 588, in run
    File “calibre_plugins.dedrm.__init__”, line 538, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.3.2: Ultimately failed to decrypt after 29.8 seconds
    fixme:ole:RemUnknown_QueryInterface No interface for iid {00000019-0000-0000-c000-000000000046}
    Added MYBOOK to db in: 0.8
    Added 1 books in 31.9 seconds
    Worker Launch took: 0.246994972229
    Job: 1 Convert book 1 of 1 (MYBOOK) finished
    Convert book 1 of 1 (MYBOOK)
    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_3T9jcK/qSmOdN.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_3T9jcK/aP9MKr.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_3T9jcK/ZruGFw.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: MYBOOK

    Convert book 1 of 1 (MYBOOK)
    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_3T9jcK/qSmOdN.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_3T9jcK/aP9MKr.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_3T9jcK/ZruGFw.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: MYBOOK

    • There seems to be a problem with some version of Linux and Python and wine, in that the default install doesn’t get a path set properly. You could try running the key extraction script manually under wine:

      wine python.exe “/home/djringjr/.config/calibre/plugins/DeDRM/libraryfiles/kindlekey.py” “/home/djringjr/”

      but put in the full path to the python 2.7 executable in place of python.exe. And then import any key files that get created in your home directory into the plugin manually in the customisation dialog.

  34. I need your help installing Plug-In because I love the work you two are doing. I’m running Kindle 1.11.2 & calibre 2.35.0 running on OSX 10.10.4
    I seem to install plug-in properly. Is it an issue of finding the keys. Thanks so much!

  35. Hello, thanks a lot for this useful tools.

    They’ve worked wonderfully so far, except for a couple of kindle books I purchased last week that are print replicas with a lot of pictures in them. They go to calibre without issues like AZW4 files, but they lose their format completely spliting text in a very weird way, pictures are made into negatives, etc.

    Not sure what is going on whit these books. Thanks in advance for any clue about what I am doing wrong.

    • Were they from a Kindle? You could try downloading them with Kindle for PC/Mac instead. Also, you could try the Kindle Unpack plugin to extract the PDF file out of the AZW4.

    • The problem is the calibre conversion, not the DRM removal. AZW4 are essentially PDFs. Use the KindleUnpack plugin to extract the PDF from the AZW4 wrapper, instead of getting calibre to convert them to ePub. (Calibre converts to epub even to view the file.)

    • Hi Laura and Paul,

      Thanks for explaining the PDF extracting plug in. Didn’t have this plug in instaled on Calibre and I didn’t know AZW4 are like pdf files. I did what you said and it worked perfectly, so I now have a very nice PDF files of the kindle books-print replicas, I wasn’t able to preview as AZW4 in Calibre. Not sure why this plug in ask you to choose a type of EPUB, if it automatically extracts the AZW4 into PDF.

      Anyways, the important thing is it worked to get nice PDFs of my my books, so thank you so much for your help.

  36. I downloaded the Python 2.7.8 and installed. Then downloaded Pycrypto 2.6 and it won’t run because it says it requires Python 2.6. So, I uninstalled 2.7.8 and installed 2.6, and Pycrypto 2.6 won’t run because it can’t find Python 2.6 in the registry and won’t install. What gives?

    • You need to read the descriptions of the PyCrypto downloads more carefully. There’s a pyCrypto version number, and then various builds of that version for the different Python versions. You probably want PyCrypto 2.6 for Python 2.7.

      • Hi Paul, you stated I probably needed to read the descriptions more carefully and use the pyCrypto version 2.6 with the Python 2.7. That is what I tried to use. Well, actually it was Python 2.7.8. But the deCrypto 2.6 said it required Python 2.6. So, I downloaded Python 2.6 and tried again. deCrypto 2.6 then told me Python 2.6 was not in the registry and couldn’t be found so it wouldn’t run. I will try again, maybe it was just a glitch in my PC. Thanks.

        • You need to read me answer more carefully too. I didn’t say “use the pyCrypto version 2.6 with the Python 2.7” I said you probably wanted “PyCrypto 2.6 for Python 2.7”

          The Windows DeDRM app ReadMe gives the following link for PyCrypto: http://www.voidspace.org.uk/python/modules.shtml#pycrypto
          The readme says explicity to “Download PyCrypto 2.6 (or later) for Windows and Python 2.7”

          Look at the list of PyCryptos in the link from the readme. There’s “PyCrypto 2.6 for Python 2.6” and there’s “PyCrypto 2.6 for Python 2.7” and there’s “PyCrypto 2.6 for Python 3.2” and there’s “PyCrypto 2.6 for Python 3.3”.

          Uninstall Python 2.6. Make sure Python 2.7 is still working. Download and install PyCrypto 2.6 FOR Python 2.7

          The PyCrypto version numbers are not related to the Python version numbers.

          • Okay, got it, took a while to soak in, thanks for your patience. Downloaded Python 2.7 and DeCrypto for 2.7, worked just fine. thanks again. Robert

  37. Trying to convert a ebook through calibre 1.48.0 to pdf and wont work keeps coming up with this book is locked by DRM. I downloaded onto imac kindle DRM removal the full version and this is what i get when try to remove DRM saying
    K4MobiDeDrm v5.2
    MOBI header version 8, header length 264
    Extra Data Flags: 3
    Decrypting Kindle Format 8 ebook: Silversand Horsemanship Foundation Skills 2
    Found 2 keys to try after 0.0 seconds
    Crypto Type is: 2
    Error decrypting book after 0.0 seconds: No key found in 2 keys tried.
    book is in azw format and trying to get it converted to pdf.
    Any help would be greatly appreciated

  38. Hi everyone,
    I’ve installed the plugin but I can’t deDRM the book I bought from amazon. Here is my log. Would be really grateful if you could help.

    Microsoft Windows [Wersja 6.1.7601]
    Copyright (c) 2009 Microsoft Corporation. Wszelkie prawa zastrzeľone.

    C:\Users\Ania>calibre-debug -g
    calibre 2.35 [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
    Starting up…
    Non-ASCII text detected. You must set your Console’s font to Lucida Consol
    onsolas or some other TrueType font to see this text — Key u’S’ for short
    pisz na dysku is already used by Polacz wpisy ksiazki, ignoring
    Started up in 3.15 seconds with 266 books
    Worker Launch took: 0.487999916077
    Job: 1 Non-ASCII text detected. You must set your Console’s font to Lucida
    le or Consolas or some other TrueType font to see this text — Konwertuj k
    1 z 1 (The Chronicles of St Mary’s Boxset Vol 1) finished
    Non-ASCII text detected. You must set your Console’s font to Lucida Consol
    onsolas or some other TrueType font to see this text — Konwertuj ksiazke
    (The Chronicles of St Mary’s Boxset Vol 1)
    C:\Program Files\Calibre2\pylib.zip\dateutil\parser.py:339: Unicod
    ng: Unicode equal comparison failed to convert both arguments to Unicode –
    preting them as being unequal
    Resolved conversion options
    calibre version: 2.35.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(., ‘\\
    apter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))’, ‘i’))
    lass = ‘chapter’]”,
    ‘chapter_mark’: u’pagebreak’,
    ‘comments’: None,
    ‘cover’: u’C:\\Users\\Ania\\AppData\\Local\\Temp\\calibre_i8ihfu\
    o.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’C:\\Users\\Ania\\AppData\\Local\\Temp
    bre_i8ihfu\\pmx91u.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 C:\Users\Ania\AppData\Local\Temp\calibre_i8ihfu\lnwp7p.azw
    Found KF8 MOBI of type ‘standalone’
    Python function terminated unexpectedly
    The Chronicles of St Mary’s Boxset Vol 1 (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 m
    File “site-packages\calibre\gui2\convert\gui_conversion.py”, lin
    in gui_convert_override
    File “site-packages\calibre\gui2\convert\gui_conversion.py”, lin
    in gui_convert
    File “site-packages\calibre\ebooks\conversion\plumber.py”, line
    in run
    File “site-packages\calibre\customize\conversion.py”, line 241,
    all__
    File “site-packages\calibre\ebooks\conversion\plugins\mobi_input
    line 43, in convert
    File “site-packages\calibre\ebooks\mobi\reader\mobi8.py”, line 8
    __call__
    File “site-packages\calibre\ebooks\mobi\reader\mobi6.py”, line 1
    check_for_drm
    calibre.ebooks.DRMError: The Chronicles of St Mary’s Boxset Vol 1

  39. I installed Calibre and your tool, version 6.3.3. But as the ReadMe file suggests, I still cannot import Kindle books without the DRM message appearing. So I followed the instructions in the ReadMe and produced this debug output:

    calibre 2.35 isfrozen: True is64bit: False
    Windows-7-6.1.7601-SP1 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ‘7’, ‘6.1.7601’)
    Python 2.7.9
    Windows: (‘7’, ‘6.1.7601’, ‘SP1’, ‘Multiprocessor Free’)
    Successfully initialized third party plugins: DeDRM
    Starting up…
    Started up in 2.68 seconds with 735 books
    DeDRM v6.3.3: Trying to decrypt B00HRJKLWE_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: Natural Born Learners: Unschooling and Autonom
    y in Education.
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.3.3: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.3.3: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\Elchanan Presid Emis\AppData\Local
    Found K4PC 1.9+ kinf2011 file: C:\Users\Elchanan Presid Emis\AppData\Local\Amazo
    n\Kindle\storage\.kinf2011
    DeDRM v6.3.3: Trying to decrypt B00VQG4FI0_EBOK.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypted key file using IDString ‘146822015’ and UserName ‘456c6368616e616e2050
    726573696420456d6973’
    DeDRM v6.3.3: 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: Natural Born Learners: Unschooling and Autonom
    y in Education.
    Found 4 keys to try after 0.2 seconds
    Crypto Type is: 2
    File is encoded with PID 6PjSvT3LBA.
    Decrypting. Please wait . . . .MobiDe D.rm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    done
    Decryption succeeded after 0.2 seconds
    DeDRM v6.3.3: Saving 1 new key
    DeDRM v6.3.3: Finished after 0.2 seconds
    MOBI header version 8, header length 264
    Extra Data Flags: 3
    Decrypting Kindle Format 8 ebook: Winston S. Churchill: Youth, 1874–1900 (Volu
    me I)
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.3.3: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.3.3: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\Elchanan Presid Emis\AppData\Local
    Found K4PC 1.9+ kinf2011 file: C:\Users\Elchanan Presid Emis\AppData\Local\Amazo
    n\Kindle\storage\.kinf2011
    Decrypted key fDielDeR Mu svi6n.3.3: Tryingg ItDoS tdecrriynpgt ‘B10406988G2M2
    L031G5_’E BaOnKd. aUzswe
    rName ‘456c6368616e616e2050726573696420456d6973’
    DeDRM v6.3.3: 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: Winston S. Churchill: Youth, 1874–1900 (Volu
    me I)
    Found 4 keys to try after 0.2 seconds
    Crypto Type is: 2
    Using Library AlfCrypto DLL/DYLIB/SO
    File is encoded with PID ryJLKJjVMI.
    Decrypting. Please wait . . . . .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: Home School Secrets (Homeschooling from a Non-
    traditional Homeschool Perspective Book 1)
    .Found 4 keys to try after 0.1 seconds
    Crypto Type is: 0
    This book is not encrypted.
    Decryption succeeded after 0. done
    1 Decrsyepctoinodns
    sDuecDcReMe dve6d. 3af.3: Finished after 0.1t seerconds
    0.3 seconds
    DeDRM v6.3.3: Saving 1 new key
    DeDRM v6.3.3: Finished after 0.3 seconds
    Added Non-ASCII text detected. You must set your Console’s font to Lucida Consol
    e or Consolas or some other TrueType font to see this text — Winston S. Churchi
    ll: Youth, 1874-1900 (Volume I) to db in: 0.2
    Added 1 books in 17.0 seconds

    Help, please. :):)

  40. UPDATE: Well, when I carefully read that debug output, I realized that this time, I may actually have successfully imported the books into Calibre. So I did it all again and sure enough, running Calibre in debug mode, I was able to import the three target books.

    I have now converted and saved one of the books to PDF, bookmarks and all. Voila! And thank you! NOW I finally feel confident buying Kindle books, because I will not be tethered to Kindle Reader, which invades one’s privacy like an evil little mole. But then, you already know all that. :)

    The PDF is a bit of a mess, though, the pages seem to break in the wrong places, as if they were not really pages from the original, printed book. Is this an artifact of Kindle books? Or is this something I can correct, either using your tool, or in Calibre, or …?

    Thank you!

    • Converting to or from PDF can be troublesome. Kindle books convert to EPUB quite well. There are a number of free epub reading apps, no matter which type of device you want to use.

  41. Hello,

    In the very near future, I am planning on switching from Windows to a Linux distro -Cinnamon or KDE. Ubuntu is a consideration as well.

    Can you tell me which of them the plug-in would work best with?

    Would it install directly in Calibre as it is with Windows?

    • You are best off dual booting with Windows because ADE and the tools do work better with Windows. There are now situations where you need to run ADE 2.01 to be able to download the ePub. ADE 2.01 requires .net which is a real hassle with Wine. Don’t go Linux only. You’ll seriously regret it.

      • The plugin itself and Calibre in general work really well under Linux (and yes, it installs directly in Calibre, just like in Windows).

        Some people have gotten ADE 2.x to work under Wine, but I haven’t been able to do it myself yet. “real hassle” seems to be accurate. I don’t think the choice of distribution makes much difference here.

    • I have Linux Mint–as a linux newbie, it took a while to get everything up and running, but now that it is I’ve had no issues with Calibre and the plugins. That said, I have yet to deal with Kobo or ADE…all my ebook purchases since switching to Linux have been from Amazon and B&N. I’m actually going to install ADE and buy some books from other sites to test it out, just to have the option.

        • No dual boot. I needed a new laptop and loathed Windows 8 so I threw myself into Linux. I figured if I really needed Windows I’d use my old laptop. I did install a windows virtual machine when I thought I’d never get Kindle de-drm to work, but once I figured that out I haven’t gone back to Windows at all.

              • If you buy eBooks from Google, you need the latest ADE 2.01 which needs .net to run. There could be other cases where 1.72 might not work. So if you cannot get 2.01 working under Wine then you’d be best to go back to Windows or dual boot.

                • Or use a VM. Dual booting (duel booting) is a bit of a pain, so I don’t really recommend it if it’s avoidable.

                  • I don’t recommend a VM. It’s not as stable. Dual Booting is better because then when you decide you want to stick with Windows and just use a Live Linux, you can easily dump Linux off of the HD. Also, don’t run Calibre in both Windows and Linux. You can mess up the library because of the differences in Linux and Windows. Since you’ll need Windows for ADE 2.01, stick with Windows for Calibre.

  42. hello,
    Problem with a kindle ebook: Error: -1 outside of string table limits
    The book is big (13MB).
    All is right with other (not so big) ebook from kindle!
    Any idea?

    Thanks

    Microsoft Windows [version 10.0.10240]
    (c) 2015 Microsoft Corporation. Tous droits réservés.

    C:\Users\xxxxx>calibre-debug -g
    calibre 2.35 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’)
    Qt: Untested Windows version 10.0 detected!
    Successfully initialized third party plugins: DeDRM
    Starting up…
    Started up in 2.21 seconds with 78 books
    DeDRM v6.2.2: Trying to decrypt B005PZ8I0Y_EBOK.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    Decrypting Topaz ebook: xxxxxxxxxxxxxxxxxxx
    Found 4 keys to try after 0.0 seconds
    Trying: xxxxxxxx
    Trying: xxxxxxxx
    Book Key Found! (xxxxxxxxxxxxxxxxx)
    Processing Section: page
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    Processing Section: other
    . . . .
    Processing Section: glyphs
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    Processing Section: metadata
    . . . .
    Processing Section: dict
    . . . .
    Processing Section: img
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    Processing Section: color
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    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: 116
    Using page height: 13032
    Using page width: 10790
    Processing Glyphs
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    Processing Pages
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Error: -1 outside of string table limits
    DeDRM v6.2.2: Failed to decrypt with error: outside or string table limits
    DeDRM v6.2.2: Looking for new default Kindle Key after 16.8 seconds
    searching for kinfoFiles in C:\Users\xxxxx\AppData\Local
    Found K4PC 1.9+ kinf2011 file: C:\Users\xxxxx\AppData\Local\Amazon\Kindle\storage\.kinf2011
    Decrypted key file using IDString ‘xxxxxxxxxx’ and UserName ‘xxxxxxxxxx’
    DeDRM v6.2.2: Found 1 new key
    Decrypting Topaz ebook: xxxxxxxxxxxx
    Found 4 keys to try after 16.9 seconds
    Trying: xxxxxxxx
    Trying: xxxxxxxx
    Book Key Found! (xxxxxxxxxxxxxxxxx)
    Processing Section: page
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    Processing Section: other
    . . . .
    Processing Section: glyphs
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    Processing Section: metadata
    . . . .
    Processing Section: dict
    . . . .
    Processing Section: img
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    Processing Section: color
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    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: 116
    Using page height: 13032
    Using page width: 10790
    Processing Glyphs
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
    Processing Pages
    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Error: -1 outside of string table limits
    DeDRM v6.2.2: Ultimately failed to decrypt after 33.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_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 33.6 seconds
    Added xxxxxxxxxxxxxxx to db in: 0.3
    Added 1 books in 34.5 seconds

    • It might be the size, or it might be some new coding inside the Topaz format (although it’s been many months since there was last some new coding found.)

      Does TaskManager show memory getting low? You could try after a restart with only calibre running to make sure you have maximum available memory.

      If it’s not a memory error, you should probably upload the encrypted book to a file sharing service, and send the link to it to Alf and Harper, along with the unexpurgated log. (They’ll need the “Trying: xxxxxxxx
      Trying: xxxxxxxx
      Book Key Found! (xxxxxxxxxxxxxxxxx)” section)

  43. I downloaded a book through the Kindle PC software (http://amzn.com/B00UB76290). Running Windows 10. The DeDRM plugin doesn’t appear to have the right key for the book – it keeps telling me that I can’t convert protected books. When I downloaded it as an epub file and opened it through Adobe Digital Editions, it converted fine. Is there a different key that I’m supposed to be using? I didn’t have this problem on my previous machine…

  44. Huh, this is interesting (or maybe it’s old news to everyone else):

    Looking at the readme file I saw that Obok doesn’t work in Linux. I decided to try using the standalone plugin in wine to see if that did anything. I first installed the Kobo app and bought a book. Then, I opened the plugin through wine and it opened up a terminal with several lines, ending with “decrypting [title of book]…” I hit enter then got several more lines of type too fast for me to read before it disappeared. A search of the title showed the decrypted book in the tmp folder in my hard drive, but each chapter was it’s own file–which makes import to calibre a nightmare–and it was in html. So a few questions:

    Is it normal for Obok to automatically convert to html? Has anyone figured out how to get Obok to work in calibre in Linux? And for those who know Linux and Wine–if the standalone is my only option for Obok, any ideas on how change where by decrypted ebooks end up?

    • Something clearly went wrong – the stand-alone python script is supposed to produce unencrypted ePubs, not the raw HTML files. Perhaps you just haven’t found where it put the ePub?

      • Multiple searches haven’t turned it up, so unless the script changed the name it’s not there. The folder created for the html files was labeled epub, but all the files were html.

          • This is really strange. I had deleted the files before seeing your reply, so I decided to decrypt the same book with Obok and try your suggestion. But this time it saved it as an epub and put it in the Kobo folder in Other_Tools. I’m glad the decryption is working properly but I wish I knew what changed (and how to send it to the folder of my choice).

  45. Seems like Calibre and the plug-in doesn’t mind Mint

    Angie, are you using Cinnamon, Mate, Xfce or KDE desktop?

    • I’m using Mate. I started out with Cinnamon and calibre was fine there but it was giving me other issues so I switched to mate.

  46. I am currently using a Kindle Paperwhite as my reader and I have installed on my Win 7 PC a copy of ADE 4.0 as well as Calibre with late model DRM plug ins. I purchase books from AMAZON USA (AZ3) , AMAZON Australia (AZ3) and GOOGLE PLAY. Calibre allows me to convert all Purchased books so that they are DRM free and convertible to AZ3.
    I have no issues?, however, read that potential problems exist with the newer EPUB formats supported by ADE 4.0. Should I wait for a problem to occur or immediately replace ADE 4.0 with an older version. If I need to downgrade, what version of ADE should I install? Is this likely to be pointless because GOOGLE would simply make ADE 4.0 mandatory when they start getting serious? Again, at this point everything is working fine.

    • I’ve kept to the last 2.0x version (2.0.1 I think), since from 3.0 onwards ADE supports the new encryption scheme. But you’re right – any ePub retailer using ADE could start requiring the use of the new encryption (& so ADE 3 or later) at any time.

      • But if you have ADE 3 or later installed you risk some retailer having a new version DRM server and getting the new DRM even when not mandatory. So dump any ADE past 2.0.1 and any ePub downloaded will be able to have the DRM removed.

  47. Recently purchased books prompted an update of Kobo’s app; Obok no longer imports

    [ was not added because it couldn’t be decrypted. ]

    $ ./calibre-debug -g
    calibre 2.35 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′)
    Successfully initialized third party plugins: DeDRM && Obok DeDRM
    Starting up…
    DEBUG: 0.0 obok::utilities.py – loading translations
    DEBUG: 0.0 obok::dialogs.py – loading translations
    DEBUG: 0.0 obok::config.py – loading translations
    DEBUG: 0.0 obok::action_err.py – loading translations
    libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    Started up in 4.94 seconds with 13 books
    Running Obok DeDRM v3.1.3
    Obok v3.1.3
    Copyright © 2012-2014 Physisticated et al.
    Error parsing Kobo plist: no legacy user key found.
    Found 5 possible keys to try.
    DEBUG: 14.3 BookListTableWidget:get_books – book_num: 0
    DEBUG: 14.3 BookListTableWidget:get_books – book: 10:04
    DEBUG: 14.3 InterfacePluginAction::launchObok – number of books to decrypt: 1
    Obok DeDRM v3.1.3 – Decrypting 10:04
    Trying key: 8b053e6821cf4fcf47054c55abf4f33b
    Bad JPEG: 7e4f11
    Decryption failed, trying next key.
    Trying key: e6fa12a67d95c0440f669ef830004910
    Bad JPEG: e620a0
    Decryption failed, trying next key.
    Trying key: d3d96fbc43e3fd407af041eba0ef84b8
    Bad JPEG: a1ecff
    Decryption failed, trying next key.
    Trying key: 08009a7d83c68c907993a0fc2d54fea2
    Bad JPEG: fc8037
    Decryption failed, trying next key.
    Trying key: 119208fff588b9ec61cfc086f7be3d9d
    Bad JPEG: 945efd
    Decryption failed, trying next key.
    Obok DeDRM v3.1.3 – Couldn’t decrypt 10:04
    DEBUG: 14.4 DecryptAddProgressDialog::do_book_action – book decryption failed: ’10:04’
    Obok DeDRM v3.1.3 – wrapping up results.

  48. Hi People.

    Thanks for all the hard work.

    Windows 7, 64 bits.

    I’m having a trouble installing the plugin. It doesn’t installs and gives the following message:

    calibre, version 2.31.0
    ERRO: Exceção sem tratamento: ZipImportError:can’t find module calibre.gui2.preferences.toolbar

    Traceback (most recent call last):
    File “site-packages\calibre\gui2\preferences\plugins.py”, line 324, in add_plugin
    File “site-packages\calibre\gui2\preferences\plugins.py”, line 414, in check_for_add_to_toolbars
    File “site.py”, line 66, in load_module
    ZipImportError: can’t find module calibre.gui2.preferences.toolbar

  49. Hi,

    I try to open DRM book via Calibre. The decryption process looks OK, but after I open the file from inside Calibre, the Acrobat Reader gives an error message “There was an error processing a page. There was a problem reading this document (135)”.

    >calibre-debug -g
    calibre 2.35 [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.68 seconds with 1 books
    DeDRM v6.3.3: Trying to decrypt myDRMbook.pdf
    DeDRM v6.3.3: myDRMbook.pdf is a PDF ebook
    DeDRM v6.3.3: Trying Encryption key default_key
    DeDRM v6.3.3: Finished after 2.0 seconds
    Added to db in: 0.2
    Added 1 books in 4.3 seconds

    Thanks
    sac

    • Usually there’s a success or an error message in the log. I suspect that the decryption has failed, but with no error message for some reason. This is an ADE PDF, downloaded by opening a .acsm file? Can you read it in ADE 2.01?

      • I can read it in ADE. I chk the error pages are the page with photos (chapter separators) and graphics.
        i s there any setting that should be tuned to allow calibre render it correctly?

        thanks

          • Sorry If I can not explain clearly. here is the story.
            1. I open the file using Calibre and its decrypted coreectly as you see the log
            2. I double click the file to read the book.
            3. The cover page come nicely, but until i scroll to second page the error occured. Saying that “There was an error processing a page. There was a problem reading this document (135)”.
            4. I tough the entire book is error, but it is not. I scroll down again and I can see pages with text. After several pages the error message come again.
            5. I check to the original file using ADE and found that the error pages in Calibre are the page with foto (use in chapter separator).

            So I conclude that Calibre did not rendered the foto correctly.

            Hope I explained it clearly to you and looking forward for the solution.

            Thanks.

            • Export the PDF from calibre. Read it with some other PDF reading program, e.g. Preview on Mac. I suspect it will render fine. The problem is with calibre’s attempt to convert the PDF to XHTML (which it does for viewing or conversion), and not a problem with the DRM removal.

  50. Now the standalone Obok isn’t working at all. I bought another book and when I opened obok under wine, the new book didn’t show up as an option for decryption. I uninstalled and then reinstalled Kobo, and when I tried obok again nothing at all happens but 1 second flash of a terminal. I’m able to download the books and decrypt via ADE so it’s not a loss, but I figure I’d post to see if this is a common problem for Linux users trying obok.

    • I imagine the problem with the plug-in extends to the stand-alone Obok too. Some change in the recent update to Kobo Desktop (version 3.17) is causing a problem with Obok. Speculation is that the encryption keys have moved. As soon as a fix is in, it should be mentioned here.

  51. If you downloaded a book through the Windows 8/10 Nook App, and If your ePub book, like mine, lacks a “rights.xml” file, not all hope is lost. I actually found the rights.xml file encoded in one of the SQlite 3 databases in plain text – the path should be “C:\Users\\AppData\Local\Packages\BarnesNoble.Nook_ahnzqzva31enc\LocalState\NookDownloads.db3” or somesuch – as long as it has BarnesNoble somewhere in it and ends in NookDownloads.db3.

    I actually found it through Notepad++ and its “Find in Files” feature, looking for the tag that I found from a book that did have a rights.xml file. Although the database is indeed binary, the rights.xml file is readable plaintext – just copy everything from the tag to the closing tag. Next, save it anywhere to a file called rights.xml, rename your ePub book to end in “.zip”, extract the zip folder, copy the rights.xml in META-INF, rezip it up, and rename it back to “.epub”.

    Now, try it in Calibre. A note for comics or books otherwise made out of pictures: the book may not be viewable in Calibre, but if you find where Calibre stored the book and open it as a zip, it should have unencrypted image files that you can copy out of it. Not useful if you want to keep it as an eBook, though.

    Oh, one more thing. There’s another SQlite database in that folder called “NookDB.db3”. Using a database viewer (SQLite Browser worked for me), one of the data tables (“bn_internal_key_value”) should contain a key named “password”. If this varies from your actual B&N account password (mine did), try using that as your password in the DeDRM plugin key generator.

    • Whoops, the comment editor ate my tags.

      The NookDownloads.db3 file is in your own local AppData. Find anything that looks like a rights.xml file (Notepad++ worked for me), make sure that the filename immediately before the rights.xml file matches the book you want to deDRM, and then copy everything from the xml version tag to the closing licenseServiceInfo tag.

      • Thanks for this, Chris. I had heard this was possible, but no one had ever gone in to detail. And I wasn’t motivated enough to look in to it myself.

        Incidentally, the comic book format CBZ is just a zip file full of sequentially numbered images. And those can be read in calibre’s viewer (you might need to go to preferences > behavior then check which formats you want to use the internal viewer for).

  52. I can’t get my Nook eBooks to import into Calibre from my Nook reader for PC, version 2.5.6.9575, with the DRM removed. I’m have Windows 10, and am using the DeDRM plugin 6.3.3, which worked well for my Kindle, & Sony Reader (now Kobo) eBooks.

    I tried customizing the plugin for Barnes & Noble eBooks by giving the key the name Nook, and entering my Nook email address, & password. I also tried with my previous Nook account name and credit card number, but neither of these methods worked.

    Paul Durrant wrote on Aug 11th:
    It seems that the key that’s being tried isn’t the right key for your books. I suppose it’s just possible that B&N aren’t using the new encryption scheme for you. In which case you’d need to try an earlier version of the tool that lets you make a B&N key using your name and CC#. But I had thought everyone got moved a few months ago.

    Which earlier version of the plugin might I try to use my and name and CC#? Or is there a better approach?

  53. I usually keep my kindle paperwhite (2 releases ago) in airplane mode to preserve battery. Today I turned wifi back on and was surprised with a software update. An even bigger surprise was the removal of several books, all of which were recently added via Calibre after having drm removed by this wonderful tool. Oddly, none of my older de-drm’d books were removed. The difference between them is that the older books were opened in DeDRM and then dragged into Calibre, and the newer ones were dragged into Calibre after having installed the DeDRM plugin. When I click on the files in Calibre, I am able to see them (as per instructions on this blog to make sure the drm was removed).

    I’m completely baffled. The drm is removed (else Calibre wouldn’t be able to open it?), but the software update removed the recently added books. I could swear I read a comment from someone that instructed us to use the “Add books” function in Calibre rather than dragging the files in, that your plugin only ran that way. And yet the DRM *is* removed (I think?).

    I simply had Calibre re-copy all the files back onto the Kindle. I did another “Sync and check for items” and nothing was removed. I guess this removal only happens when the software is updated?

    I’m using Calibre 2.35 and 6.3.3 of DeDRM.

    Thanks for any light you can shed on this!

    • ” An even bigger surprise was the removal of several books, all of which were recently added via Calibre after having drm removed by this wonderful tool.”
      Were the books purchased from ? Amazon or elsewhere? I am trying to see if I have the same issue.

      • It’s a known issue! One of the many reasons that I no longer use a Kindle. My wife has a Kindle, and NEVER turns WIFI on. Does she need the updates? She knows it would delete books. I bought a disk full of Kindle books that were supposedly legal copies on ebay. Several of those got deleted from my Kindle before I sold it!

  54. MacBook Air (Mid 2011), Mac OS 10.10.5, Calibre 2.35, DeDRM plug-in 6.3.3

    Tried to convert a Kindle book (already converted successfully on my iMac) to test installation. It failed:

    libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    calibre Debug log
    calibre 2.35 isfrozen: True is64bit: True
    Darwin-14.5.0-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘14.5.0’, ‘Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64’)
    Python 2.7.9
    OSX: (‘10.10.5’, (”, ”, ”), ‘x86_64’)
    Successfully initialized third party plugins: DeDRM
    Starting up…
    2015-08-25 08:33:14.078 calibre-debug[1127:95319] Unable to simultaneously satisfy constraints:
    (
    “”,
    “”,
    “”,
    “”,
    “”,
    “”,
    “”
    )

    Will attempt to recover by breaking constraint

    Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens. And/or, break on objc_exception_throw to catch this in the debugger.
    2015-08-25 08:33:14.080 calibre-debug[1127:95319] Unable to simultaneously satisfy constraints:
    (
    “”,
    “”,
    “”,
    “”,
    “”,
    “”,
    “”
    )

    Will attempt to recover by breaking constraint

    Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens. And/or, break on objc_exception_throw to catch this in the debugger.
    2015-08-25 08:33:14.081 calibre-debug[1127:95319] Unable to simultaneously satisfy constraints:
    (
    “”,
    “”,
    “”,
    “”,
    “”
    )

    Will attempt to recover by breaking constraint

    Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens. And/or, break on objc_exception_throw to catch this in the debugger.
    2015-08-25 08:33:14.081 calibre-debug[1127:95319] Unable to simultaneously satisfy constraints:
    (
    “”,
    “”,
    “”
    )

    Will attempt to recover by breaking constraint

    Set the NSUserDefault NSConstraintBasedLayoutVisualizeMutuallyExclusiveConstraints to YES to have -[NSWindow visualizeConstraints:] automatically called when this happens. And/or, break on objc_exception_throw to catch this in the debugger.
    2015-08-25 08:33:30.663 calibre-debug[1127:95319] Bad cursor rect event, flags = 256
    DeDRM v6.3.3: Trying to decrypt B00AOF238I_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: AMERICA ONE (Book 1)
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.3.3: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.3.3: Looking for new default Kindle Key after 0.1 seconds
    Found k4Mac kinf2011 file: /Users/dennis2/Library/Application Support/Kindle/storage/.kinf2011
    Started up in 23.04 seconds with 1 books
    Decrypted key file using IDString ‘1d28b701b529’ and UserName ‘dennis2’
    DeDRM v6.3.3: 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: AMERICA ONE (Book 1)
    Found 4 keys to try after 0.6 seconds
    Crypto Type is: 2
    DeDRM v6.3.3: 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_plugins
    File “calibre_plugins.dedrm.__init__”, line 589, in run
    File “calibre_plugins.dedrm.__init__”, line 539, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.3.3: Ultimately failed to decrypt after 0.6 seconds
    2015-08-25 08:33:48.758 Calibre[1149:96021] deliverNotificationWithTitle()
    * Notification delivered.
    Added AMERICA ONE (Book 1) to db in: 0.5
    Added 1 books in 2.3 seconds
    Worker Launch took: 0.149219989777
    Job: 1 Convert book 1 of 1 (AMERICA ONE (Book 1)) finished
    Convert book 1 of 1 (AMERICA ONE (Book 1))
    Resolved conversion options
    calibre version: 2.35.0
    {‘asciiize’: False,
    ‘author_sort’: None,
    ‘authors’: None,
    ‘base_font_size’: 0.0,
    ‘book_producer’: None,
    ‘change_justification’: u’original’,
    ‘chapter’: u”//*[((name()=’h1′ or name()=’h2′) and re:test(., ‘\\s*((chapter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))’, ‘i’)) or @class = ‘chapter’]”,
    ‘chapter_mark’: u’pagebreak’,
    ‘comments’: None,
    ‘cover’: u’/var/folders/bh/ksy_23x16n99szjldzxc8wbc0000gn/T/calibre_2.35.0_tmp_zcJswV/KKdO1f.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’/var/folders/bh/ksy_23x16n99szjldzxc8wbc0000gn/T/calibre_2.35.0_tmp_zcJswV/mpuoXW.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}
    Python function terminated unexpectedly: AMERICA ONE (Book 1)
    InputFormatPlugin: MOBI Input running
    on /var/folders/bh/ksy_23x16n99szjldzxc8wbc0000gn/T/calibre_2.35.0_tmp_zcJswV/SKWcEw.azw
    Found KF8 MOBI of type ‘standalone’
    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 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: AMERICA ONE (Book 1)

  55. Hi. I have a corrupt ADE PDF book that opens with errors in ADE, that can not be decrypted using either the 6.0.x or the 6.3.3 plug-in. Other PDF books are decrypting fine. Is this a challenge worth investigating?

    Thanks

    Mye Z

      • I’ve logged a support ticket with the vendor and they are tracking down a new copy from the publisher.

        Here is the calibre-debug output.

        Worker Launch took: 0.169718027115
        Job: 1 Read metadata (0 of 1) finished
        Read metadata (0 of 1)
        DeDRM v6.3.3: Trying to decrypt Body.pdf
        DeDRM v6.3.3: Body.pdf is a PDF ebook
        DeDRM v6.3.3: Trying Encryption key adeptkey
        Error serializing pdf Body.pdf. Probably wrong key.
        DeDRM v6.3.3: Failed to decrypt with key adeptkey after 0.4 seconds
        DeDRM v6.3.3: Looking for new default Adobe Digital Editions Keys after 0.4 seconds
        DeDRM v6.3.3: 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_plugins
        File “calibre_plugins.dedrm.__init__”, line 596, in run
        File “calibre_plugins.dedrm.__init__”, line 471, in PDFDecrypt
        DeDRMError: DeDRM v6.3.3: Ultimately failed to decrypt after 0.4 seconds.
        Syntax Error: Couldn’t find the ‘EBX_HANDLER’ security handler
        Traceback (most recent call last):
        File “site-packages/calibre/customize/ui.py”, line 335, in get_file_type_metadata
        File “site-packages/calibre/customize/builtins.py”, line 320, in get_metadata
        File “site-packages/calibre/ebooks/metadata/pdf.py”, line 78, in get_metadata
        ValueError: Could not read info dict from PDF

        • It appears the PDF is not corrupt, it’s just in a different format. The PDF version is 1.6 and EBX_HANDLER is in the file, but it only appears once where as other documents have a second object? with the actual license as a value.

          obj 35953 0
          Type:
          Referencing:

          <<
          /Filter /EBX_HANDLER
          /V 4
          /Length 128
          /ADEPT_ID (urn:uuid:)
          /EBX_TITLE ()
          /EBX_AUTHOR ()
          /EBX_PUBLISHER ()
          >>

          obj 35954 0
          Type: /XRef
          Referencing: 33061 0 R, 2608 0 R, 35953 0 R
          Contains stream

          <<
          /Length 14289
          /Type /XRef
          /Root 33061 0 R
          /Info 2608 0 R
          /Encrypt 35953 0 R
          /ID []
          /Size 35955
          /Index [0 35955]
          /W [1 4 1]
          /DecodeParms
          <>
          /Filter /FlateDecode
          >>

          startxref 17270856

          PDF Comment ‘%%EOF\n’

        • It appears the EBX_HANDLER does exist but it only does so only once, unlike other PDF documents. The PDF version is 1.6.

  56. Hi,

    recently installed calibre and added the drm removal plugin seems to work on some books but not others. I’ve tried files copied directly from the Kindle, Kindle DX, and files from the Win7 Kindle app folder. From what I can see in the debug lines it looks like it cannot find the key.

    calibre 2.35 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 3.49 seconds with 1 books
    DeDRM v6.3.3: Trying to decrypt B007Y6WEUC_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: Adrian’s Eagles: Book Four (Life After War 4)
    Found 0 keys to try after 0.2 seconds
    Crypto Type is: 2
    DeDRM v6.3.3: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.3.3: Looking for new default Kindle Key after 0.2 seconds
    searching for kinfoFiles in C:\Users\johnmc87\AppData\Local
    No K4PC kindle.info/kinf/kinf2011 files have been found.
    DeDRM v6.3.3: 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_plugin
    File “calibre_plugins.dedrm.__init__”, line 589, in run
    File “calibre_plugins.dedrm.__init__”, line 539, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.3.3: Ultimately failed to decrypt after 0.3 seconds
    Added Adrian’s Eagles: Book Four (Life After War 4) to db in: 0.3
    Added 1 books in 1.5 seconds

    Grateful for any help or advice

    Thanks….

    • If you import ebooks from an E-ink Kindle, you need to enter its serial number into the plug-in’s configuration. Otherwise, install Kindle for PC (not the Windows Store app) on the same PC and Windows user where you have calibre installed. Then import the books downloaded to it.

  57. Does DRM 6.3.3 work with the new Kindle PC version?
    I’ve had an email informing me that my Kindle PC version 1.10.8 (from 04.05.14) is due to expire Sept 2015. I have updated Calibre DRM to 6.3.3 & everything is still ok but want to make sure it will work with new kindle pc version before I update that as well.

    Thanks
    Lyz

    • Looking at my Kindle for PC, it says it’s version 1.12.0 and that it last updated on 8/2/2015. And it works with the DeDRM 6.3.3 calibre plugin.

      • Thanks for that, it was wanting me to auto update to 1.12.2 but just downloaded 1.12.0 from elsewhere & everything running fine

  58. Having some trouble with obok. After a mandatory upgrade in the Kobo app, the obok calibre plug-in is no longer able to decrypt books. MacBook Pro (Mid 2012), Mac OS 10.10.5, Calibre 2.35, DeDRM plug-in 6.3.3 Below is the log file:

    Traceback (most recent call last):
    File “site-packages/calibre/customize/ui.py”, line 587, in initialize_plugins
    File “site-packages/calibre/customize/ui.py”, line 53, in load_plugin
    File “site-packages/calibre/customize/zipplugin.py”, line 197, in load
    File “lib/python2.7/importlib/__init__.py”, line 37, in import_module
    File “site-packages/calibre/customize/zipplugin.py”, line 179, in load_module
    File “calibre_plugins.ios_reader_apps.__init__”, line 40, in
    ImportError: No module named PyQt4.Qt
    libpng warning: iCCP: Not recognizing known sRGB profile that has been edited
    calibre Debug log
    calibre 2.35 isfrozen: True is64bit: True
    Darwin-14.5.0-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘14.5.0’, ‘Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64’)
    Python 2.7.9
    OSX: (‘10.10.5’, (”, ”, ”), ‘x86_64′)
    Failed to initialize plugin: u’/Users/david/Library/Preferences/calibre/plugins/iOS reader applications.zip’
    Successfully initialized third party plugins: DeDRM && Obok DeDRM
    Starting up…
    DEBUG: 0.0 obok::utilities.py – loading translations
    DEBUG: 0.0 obok::dialogs.py – loading translations
    DEBUG: 0.0 obok::config.py – loading translations
    DEBUG: 0.0 obok::action_err.py – loading translations

    Thanks for your help and all the work you put into this.

  59. As promised, I looked around and found the change made to the Kobo desktop app v3.17 that prevents Obok from decrypting. Until the guys in charge update the official distribution, you can unpack your obok_plugin.zip, find the file ‘obok.py’ in the ‘obok’ subdir, replace the line

    deviceid = hashlib.sha256(‘NoCanLook’ + macaddr).hexdigest()

    with

    deviceid = hashlib.sha256(‘XzUhGYdFp’ + macaddr).hexdigest()

    and repack the zip. Or if youre using the standalone, do the same with that ‘obok.py’. Yep, that’s all; what a pointless change by Kobo.

    The ‘NoCanLook’ string isn’t removed from the code completely and is still used under some condition, but right now I don’t have time to investigate when. It’s better anyway to leave it in the official script, so older app versions remain supported.

    I don’t have an OS X VM handy right now and don’t feel like installing one just to check this on the Mac side, so try that on your own. If it won’t work, I’ll look into it. For now I tested on W7 and fully expect this to work on 8 or 10 as well. Have fun with your books!

    • Doesn’t work for me, I’m afraid. The Obok.py launches fine on my Win7 x64 system, but as you’ve noted doesn’t do the job on 3.17-based Kepubs. I modified the standalone Obok.py with your string here (in Notebook), and now it won’t launch at all. Opens a command-line window, but it flashes away again too quickly to read what it says.

      • You’ve probably made an error when editing the script. Python is very picky about line indents. If you open a command window and run the script using ‘python you’ll be able to read the error message.

      • I recommend that you open up a command window yourself to run Obok (python obok.py), that way it won’t close on you. I suspect you’re getting a syntax error because you didn’t maintain the same level of indentation when you edited the file. Unlike in many other languages, indentation in Python is not merely cosmetic and can make programs fail.

        • Thanks for the rapid replies, Paul and Anonymous. Really appreciated.

          Yes, it’s a syntax error, but not the one you both suggested. (I was careful not to change the indent spacing.) What happened was that I had copied and pasted the string you suggested, but didn’t notice that it pasted the typographic quotes that show on the webpage.

          I’ve replaced them with single ASCII quotes, and all is well. Success!

          Again, many thanks for the help.

            • It’s funny how I decided to post the entire line instead of just telling people to change that one string, because I expected some people to accidentally mess something up that way, but now that’s exactly what ended up biting people because of stupid WordPress changing the quotes around…

              • Apologies for my noobness. For my own part I knew enough to be careful about the indenting, and tripped over the quotes. At least I’ll think of them next time!

      • Well, I installed OS X in a VM with the same MAC address that I had for my Windows testing and I’m able to open the books I downloaded with the Windows app in OS X by simply copying over Kobo.sqlite and the kepub files. So at least in my case, it’s clearly using the same key derivation algorithm for both. The code looks slightly different from the Windows version but the new string is definitely used. Have you tried redownloading the books?

          • Hey, no problem, I’m glad you got it working. I was actually hesitant to ask you that question because I know how much you’ve been helping out around here and I’ve seen you tell people to do that so many times, so it felt kind of condescending to ask. But I guess it happens even to the best of us :-). I was already thinking that maybe it had to do with whether you had a Kobo device registered, because in Windows this code is in the Device class, but in OS X it’s under NoKoboDev.

    • How did you find that code? I would like to try something similar on the device itself (Kobo reading device) – that would lever the pain of having Kobo Desktop installed for those who have devices.

  60. As you know, some of us are concerned as to how to download books if and when we can no longer use the old and reliable ADE program in Linux under Wine. I’ve installed Aldiko on my Android phone. It handles DRMd Adobe ebooks, and can download just like ADE from any source you authorize on it. It is easily authorized with Adobe, and becomes the default for ACSM files. The files on the device are ordinary epub files, and can be transferred to a pc and thus to an ebook reader or to anywhere else.

  61. I’ve been having problems getting some (not all) books into Calibre with removed DRM. According to the Adobe digital edition’s help file: Bookseller-specific IDs
    Some booksellers use a special form of protection where your book is locked to the bookseller’s ID. For example, Barnes & Noble uses this method. When you buy a book, download to your computer, and open in ADE, you’ll be asked to supply the username and unlock code you use on the bookseller’s web site

    (for example, for Barnes & Noble, the name and number of the credit card associated with your ebook purchase).

    So I am wondering, should I try putting in my credit card number that I used to buy my book to get it to remove the DRM?

    • B&N used to have this method, but they started switching accounts away from the cc# based encryption about a year ago. Regardless, if you enter your B&N account email and password into the DeDRM configuration, it will retrieve your current key. You do need to have new copies of your ebooks to be sure they are encrypted with the current key.

  62. Using Linux Mint- I decided to update to Kobo 3.17, since the standalone Obok stopped working with 3.15, and try Anonymous’ fix for obok.py. Except either my computer won’t upgrade for some reason or it has upgraded but it’s still calling itself 3.15. I uninstalled 3.15 and downloaded 3.17 via this link: http://download.kobobooks.com/desktop/kobodesktop/kobosetup.exe

    However, both wine and the app is saying 3.15. I tried the fix anyway and got nothing, just the same quick flash of a terminal screen I was getting when obok stopped working for 3.15.

    • If you’re using Mint, I can help you – but only if you do all the work in a terminal and copy and paste the relevant bit’s of information. Almost certainly you will have an error about a missing python file. See earlier posts on this – search for my posts on this blog. I’ll repeat the filenames here: adobekey.py kindlekey.py libalfcrypto32.so libalfcrypto64.so subasyncio.py they ought to be in: ~/.config/calibre/plugins/DeDrm/libraryfiles/ THIS IS A BUG.
      Regards, Barry.

    • How odd. On Windows 8.1 that setup file installs as 3.17. It has a white interface, whereas 3.15 had blue tabs at the top. Also, 3.15 still worked with Obok for me.

  63. I followed all the basic steps but this file won’t budge

    C:\Users\Johnny>calibre-debug -g
    calibre 2.35 [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
    Starting up…
    Started up in 3.17 seconds with 2 books
    Worker Launch took: 0.421000003815
    Job: 1 Convert book 1 of 1 (Scientific American: Psychology) finished
    Convert book 1 of 1 (Scientific American: Psychology)
    Resolved conversion options
    calibre version: 2.35.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*((ch
    apter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))’, ‘i’)) or @c
    lass = ‘chapter’]”,
    ‘chapter_mark’: u’pagebreak’,
    ‘comments’: None,
    ‘cover’: u’C:\\Users\\Johnny\\AppData\\Local\\Temp\\calibre_0eq_np\\ixb
    hnl.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\\Johnny\\AppData\\Local\\Temp\\ca
    libre_0eq_np\\xkgo5a.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: AZW4 Input running
    on C:\Users\Johnny\AppData\Local\Temp\calibre_0eq_np\lpzbiv.azw4
    Extracting PDF from AZW4 Container…
    Converting file to html…
    Python function terminated unexpectedly
    (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 __c
    all__
    File “site-packages\calibre\ebooks\conversion\plugins\azw4_input.py”,
    line 25, in convert
    File “site-packages\calibre\ebooks\azw4\reader.py”, line 49, in extrac
    t_content
    File “site-packages\calibre\ebooks\conversion\plugins\pdf_input.py”, l
    ine 50, in convert
    File “site-packages\calibre\ebooks\pdf\pdftohtml.py”, line 97, in pdft
    ohtml
    calibre.ebooks.DRMError

  64. How long does de-drming take? I’ve been trying to convert/de-drm a book for over an hour now, and calibre still says the job is 1% complete. If this is not normal, what can I do to troubleshoot?

    • DRM removal takes a few seconds for most books, possibly up to a couple of minutes for complex Topaz format ebooks.

      Not that DRM removal happens on import, not conversion. If you’ve imported the book successfully, and the conversion hasn’t complained about DRM being still present, then it’s a calibre problem.

  65. Hi,

    I’m trying to run the python tools. I have a 64-bit windows 7, but I dont think thats been an issue because I have had this work for annother book before.

    I have tried reinstalling kindle for pc, i deleted requizite files. I am trying to release DRM from a rental, I just have am ancient tablet i use for reading. I have read about commenting out the lines for a section of the code that throws an error related to this, and that did not work either.

    Here is my output

    DeDRM v6.2.1: Processing: DigitalSystemsDesignUsingVeCharlesRoth.azw4…
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 4, header length 248
    Decrypting Mobipocket 4 ebook: Digital Systems Design Using Verilog (Activate Learning with these NEW titles from Engineering!)
    Found 4 keys to try after 0.1 seconds
    Crypto Type is: 2
    Error decrypting book after 0.1 seconds: No key found in 4 keys tried.
    Traceback (most recent call last):
    File “C:\Users\amiller\Documents\Calibre Library\DeDRM_App\DeDRM_lib\lib\k4mobidedrm.py”, line 242, in decryptBook
    book = GetDecryptedBook(infile, kDatabases, serials, pids, starttime)
    File “C:\Users\amiller\Documents\Calibre Library\DeDRM_App\DeDRM_lib\lib\k4mobidedrm.py”, line 216, in GetDecryptedBook
    mb.processBook(totalpids)
    File “C:\Users\amiller\Documents\Calibre Library\DeDRM_App\DeDRM_lib\lib\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.
    DeDRM v6.2.1: Failed

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

  66. I think something went wrong. After stripping the DRM from a book via the calibre plugin and transferring it to my Kindle Touch, it appeared to be good- the cover image was gone but the book opened just fine. My device downloaded the cover image after I connected to wireless, things seemed good, I opened and closed the book again just to check. However, after closing it, the device froze. I couldn’t open the menu; after turning it on and off I’m presented with a blank home screen (no books, just the search/menu bar) and the menu won’t open.

    • Oh, probably pertinent data:
      I’m using 64-bit Calibre on Windows 10, and the ebook file was an .azw3 transferred over from my kindle via USB.

    • Always remove books from your Kindle, if they have had the DRM removed, before you connect it to WiFi. The system at Amazon will recognize and delete any of their books that have been ‘altered’. If Amazon downloaded the cover to your device, it would, at the same time, examine the book for tampering! Then it would delete the book. One of the reasons I dumped my Kindle, which was otherwise an excellent book reader.

  67. My Voyage updated to the latest Kindle software a few days ago, and now I can no longer import books into Calibre, even with the updated version 6.3.3. I’m on Linux (Fedora 22) and have previously done this with little or no trouble. The pop-up error message is:

    Worker process crashed while executing job
    Traceback (most recent call last):
    File “/usr/lib64/calibre/calibre/utils/ipc/pool.py”, line 102, in recv
    result = cPickle.loads(eintr_retry_call(self.conn.recv_bytes))
    File “/usr/lib64/calibre/calibre/utils/ipc/__init__.py”, line 18, in eintr_retry_call
    return func(*args, **kwargs)
    EOFError

    The Calibre debug output follows:

    $ calibre-debug -g
    calibre 2.27 isfrozen: False is64bit: True
    Linux-4.1.6-200.fc22.x86_64-x86_64-with-fedora-22-Twenty_Two Linux (’64bit’, ‘ELF’)
    (‘Linux’, ‘4.1.6-200.fc22.x86_64’, ‘#1 SMP Mon Aug 17 19:54:31 UTC 2015’)
    Python 2.7.10
    Linux: (‘Fedora’, ’22’, ‘Twenty Two’)
    Successfully initialized third party plugins: DeDRM && K4PC, K4Mac, Kindle Mobi and Topaz DeDRM && Find Duplicates
    Starting up…
    [31/Aug/2015:12:09:58] ENGINE WARNING: Use of engine.autoreload_on is deprecated and will be removed in a future version. Use engine.autoreload.on instead.
    Started up in 1.92 seconds with 897 books

    Found device nodes: /dev/sdd1 None None
    Job: 1 Get device information started
    DeviceJob: 1 Get device information done, calling callback
    DeviceJob: 1 Get device information callback returned
    Job: 2 Set library information started
    DeviceJob: 2 Set library information done, calling callback
    DeviceJob: 2 Set library information callback returned
    Job: 3 Get list of books on device started
    DEBUG: 0.0 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= None
    DEBUG: 0.0 USBMS: dirs are: /run/media/poc/Kindle/ documents
    DEBUG: 0.1 USBMS: scan from root False /run/media/poc/Kindle/documents
    Job: 1 Get device information finished
    No details available.
    Job: 2 Set library information finished
    No details available.
    DEBUG: 0.3 USBMS: count found in cache: 22, count of files in metadata: 22, need_sync: False
    DEBUG: 0.3 USBMS: Finished fetching list of books from device. oncard= None
    DEBUG: 0.3 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= carda
    DEBUG: 0.3 USBMS: Fetching list of books from device. Device= KINDLE2 oncard= cardb
    DeviceJob: 3 Get list of books on device done, calling callback
    DeviceJob: metadata_downloaded: Starting set_books_in_library
    DeviceJob: set_books_in_library: books to process= 22
    DeviceJob: set_books_in_library finished: time= 0.00879907608032
    DeviceJob: metadata_downloaded: updating views
    DeviceJob: metadata_downloaded: syncing
    DeviceJob: metadata_downloaded: refreshing ondevice
    DeviceJob: metadata_downloaded: sending metadata_available signal
    DeviceJob: 3 Get list of books on device callback returned
    Job: 3 Get list of books on device finished
    No details available.
    Job: 4 Prepare files for transfer from device started
    DeviceJob: 4 Prepare files for transfer from device done, calling callback
    DeviceJob: 4 Prepare files for transfer from device callback returned
    DeDRM v6.3.3: Trying to decrypt The Bloodline Feud_ This Merchant Princes omnibus includes The Family Trade and The Hidden Family_B00C2T56II.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 Bloodline Feud: This Merchant Princes omnibus includes The Family Trade and The Hidden Family
    Found 12 keys to try after 0.0 seconds
    Crypto Type is: 2
    File is encoded with PID M5FOakJRVW.
    Decrypting. Please wait . . . . . . done
    Decryption succeeded after 0.1 seconds
    DeDRM v6.3.3: Finished after 0.1 seconds
    Using Library AlfCrypto DLL/DYLIB/SO
    is not a valid Kindle serial number or PID.
    K4MobiDeDRM v0.4.2: Calibre configuration directory = /home/poc/.config/calibre
    MobiDeDrm v0.35. Copyright 2008-2011 The Dark Reverser et al.
    MOBI header version = 8, length = 264
    Extra Data Flags = 3
    Crypto Type is: 2
    This application failed to start because it could not find or load the Qt platform plugin “headless”.

    Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.

    Reinstalling the application may fix this problem.
    Job: 4 Prepare files for transfer from device finished
    No details available.
    DeviceJob: set_books_in_library: books to process= 22
    DeviceJob: set_books_in_library finished: time= 0.00729393959045

    • The latest Voyage firmware now contains the ability to download eBooks that are not compatible with the DRM removal tools and Calibre. Even some KF8 eBooks taken from the Voyage may seem to be OK, but will be missing all or most graphics. So do NOT copy any eBooks from your Voyage (PW2 & PW3 as well). Any that have advanced typesetting enabled cannot be copied from your Voyage and you’ll have no idea which KF8 are no good. For now, the solution is to use an older version K4PC (one without the Bookerly font) or download from Amazon for USB transfer. Amazon is changing things and if you are not careful, you may end up with eBooks that will not be able to be used outside a Kindle and/or a Kindle program.

    • I spoke too soon. Now I’m getting this error when trying to convert. NB: at the end it says:

      ‘This application failed to start because it could not find or load the Qt platform plugin “headless”.’

      I’ve no idea what that means. Here is the full error message:

      calibre, version 2.27.0 (linux2, isfrozen: False)
      Conversion Error: Failed: Convert book 1 of 1 (Firefall)

      Convert book 1 of 1 (Firefall)
      Resolved conversion options
      calibre version: 2.27.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(., ‘chapter|book|section|part\\s+’, ‘i’)) or @class = ‘chapter’]”,
      ‘chapter_mark’: u’pagebreak’,
      ‘comments’: None,
      ‘cover’: u’/tmp/calibre_2.27.0_tmp_C7ncwg/fnTa6N.jpeg’,
      ‘debug_pipeline’: None,
      ‘dehyphenate’: True,
      ‘delete_blank_paragraphs’: True,
      ‘disable_font_rescaling’: False,
      ‘dont_compress’: False,
      ‘duplicate_links_in_toc’: False,
      ’embed_all_fonts’: False,
      ’embed_font_family’: None,
      ‘enable_heuristics’: True,
      ‘expand_css’: False,
      ‘extra_css’: None,
      ‘extract_to’: 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,
      ‘mobi_file_type’: u’old’,
      ‘mobi_ignore_margins’: False,
      ‘mobi_keep_original_images’: False,
      ‘mobi_toc_at_start’: False,
      ‘no_chapters_in_toc’: False,
      ‘no_inline_navbars’: True,
      ‘no_inline_toc’: False,
      ‘output_profile’: ,
      ‘page_breaks_before’: u”//*[name()=’h1′ or name()=’h2′]”,
      ‘personal_doc’: u'[PDOC]’,
      ‘prefer_author_sort’: False,
      ‘prefer_metadata_cover’: False,
      ‘pretty_print’: False,
      ‘pubdate’: None,
      ‘publisher’: None,
      ‘rating’: None,
      ‘read_metadata_from_opf’: u’/tmp/calibre_2.27.0_tmp_C7ncwg/7PhVMf.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,
      ‘share_not_sync’: False,
      ‘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.27.0_tmp_C7ncwg/Bo8466.mobi
      Extracting text…
      Adding anchors…
      Extracting images…
      Cleaning up HTML…
      Parsing HTML…
      Converting style information to CSS…
      Creating OPF…
      Parsing all content…
      Parsing index.html …
      ********* Heuristic processing HTML *********
      There are 0 blank lines. 0.0 percent blank
      minimum chapters required are: 14
      found 0 pre-existing headings
      common had 1 hits – 0 chapters with no title, 1 chapters with titles, 1.0 percent.
      plain_number had 1 hits – 1 chapters with no title, 0 chapters with titles, 0.0 percent.
      uppercase had 10 hits – 10 chapters with no title, 0 chapters with titles, 0.0 percent.
      Marked 0 headings, Searching for common section headings
      marked 1 chapters & titles. – Ebook ISBN 9781784080457, Hardback ISBN 9781784080464
      Total wordcount is: 205271, Average words per section is: 205271, Marked up 1 chapters
      Hard line breaks check returned False
      Median line length is 339, calculated with html format
      Fixing hyphenated content
      Looking for more split points based on punctuation, currently have 1
      marked 2 section markers based on punctuation. – The Book of Oogenesis
      marked 3 section markers based on punctuation. – Nine minutes to apogee
      marked 4 section markers based on punctuation. – FizerPharm Presents
      marked 5 section markers based on punctuation. – the faery is rosy
      marked 6 section markers based on punctuation. – of glow
      marked 7 section markers based on punctuation. – in fate
      marked 8 section markers based on punctuation. – any style of life
      marked 9 section markers based on punctuation. – is prim
      marked 10 section markers based on punctuation. – oh stay
      marked 11 section markers based on punctuation. – An End to Loneliness
      marked 12 section markers based on punctuation. – The Rifters Trilogy
      marked 13 section markers based on punctuation. – Starfish
      marked 14 section markers based on punctuation. – Maelstrom
      marked 15 section markers based on punctuation. – Other
      marked 16 section markers based on punctuation. – Blindsight
      marked 17 section markers based on punctuation. – Echopraxia
      marked 18 section markers based on punctuation. – Collections
      marked 19 section markers based on punctuation. – The Island and Other Stories
      marked 20 section markers based on punctuation. – Beyond The Rift
      marked 21 section markers based on punctuation. – Richard Morgan
      marked 22 section markers based on punctuation. – Charles Stross
      marked 23 section markers based on punctuation. – Neal Asher
      marked 24 section markers based on punctuation. – Head of Zeus Ltd
      marked 25 section markers based on punctuation. – Clerkenwell House
      Formatting scene breaks
      Forcing index.html into XHTML namespace
      Parsing styles.css …
      Referenced file u’../images/00066.unknown’ not found
      Referenced file u’../images/00009.unknown’ not found
      Referenced file u’../images/00040.unknown’ not found
      Referenced file u’../images/00052.unknown’ not found
      Referenced file u’../images/00039.unknown’ not found
      Referenced file u’../images/00075.unknown’ not found
      Referenced file u’../images/00069.unknown’ not found
      Referenced file u’../images/00010.unknown’ not found
      Referenced file u’../images/00020.unknown’ not found
      Referenced file u’../images/00014.unknown’ not found
      Referenced file u’../images/00030.unknown’ not found
      Referenced file u’../images/00053.unknown’ not found
      Referenced file u’../images/00023.unknown’ not found
      Referenced file u’../images/00034.unknown’ not found
      Referenced file u’../images/00024.unknown’ not found
      Referenced file u’../images/00011.unknown’ not found
      Referenced file u’../images/00022.unknown’ not found
      Referenced file u’../images/00076.unknown’ not found
      Referenced file u’../images/00059.unknown’ not found
      Referenced file u’../images/00073.unknown’ not found
      Referenced file u’../images/00058.unknown’ not found
      Referenced file u’../images/00046.unknown’ not found
      Referenced file u’../images/00078.unknown’ not found
      Referenced file u’../images/00060.unknown’ not found
      Referenced file u’../images/00012.unknown’ not found
      Referenced file u’../images/00062.unknown’ not found
      Referenced file u’../images/00005.unknown’ not found
      Referenced file u’../images/00064.unknown’ not found
      Referenced file u’../images/00074.unknown’ not found
      Referenced file u’../images/00077.unknown’ not found
      Referenced file u’../images/00032.unknown’ not found
      Referenced file u’../images/00042.unknown’ not found
      Referenced file u’../images/00026.unknown’ not found
      Referenced file u’../images/00043.unknown’ not found
      Referenced file u’../images/00054.unknown’ not found
      Referenced file u’../images/00038.unknown’ not found
      Referenced file u’../images/00070.unknown’ not found
      Referenced file u’../images/00031.unknown’ not found
      Referenced file u’../images/00067.unknown’ not found
      Referenced file u’../images/00072.unknown’ not found
      Referenced file u’../images/00035.unknown’ not found
      Referenced file u’../images/00033.unknown’ not found
      Referenced file u’../images/00025.unknown’ not found
      Referenced file u’../images/00003.unknown’ not found
      Referenced file u’../images/00015.unknown’ not found
      Referenced file u’../images/00006.unknown’ not found
      Referenced file u’../images/00007.unknown’ not found
      Referenced file u’../images/00019.unknown’ not found
      Referenced file u’../images/00045.unknown’ not found
      Referenced file u’../images/00071.unknown’ not found
      Referenced file u’../images/00041.unknown’ not found
      Referenced file u’../images/00002.unknown’ not found
      Referenced file u’../images/00017.unknown’ not found
      Referenced file u’../images/00061.unknown’ not found
      Referenced file u’../images/00063.unknown’ not found
      Referenced file u’../images/00050.unknown’ not found
      Referenced file u’../images/00079.unknown’ not found
      Referenced file u’../images/00065.unknown’ not found
      Referenced file u’../images/00021.unknown’ not found
      Referenced file u’../images/00055.unknown’ not found
      Referenced file u’../images/00018.unknown’ not found
      Referenced file u’../images/00028.unknown’ not found
      Referenced file u’../images/00029.unknown’ not found
      Referenced file u’../images/00068.unknown’ not found
      Referenced file u’../images/00001.unknown’ not found
      Referenced file u’../images/00048.unknown’ not found
      Referenced file u’../images/00056.unknown’ not found
      Referenced file u’../images/00016.unknown’ not found
      Referenced file u’../images/00008.unknown’ not found
      Referenced file u’../images/00047.unknown’ not found
      Referenced file u’../images/00037.unknown’ not found
      Referenced file u’../images/00013.unknown’ not found
      Referenced file u’../images/00036.unknown’ not found
      Referenced file u’../images/00051.unknown’ not found
      Referenced file u’../images/00057.unknown’ not found
      Referenced file u’../images/00027.unknown’ not found
      Referenced file u’../images/00049.unknown’ not found
      Referenced file u’../images/00044.unknown’ not found
      Reading TOC from NCX…
      Merging user specified metadata…
      Detecting structure…
      Detected chapter: Ebook ISBN 9781784080457
      Flattening CSS and remapping font sizes…
      Source base font size is 12.00000pt
      Removing fake margins…
      Found 57 items of level: div_1
      Found 7710 items of level: p_1
      div_1 left margin stats: Counter()
      div_1 right margin stats: Counter()
      p_1 left margin stats: Counter({u’0′: 7710})
      p_1 right margin stats: Counter({u’0′: 7710})
      Cleaning up manifest…
      Trimming unused files from manifest…
      Trimming u’images/00001.jpg’ from manifest
      Trimming u’images/00002.jpg’ from manifest
      This application failed to start because it could not find or load the Qt platform plugin “headless”.

      Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, xcb.

      Reinstalling the application may fix this problem.
      Creating MOBI Output…
      Serializing resources…
      Creating MOBI 6 output
      Generating in-line TOC…
      Applying case-transforming CSS…
      Parsing manglecase.css …
      Parsing tocstyle.css …

  68. On Windows (possibly only Windows 7 or later), the DeDRM application fails due to the following Python bug: http://bugs.python.org/issue21614

    It’s a very subtle issue. In “DeDRM_Windows_Application/DeDRM_App/DeDRM_Drop_Target.bat”, the capitalization of “DeDRM_App.pyw” does not match that of the source file, which causes the error. It appears the capitalization change crept in with this commit: https://github.com/apprenticeharper/DeDRM_tools/commit/a2f044e672e301a5a0166e426a77620c8f2162c3#diff-958db49e8280502624ce37141494c051

    • Thanks. The release archives don’t contain this bug, and I hadn’t noticed that the error was still in the repository. I’ve made a couple of commits to fix this now, so it is fixed in the repository now.

      Harper.

  69. Hi, I have the new MacBook and have updated everything, including Calibre and added the new 6.3.3 tools. I’m not very computer savvy. When uploading the new DeDRM tools, I got the following message about a “Broken pipe” – here’s what I copied to the clipboard:

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

    calibre 2.35 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 && K4PC, K4Mac, Kindle Mobi and Topaz DeDRM && Inept Epub DeDRM && Ignoble Epub DeDRM && Inept PDF DeDRM && eReader PDB 2 PML
    Traceback (most recent call last):
    File “site-packages/calibre/gui2/preferences/plugins.py”, line 409, in reload_store_plugins
    File “site-packages/calibre/gui2/ui.py”, line 195, in load_store_plugins
    File “site-packages/calibre/gui2/store/loader.py”, line 67, in builtins_loaded
    File “site-packages/calibre/gui2/store/loader.py”, line 93, in load_cache
    File “site-packages/calibre/__init__.py”, line 226, in prints
    IOError: [Errno 32] Broken pipe

    Can someone please tell me what I need to do to fix this? Also, since I installed the tool, I now cannot DeDRM amazon kindle books that I’ve downloaded. I keep on getting the “this book is DRM protected” box.

    I was very upset with B & N when they made it difficult for me to keep the Nook books I purchased. I’m very concerned that Amazon might be doing the same now?

    Anyway, any thoughts to help? THANK YOU

    • As I learned, you have to redownload the kindle books on to your new MacBook. I thought the DRM was on the book before down load and any key was based on your account. Nope, it looks like the keys are based on your hardware and K4M application installed.

    • I don’t know what the broken pipe message is about, but you’ll have more success with DRM removal by removing the old plugins: K4PC, K4Mac, Kindle Mobi and Topaz DeDRM && Inept Epub DeDRM && Ignoble Epub DeDRM && Inept PDF DeDRM && eReader PDB 2 PML

      The DeDRM plugin replaces them all.

      • Thanks, Paul. How do I remove them? Do I just click on them as they are listed in calibre? I know they turn “off” because they’re no longer green. Is that it? Sorry about my ineptitude with computers. I got a mac so that it would be idiot proof for me, as you can tell.
        Thanks again.

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