DRM Removal Tools for eBooks

Version 6.5.1 released on 12 August, 2016

Welcome to Apprentice Alf’s blog

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

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

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

The Tools

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

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

Getting Help with the Tools

If you have any questions about the tools, ebooks and DRM, check 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, Kobo ebooks, or eReader ebooks has probably just repackaged (an earlier) version of the tools available here.

2,331 thoughts on “DRM Removal Tools for eBooks

  1. Quick strange question regarding the function of dedrm: Would a purchased etextbook .az file transferred from another computer to a computer running dedrm still decrypt correctly or does it need to be on the same computer registered with kindle for pc?

    • If downloaded by Kindle for PC, it does need to be on the same computer. If downloaded to or for an E-ink Kindle, you can just enter the serial number into the customization dialogue.

      • roger that! I had ass-umed that was the case given the fact that it uses the keys associated with the book. I could be mistaken. anywho, thanks for the quick response!

  2. The plugin is not working with Amazon purchased books on a windows 10 laptop.

    calibre Debug log
    calibre 2.63 embedded-python: True is64bit: False
    Windows-8-6.2.9200 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ‘8’, ‘6.2.9200’)
    Python 2.7.9
    Windows: (‘8’, ‘6.2.9200’, ”, ‘Multiprocessor Free’)
    Successfully initialized third party plugins: DeDRM (6, 5, 1)
    Starting up…
    Started up in 44.28 seconds with 89 books
    stdout+stderr from file dialog helper: [”, ”]
    piped data from file dialog helper: [‘\xe5\x9b\xee\xe5\xa3\xa5\x94\xb1G\xd5\x1ck\xb7T>\x0c\x1f\xba\xf2\x8c\xad\xb3!\xa3&\xeee\x9e\xdf\x17\x94\x11’, ‘C:\\Users\\svile\\Documents\\New folder (2)\\The Bragg Healthy Lifestyle – Vital Living to 120!.azw’]
    DeDRM v6.5.1: Trying to decrypt The Bragg Healthy Lifestyle – Vital Living to 120!.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: 7
    Decrypting Mobipocket 6 ebook: The Bragg Healthy Lifestyle – Vital Living to 120!
    Found 0 keys to try after 0.1 seconds
    Crypto Type is: 2
    DeDRM v6.5.1: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.5.1: Looking for new default Kindle Key after 0.1 seconds
    searching for kinfoFiles in C:\Users\svile\AppData\Local
    No K4PC kindle.info/kinf/kinf2011 files have been found.
    DeDRM v6.5.1: 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 154, in _run_filetype_plugins
    File “calibre_plugins.dedrm.__init__”, line 608, in run
    File “calibre_plugins.dedrm.__init__”, line 558, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.5.1: Ultimately failed to decrypt after 0.2 seconds
    Added The Bragg Healthy Lifestyle – Vital Living to 120! to db in: 0.3
    Added 1 books in 1.4 seconds

    • The tools work with Kindle for PC or with files for an EInk device. You don’t have Kindle for Pc installed, and you haven’t entered an E-Ink Kinlde’s serial number. (Oh, and if your Windows user name has non-ASCII characters, the Kindle for PC route won’t work.)

      • Thanks for advice. I will install Kindle for PC on my computer, but haw and were can I enter an E-Ink Kinlde’s serial number?

        • In calibre, go to Preferences > plugins. Select the DeDRM plugin under File Type plugins. Then click the Customize plugin button at the bottom. Click Eink Kindle eBooks, then the green plus sign.

  3. Hi.
    I use Calibre so I can have all my ebooks managed by a single program. For years I used DEDRM to import my Kindle ebooks.

    This morning the Kindle DRM on a new book could not be removed. I followed the uninstall-reinstall process from the FAQ but the DRM still fails to be removed. I attach my log below.

    Thank you for your help.

    calibre Debug log
    calibre 2.62 [64bit] embedded-python: True is64bit: True
    Windows-8-6.2.9200 Windows (’64bit’, ‘WindowsPE’)
    (‘Windows’, ‘8’, ‘6.2.9200’)
    Python 2.7.9
    Windows: (‘8’, ‘6.2.9200’, ”, ‘Multiprocessor Free’)
    Successfully initialized third party plugins: DeDRM (6, 5, 1)
    Starting up…
    Started up in 5.73 seconds with 652 books
    stdout+stderr from file dialog helper: [”, ”]
    piped data from file dialog helper: [‘R\x1aV#\xb6\xc6\xa5\x0bk\x9c\xd7\x11\x0e\x9c+y\x1e\xefL\xc5\x169\xee\th\xd1\xd7V\x98QM\xad’, ‘C:\\Users\\Eric\\Documents\\My Kindle Content\\B00HQ2N2LE_EBOK.azw’]
    DeDRM v6.5.1: Trying to decrypt B00HQ2N2LE_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: He’s So Fine (Lucky Harbor Book 11)
    Found 0 keys to try after 0.5 seconds
    Crypto Type is: 2
    DeDRM v6.5.1: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.5.1: Looking for new default Kindle Key after 0.5 seconds
    searching for kinfoFiles in C:\Users\Eric\AppData\Local
    Found K4PC 1.9+ kinf2011 file: C:\Users\Eric\AppData\Local\Amazon\Kindle\storage\.kinf2011
    Decrypted key file using IDString ‘1990166864’ and UserName ‘45726963’
    DeDRM v6.5.1: 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: He’s So Fine (Lucky Harbor Book 11)
    Found 4 keys to try after 0.6 seconds
    Crypto Type is: 2
    DeDRM v6.5.1: 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 154, in _run_filetype_plugins
    File “calibre_plugins.dedrm.__init__”, line 608, in run
    File “calibre_plugins.dedrm.__init__”, line 558, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.5.1: Ultimately failed to decrypt after 0.6 seconds
    Added He’s So Fine (Lucky Harbor Book 11) to db in: 5.1
    Added 1 books in 9.1 seconds

    • Well, I’m a bit stumped if you’ve already tried reinstalling. What version of Kindle for PC? Mine hasn’t updated since May, and it’s version 1.16.0 (44025).

        • How mysterious. Please go into the plugin’s customisation dialog, the bit for Kindle for PC, and add the current key ‘manually’ by clicking on the green + key. Then get a fresh log of the import. (There might be a bit more info displayed in the log if the current Kindle for PC key is already available to the plugin the first time it tries to decode the book.)

                • Now get a fresh log of the import. (There might be a bit more info displayed in the log if the current Kindle for PC key is already available to the plugin the first time it tries to decode the book.)

                  • Here’s the log.

                    calibre Debug log
                    calibre 2.62 [64bit] embedded-python: True is64bit: True
                    Windows-8-6.2.9200 Windows (’64bit’, ‘WindowsPE’)
                    (‘Windows’, ‘8’, ‘6.2.9200’)
                    Python 2.7.9
                    Windows: (‘8’, ‘6.2.9200’, ”, ‘Multiprocessor Free’)
                    Successfully initialized third party plugins: DeDRM (6, 5, 1)
                    Starting up…
                    Started up in 4.56 seconds with 654 books
                    stdout+stderr from file dialog helper: [”, ”]
                    piped data from file dialog helper: [‘\xab\xbaz\xddW\x9f\xa5\x03\x02`\x9a\x96\xf8\xb3\x91=\xf8z\xcf\xe1\x02\xa2\x01\xa3:Esgf]A\x18’, ‘C:\\Users\\Eric\\Documents\\My Kindle Content\\B00HQ2N2LE_EBOK.azw’]
                    DeDRM v6.5.1: Trying to decrypt B00HQ2N2LE_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: He’s So Fine (Lucky Harbor Book 11)
                    Found 4 keys to try after 0.2 seconds
                    Crypto Type is: 2
                    DeDRM v6.5.1: Failed to decrypt with error: No key found in 4 keys tried.
                    DeDRM v6.5.1: Looking for new default Kindle Key after 0.2 seconds
                    searching for kinfoFiles in C:\Users\Eric\AppData\Local
                    Found K4PC 1.9+ kinf2011 file: C:\Users\Eric\AppData\Local\Amazon\Kindle\storage\.kinf2011
                    Decrypted key file using IDString ‘1990166864’ and UserName ‘45726963’
                    DeDRM v6.5.1: 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: He’s So Fine (Lucky Harbor Book 11)
                    Found 4 keys to try after 0.3 seconds
                    Crypto Type is: 2
                    DeDRM v6.5.1: 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 154, in _run_filetype_plugins
                    File “calibre_plugins.dedrm.__init__”, line 608, in run
                    File “calibre_plugins.dedrm.__init__”, line 558, in KindleMobiDecrypt
                    DeDRMError: DeDRM v6.5.1: Ultimately failed to decrypt after 0.3 seconds
                    Added He’s So Fine (Lucky Harbor Book 11) to db in: 1.4
                    Added 1 books in 2.2 seconds
                    Worker Launch took: 0.235000133514

                    • -And you’re absolutely certain that that book was downloaded with the current installation of Kindle for PC?

                      Yes. It could not be an older file as I deleted the entire My Kindle Content directory before reinstalling.

                    • That did it. Thank you.

                      I also checked my previously converted files, and some had not converted properly. (I hadn’t opened them in Calibre before because I had already read them in Kindle). They have now been properly converted.

                      My next question is this: How do I get my main installations of Kindle and Calibre to work properly in the future?

                    • I suspect that when you wiped your previous installation, you missed a bit – are you sure you got the (possibly hidden) Amazon folder, as well as the My Kindle Content folder?

                    • OK. I tried again. Reinstalled Kindle for PC after uninstalling and deleting both required directories. It still fails to remove DRM, though the installation under another user account does so successfully. Could it have something to do with the number of books I have in Calibre? I have over 800 there.

                    • It’s not to do with number of books in calibre. For some reason the key it’s generating isn’t the right one, but I’ve no idea why. It’s a mystery.

  4. I have a problem loading the Calibre plugin and get the message:
    ‘ calibre, version 2.64.0
    ERROR: Unhandled exception: InvalidPlugin:The plugin in u’C:\\Users\\Owner\\Downloads\\DeDRM_tools_6.5.1.zip’ is invalid. It does not contain a top-level __init__.py file’

    The only init.py file is
    _init_.py

    Can I change this to something that will work properly?
    Thanks
    Tony

  5. I purchased a nook book and am having trouble de-drm’ing it. I have tried using the plugin’s B&N key retrieval as well as manually editing the dedrm json file.

    When downloading the nook book from Nook Study I get a PDF. I have also downloaded the book to my iPhone from the Nook app where get an epub file. Preferably, I’d like the epub format, but either would be great. I haven’t been able to remove the DRM from either of these successfully. I’m sure there must be something I’m overlooking, but I don’t know what it is. Any help is appreciated!🙂

    I have updated to the latest Alf’s Apprentice drm tool (6.5.1) and Calibre 64-bit version (2.64.0) for Windows.

    • If you got the key successfully, then there must be something wrong with the ePub. I seem to recall that B&N sometimes put the encryption files of the ePub in a common location rather than in the ePub. A log of an import attempt for the ePub might give further clues

      • Thanks Laura and Paul! Here’s a log of the epub import attempt:

        calibre Debug log
        calibre 2.64 [64bit] embedded-python: True is64bit: True
        Windows-8-6.2.9200 Windows (’64bit’, ‘WindowsPE’)
        (‘Windows’, ‘8’, ‘6.2.9200’)
        Python 2.7.9
        Windows: (‘8’, ‘6.2.9200’, ”, ‘Multiprocessor Free’)
        Successfully initialized third party plugins: DeDRM (6, 5, 1)
        Starting up…
        Started up in 4.43 seconds with 141 books
        DeDRM v6.5.1: Trying to decrypt 9781936976423.epub
        DeDRM v6.5.1: Verifying zip archive integrity
        DeDRM v6.5.1: Error ‘File is not a zip file’ when checking zip archive
        Running file type plugin DeDRM failed with traceback:
        Traceback (most recent call last):
        File “site-packages\calibre\customize\ui.py”, line 154, in _run_filetype_plugins
        File “calibre_plugins.dedrm.__init__”, line 619, in run
        File “calibre_plugins.dedrm.__init__”, line 191, in ePubDecrypt
        Exception: File is not a zip file
        Traceback (most recent call last):
        File “site-packages\calibre\customize\ui.py”, line 376, in get_file_type_metadata
        File “site-packages\calibre\customize\builtins.py”, line 188, in get_metadata
        File “site-packages\calibre\ebooks\metadata\epub.py”, line 237, in get_metadata
        File “site-packages\calibre\ebooks\metadata\epub.py”, line 154, in get_zip_reader
        File “site-packages\calibre\utils\localunzip.py”, line 234, in __init__
        File “site-packages\calibre\utils\localunzip.py”, line 210, in _extractall
        ValueError: Not a ZIP file
        Added 9781936976423 to db in: 1.6
        Added 1 books in 2.1 seconds

        • “DeDRM v6.5.1: Error ‘File is not a zip file’ when checking zip archive” is the problem. EPUBs should be zip files, and something’s wrong with this file. You could try unzipping it with other zip ultilities, and then rezip and see if things work then.

  6. Hi I’m new to this and having no success stripping the DRM from a .azw file taken from Kindle for PC (I got if from the “My Kindle Content” folder in My Documents). I’m using the plugin for Calibre on a Windows 10 laptop.

    calibre Debug log
    calibre 2.64 embedded-python: True is64bit: False
    Windows-8-6.2.9200 Windows (’32bit’, ‘WindowsPE’)
    32bit process running on 64bit windows
    (‘Windows’, ‘8’, ‘6.2.9200’)
    Python 2.7.9
    Windows: (‘8’, ‘6.2.9200’, ”, ‘Multiprocessor Free’)
    Successfully initialized third party plugins: DeDRM (6, 5, 1)
    Starting up…
    Started up in 4.64 seconds with 1 books
    stdout+stderr from file dialog helper: [”, ”]
    piped data from file dialog helper: [‘(\x7fDn\xb0r\x0c a\xde\x8d\xe6\x97\xd7\xa5piH\xd7\xdb\xe7\xbe7\xdct\x7f\xe7\x94\xbe\xa57\xd2’, ‘C:\\Users\\k.needham\\Documents\\My Kindle Content\\B00FGJC3OQ_EBOK.azw’]
    DeDRM v6.5.1: Trying to decrypt B00FGJC3OQ_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: Lonely Planet Europe on a shoestring (Travel Guide)
    Found 4 keys to try after 0.2 seconds
    Crypto Type is: 2
    DeDRM v6.5.1: Failed to decrypt with error: No key found in 4 keys tried.
    DeDRM v6.5.1: Looking for new default Kindle Key after 0.2 seconds
    searching for kinfoFiles in C:\Users\k.needham\AppData\Local
    Found K4PC 1.9+ kinf2011 file: C:\Users\k.needham\AppData\Local\Amazon\Kindle\storage\.kinf2011
    Decrypted key file using IDString ‘641702217’ and UserName ‘6b2e6e65656468616d’
    DeDRM v6.5.1: 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 154, in _run_filetype_plugins
    File “calibre_plugins.dedrm.__init__”, line 608, in run
    File “calibre_plugins.dedrm.__init__”, line 558, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.5.1: Ultimately failed to decrypt after 0.2 seconds
    Added Lonely Planet Europe on a shoestring (Travel Guide) to db in: 0.4
    Added 1 books in 1.4 seconds

  7. I’ve the same problem as above (Kate N): I’m on a mac, it is operating with OS X Yosemite ver. 10.10.5. I honestly cannot recall where I got the book files, *.AZT. I was thinking perhaps I could convert them to PDF’s. Each time I’m told that they have DRM protection. I tried this with two different books. Here is my log:
    Aug 24 19:04:15 Yvette-Masullos-iMac-4.local calibre-debug[11708] : The function ‘CGContextErase’ is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance.
    calibre Debug log
    calibre 2.63 embedded-python: True is64bit: True
    Darwin-14.5.0-x86_64-i386-64bit Darwin (’64bit’, ”)
    (‘Darwin’, ‘14.5.0’, ‘Darwin Kernel Version 14.5.0: Thu Jun 16 19:58:21 PDT 2016; root:xnu-2782.50.4~1/RELEASE_X86_64’)
    Python 2.7.11
    OSX: (‘10.10.5’, (”, ”, ”), ‘x86_64’)
    Successfully initialized third party plugins: DeDRM (6, 5, 1)
    Starting up…
    Started up in 2.54 seconds with 295 books
    Aug 24 19:04:45 Yvette-Masullos-iMac-4.local calibre-parallel[11716] : The function ‘CGContextErase’ is obsolete and will be removed in an upcoming update. Unfortunately, this application, or a library it uses, is using this obsolete function, and is thereby contributing to an overall degradation of system performance.
    DeDRM v6.5.1: Trying to decrypt The Whisper Jar-asin_B0062ID33K-type_EBOK-v_0.azw
    Using Library AlfCrypto DLL/DYLIB/SO
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 5, header length 248
    Extra Data Flags: 1
    Decrypting Mobipocket 5 ebook: The Whisper Jar
    Found 0 keys to try after 0.0 seconds
    Crypto Type is: 2
    DeDRM v6.5.1: Failed to decrypt with error: No key found in 0 keys tried.
    DeDRM v6.5.1: Looking for new default Kindle Key after 0.0 seconds
    Found k4Mac kinf2011 file: /Users/yvettemasullo/Library/Containers/com.amazon.Kindle/Data/Library/Application Support/Kindle/storage/.kinf2011
    Decrypted key file using IDString ‘6d8fb1d8aeca’ and UserName ‘yvettemasullo’
    DeDRM v6.5.1: Found 1 new key
    MobiDeDrm v0.41.
    Copyright © 2008-2012 The Dark Reverser et al.
    MOBI header version 5, header length 248
    Extra Data Flags: 1
    Decrypting Mobipocket 5 ebook: The Whisper Jar
    Found 4 keys to try after 0.3 seconds
    Crypto Type is: 2
    DeDRM v6.5.1: 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 154, in _run_filetype_plugins
    File “calibre_plugins.dedrm.__init__”, line 608, in run
    File “calibre_plugins.dedrm.__init__”, line 558, in KindleMobiDecrypt
    DeDRMError: DeDRM v6.5.1: Ultimately failed to decrypt after 0.3 seconds
    Worker Launch took: 0.0483238697052
    Added The Whisper Jar to db in: 0.1
    Added 1 books in 0.9 seconds

  8. Calibre-portable v2.65.1
    Removed all user-installed plugins, applied changes, restarted Calibre.
    Installed DeDRM plugin zip in Calibre, applied changes, restarted Calibre.

    Import newly purchased Kindle PC ebook (42mb in size (complilation of over 100 novels and novellas by one author)), no errors displayed, took under 5 seconds.
    Attempt to open the imported ebook in Calibre, calibre-parallel.exe stopped working, error “Could not open ebook”
    calibre, version 2.65.1
    ERROR: Could not open ebook: Failed to read book, C:\Users\asdf\Desktop\Desktop Stuff\Calibre Portable\Calibre Library\asdf\asdf(193)\asdf.mobi click “Show Details” for more information

    Traceback (most recent call last):
    File “site-packages\calibre\utils\ipc\simple_worker.py”, line 51, in run
    File “site-packages\calibre\utils\ipc\__init__.py”, line 19, in eintr_retry_call
    EOFError

    Conversion of that book mobi to epub in Calibre also fails.

    Calibre log below.
    ———————-
    calibre Debug log
    calibre 2.65.1 Portable embedded-python: 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 (6, 5, 1)
    Starting up…
    Failed to read metadata from font file: c:\windows\fonts\carbar1.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar10.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar11.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar12.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar13.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar14.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar15.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar16.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar17.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar18.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar19.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar2.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar20.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar21.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar22.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar23.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar24.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar3.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar4.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar5.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar6.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar7.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar8.ttf tuple index out of range
    Failed to read metadata from font file: c:\windows\fonts\carbar9.ttf tuple index out of range
    Started up in 3.95 seconds with 168 books
    stdout+stderr from file dialog helper: [”, ”]
    piped data from file dialog helper: [‘\x18K\xc8k\xe7o_6\xa9\xf2v\xd6C\xf8\x90\xf8\x8d\x12\x89\xb6/\x8e\xbd\xf8\xabi\xd2\xd8\xed\xf9U\xab’, ‘C:\\Users\\asdf\\Documents\\My Kindle Content\\B00U31AFEW_EBOK.azw’]
    DeDRM v6.5.1: Trying to decrypt B00U31AFEW_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: 3
    Decrypting Mobipocket 6 ebook: asdf
    Found 4 keys to try after 0.4 seconds
    Crypto Type is: 2
    File is encoded with PID KJZzN5mjP4.
    Decrypting. Please wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . done
    Decryption succeeded after 3.4 seconds
    DeDRM v6.5.1: Finished after 3.6 seconds
    Added asdf to db in: 1.7
    Added 1 books in 6.2 seconds
    Worker Launch took: 0.576999902725
    Worker Launch took: 0.763000011444
    Job: 2 Convert book 1 of 1 (asdf) finished
    Convert book 1 of 1 (asdf)
    Resolved conversion options
    calibre version: 2.65.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’C:\\Users\\asdf\\AppData\\Local\\Temp\\calibre_do0zgl\\ogmayq.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\\asdf\\AppData\\Local\\Temp\\calibre_do0zgl\\zay32z.opf’,
    ‘remove_fake_margins’: True,
    ‘remove_first_image’: False,
    ‘remove_paragraph_spacing’: False,
    ‘remove_paragraph_spacing_indent_size’: 1.5,
    ‘renumber_headings’: True,
    ‘replace_scene_breaks’: u”,
    ‘search_replace’: ‘[]’,
    ‘series’: None,
    ‘series_index’: None,
    ‘smarten_punctuation’: False,
    ‘sr1_replace’: None,
    ‘sr1_search’: None,
    ‘sr2_replace’: None,
    ‘sr2_search’: None,
    ‘sr3_replace’: None,
    ‘sr3_search’: None,
    ‘start_reading_at’: None,
    ‘subset_embedded_fonts’: False,
    ‘tags’: None,
    ‘timestamp’: None,
    ‘title’: None,
    ‘title_sort’: None,
    ‘toc_filter’: None,
    ‘toc_threshold’: 6,
    ‘toc_title’: None,
    ‘transform_css_rules’: ‘[]’,
    ‘unsmarten_punctuation’: False,
    ‘unwrap_lines’: True,
    ‘use_auto_toc’: False,
    ‘verbose’: 2}
    InputFormatPlugin: MOBI Input running
    on C:\Users\asdf\AppData\Local\Temp\calibre_do0zgl\3hoh0w.mobi
    Extracting text…
    Adding anchors…
    Extracting images…
    Cleaning up HTML…
    Parsing HTML…

    Convert book 1 of 1 (asdf)
    Resolved conversion options
    calibre version: 2.65.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’C:\\Users\\asdf\\AppData\\Local\\Temp\\calibre_do0zgl\\ogmayq.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\\asdf\\AppData\\Local\\Temp\\calibre_do0zgl\\zay32z.opf’,
    ‘remove_fake_margins’: True,
    ‘remove_first_image’: False,
    ‘remove_paragraph_spacing’: False,
    ‘remove_paragraph_spacing_indent_size’: 1.5,
    ‘renumber_headings’: True,
    ‘replace_scene_breaks’: u”,
    ‘search_replace’: ‘[]’,
    ‘series’: None,
    ‘series_index’: None,
    ‘smarten_punctuation’: False,
    ‘sr1_replace’: None,
    ‘sr1_search’: None,
    ‘sr2_replace’: None,
    ‘sr2_search’: None,
    ‘sr3_replace’: None,
    ‘sr3_search’: None,
    ‘start_reading_at’: None,
    ‘subset_embedded_fonts’: False,
    ‘tags’: None,
    ‘timestamp’: None,
    ‘title’: None,
    ‘title_sort’: None,
    ‘toc_filter’: None,
    ‘toc_threshold’: 6,
    ‘toc_title’: None,
    ‘transform_css_rules’: ‘[]’,
    ‘unsmarten_punctuation’: False,
    ‘unwrap_lines’: True,
    ‘use_auto_toc’: False,
    ‘verbose’: 2}
    InputFormatPlugin: MOBI Input running
    on C:\Users\asdf\AppData\Local\Temp\calibre_do0zgl\3hoh0w.mobi
    Extracting text…
    Adding anchors…
    Extracting images…
    Cleaning up HTML…
    Parsing HTML…

    • You may have found a bug in calibre’s handling of the Mobi format. Does the copy now stored by calibre open successfully in Kindle for PC?

      And your quickest route to getting it converted is probably to use the KindleUnpack plugin to get an ‘epub’ out of it, and then either convert that in an ePub->ePub conversion, or manually fix up any coding/formatting errors.

  9. I downloaded DeDRM 6.5.1. Installed Alf Calibre plugin. Restarted Calibre. Added an azw3 book with DRM. When I tried to convert to mobi. I got the “Cannot convert… Book is locked by DRM” popup. What is wrong?

    • calibre Debug log
      calibre 2.62 [64bit] embedded-python: 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 (6, 5, 1)
      Starting up…
      Started up in 16.47 seconds with 1 books
      stdout+stderr from file dialog helper: [”, ”]
      piped data from file dialog helper: [‘~\xd4\x8b\xf2\xcfQ\x88E2\xa0\x92\xdc\x93*d\xb9w\xc1\xaf\x82\xf5 1\xfc\xcc\x8c\xef=\xbf\x88,\xeb’, ‘C:\\Users\\Rick Slansky\\My eBooks\\azw books\\The Sands of Osiris (Aegis Colony 1).azw3’]
      DeDRM v6.5.1: Trying to decrypt The Sands of Osiris (Aegis Colony 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: The Sands of Osiris (Aegis Colony 1)
      Found 2 keys to try after 0.1 seconds
      Crypto Type is: 2
      DeDRM v6.5.1: Failed to decrypt with error: No key found in 2 keys tried.
      DeDRM v6.5.1: Looking for new default Kindle Key after 0.1 seconds
      searching for kinfoFiles in C:\Users\Rick Slansky\AppData\Local
      No K4PC kindle.info/kinf/kinf2011 files have been found.
      DeDRM v6.5.1: 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 154, in _run_filetype_plugins
      File “calibre_plugins.dedrm.__init__”, line 608, in run
      File “calibre_plugins.dedrm.__init__”, line 558, in KindleMobiDecrypt
      DeDRMError: DeDRM v6.5.1: Ultimately failed to decrypt after 0.1 seconds
      Added The Sands of Osiris (Aegis Colony 1) to db in: 0.1
      Added 1 books in 0.7 seconds

  10. Hi. I’m coming crazy because I cannot install in calibre the DeDRM plugin, even if I did all I read necessary to do. I hope to receive some help.
    This is what I’ve done:
    1) I downloaded DeDRM_tools 6.5.1; I extracted from the zip file the archive the DeDRM_calibre_plugin and I installed that plugin in calibre.
    2) I installed KindleForPC, and using it I got my book, contained in an azw3 file.
    3) loooking in calibre ‘preferences’ I saw that DeDRM must be configured inserting the proper key relative to your amazon account. I got my key from my Amazon profile and inserted it in ‘Kindle for Mac/PC ebooks’ window.
    Then I imported the ebook to calibre. Despite to all my work, the DeDRM plugin doesn’t work and if ask calibre to read the ebook or to convert the azw3 file in another format, e.g. a epub format, calibre tells me the file is DRM proected so a conversion is impossible.
    I thought I did anything that was needed for the DeDRM plugin working.
    What am I missing?

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