Return to CCSC Notes
 

Convert Kindle & others to MOBI or other ebook Formats

 Last updated 02/05/2013

 

The Programs and Python files listed below have functioned properly on Win XP and Win 7 for the Kindle, Nook and Adobe-Digital Formats.

 

Background:  Step 1

 

The following information is based upon the SIG or Presentation discussions and your familiarity with Windows Explorer [or My Computer] file management and navigation concepts.  You must not have the file extensions hidden - uncheck the box in Control Panel > Folder Options > View.

 

Python is a C like programming language often compared to Perl, Ruby or Java.  With a minor exception, described in the following sentences, you do not need to know any of the programming language.  Python files have an extension of .py whereas Python applications have a file extension of .pyw.  Double clicking on a .pyw file will automatically execute the application [assuming you have the Python Program properly installed on your Windows PC].

 

After installing Python be sure to check that your "PATH" includes the Python location.  The Path statement is found in Control Panel  System  -> Advanced -> Environment Variables. 
Look in the System Variable window for PATH statement.

 

It was recently noticed on one Win 7 64bit that the default installation had to be changed from C:\Python27 to C:\Program Files (x86)\Python27

 

DO NOT INSTALL ANY 64 BIT VERSIONS OF THE PROGRAMS – THEY WILL NOT WORK !

 

UNINSTALL ANY OLD VERSIONS OF PYTHON BEFORE INSTALLING Active Python 2.7 !

[NOTE-1: Windows Open Office 3.1 uses Python version 2.6.1, older versions use v2.3.4
and I have not checked functionality of Open Office with any of these programs.]

[NOTE-2: Many HP PC's ship with an older version of Python.]
 

For the Kindle first get the 16 digit serial number by opening your Kindle, click “Home” then “Menu”.  Now scroll down to “Settings” and enter. This will bring up a window containing information at the bottom of the page under “Device Info”. Write down the 16 character alphanumeric Serial Number.  Note: On older versions of Kindle you need to type 411 to get the serial number.

 

Next get your PID at http://kindletools.prestonlee.com/ or use the Python application kindlepid.pyw [in MOBI_Additional_Tools] after you get the tools zip below.  Write down the 10 character alphanumeric PID.

 

For the Barnes and Noble Nook you need the (bnepubkey.b64) which is derived from your account user name and your account credit card number using the Python application ignoblekeygen_vx.x.pyw [in the Barnes_and_Noble_ePub_Tools] after you get the tools zip below.  If you have multiple accounts rerun the application and use a unique name [<name>.b64] for each account.  You must use the .b64 extension.

 

* For the Adobe - Digital Editions you will first need to get an “Adobe ID” which is a "Log-on" and "Password" at adobe.com to install the software.
If you plan to borrow library books from the Overdrive Library for your Nook the “Adobe ID” "Log-on" and "Password"

MUST be identical to your Barnes and Noble account !

DO NOT use the anonymous ID or you will not be able to transfer your books to your Nook or mobile device !

 

When you download and install Adobe Digital and use your Adobe ID for the setup. 

            Note:  You must have Adobe Flash Player installed to download and install Adobe Digital Editions.

 

You will also need to get the two Adobe folders from the Tools file "Adobe_ePub_Tools" and "Adobe_PDF_Tools" and run the application ineptkey_vx.x.pyw.

 

Download the required files:  Step 2

 

Next download following programs to your hard drive & save in a known location:

 

Tools v3.8a file:                  tools_v3.8a.zip  Size: 696.2KB [713KB actual] 4/13/2011  Obsolete

http://www.datafilehost.com/download-8210f840.html

[References to the obsolete old files have been replaced xx'x as in "tools_v3.8.zip" now "tools _vx.x.zip"]

When the Tools files become obsolete please check links below for latest version

Apprentice Alf's Blog  for the latest version or http://apprenticealf.wordpress.com/2010/02/11/hello-world/

Also from Apprentice Alf:   Ebook Formats, DRM and You — A Guide for the Perplexed

Latest Known Version:  Tools v5.6.1 file:                    

        http://www.datafilehost.com/download-95e7d2dd.html

        MD5 (tools_v5.6.1.zip) = 23ba653c28a5bf044af970ed97282f8a

 

ActiveState's Active Python 2.7 Community Edition for Windows (x86) 32 bits.

      ActivePython-2.7.2.5-win32-x86.msi

This can be downloaded for free from:

http://www.activestate.com/activepython/downloads

 

PyCrypto installers for Windows.

pycrypto-2.3.win32-py2.7.zip

One such place is:

http://www.voidspace.org.uk/python/modules.shtml

 

Calibre                       [Free Format Conversion Program for eBooks]

            http://calibre-ebook.com/download  for all operating systems

            calibre-0.9.17.msi or latest current version for Win XP, Vista or Win7 [v 0.9.17 as of 2/05/2013]

            New:  Calibre Portable [latest version] put on Windows Flash Drive

 

 

* Adobe - Digital Editions [Note: you will not be able to download and save the installer on your PC]

            From Adobe Digital Editions or from either the MCLD Phoenix Overdrive Library or the MCLD Freading Library

 

 

Install and Configure the Software:  Step 3

 

First install Active Python and then PyCrypto with the default options.  Do not change anything.
Second Install the Adobe Digital and use the same email address and password that you used at Adobe and Barnes and Noble .
Third unzip the tools_vx.x at the saved location [unzipping will create a "tools_vx.x" folder with all of the various tools separated by name / function]. 

 

Note:  All of the Folders in the Tools have read me files with expanded directions - Please consider reading if you want more information.

 

Now copy the Adobe folders from the Tools file "Adobe_ePub_Tools" and "Adobe_PDF_Tools" new directory, open the folder and and run the application ineptkey_vx.x.pyw  to create the Adept Key file (adeptkey.der)

If you have a Kindle enter the generated PID(s) in the PID list and the Serial Number(s) in the Kindle Serial Number list, remembering to separate with a coma and no spaces.

 If you have a Nook use the Python application ignoblekeygen_vx.x.pyw to generate a bnepubkey.b64 key file. The bnepubkey.b64 should appear on the second line of the preferences box

 

Next copy the “DeDRM_WinApp_vx.x.zip” to the same new directory and unzip at this location

Open the folder [DeDRM_WinApp_vx.x] and create a short-cut to “DeDRM_Drop_Target.bat” and move that short-cut to your Desktop.

To set the preferences simply double-click on your just created short-cut, enter your information and follow directions.

 

 

Finally if you need to convert between MOBI (AZW) and ePUB or other eBook formats you will now need to install Calibre which handles the following Formats:

 

Input Formats:     CBZ, CBR, CBC, CHM, EPUB, FB2, HTML, HTMLZ, LIT, LRF, MOBI, ODT, PDF, PRC, PDB, PML, RB, RTF, SNB, TCR, TXT, TXTZ

Output Formats:  EPUB, FB2, OEB, LIT, LRF, MOBI, HTMLZ, PDB, PML, RB, PDF, SNB, TCR, TXT, TXTZ

 

[Below is edited from the “ReadMe_First.txt” file in the “tools” folder]

Calibre Users (Mac OS X, Linux, Windows)

-------------

If you are a calibre user, the quickest and easiest way to convert your ebooks is to open the “Calibre_Plugins” folder and install each of the plugins following the instructions and configuration directions provided in each of the plugins associated README file.

 

Once installed and configured, you can simply import a book into Calibre and end up with the converted version in the Calibre database.

 

These plugins work for Windows, Mac OS X, and Linux

 

[Note: Since the plugin’s are Python Scripts, it is reasonable to assume that they will not function if Python and PyCrypto <or OpenSSL> are not installed on your system.]

 

Configuration:

You already have keyfiles generated with ‘ignoblekeygen.pyw  script and with ineptkey.pyw script

Now click the 'Open Calibre configuration directory' button.  Find your ‘bnepubkey.b64’ and 'adeptkey.der' keyfiles  and Past them in the Calibre configuration directory.

 

If you have more than one of the ‘.b64’ or ‘.der’ keyfiles make sure that they have different names and are saved with the appropriate extension.   This directory isn't touched when upgrading Calibre, so it's quite safe to leave them there.

 

This step configures all three of the following addins that use Adobe's Adept:

1. Ignoble Epub DeDRM - ignobleepub_vXX_plugin.zip  for Barnes & Noble Epubs.

2. Inept Epub DeDRM - ineptepub_vXX_plugin.zip  for Adobe Digital Edition Epubs.

3. Inept PDF Plugin - ineptpdf_vXX_plugin.zip  for Adobe Digital Edition PDFs.

 Configuration for K4MobiDeDRM_v03.8_plugin.zip  for standalone Kindles, Mobi Books, and for Devices with Fixed PIDs.

 

Highlight the plugin (K4MobiDeDRM under the "File type plugins" category) and click the "Customize Plugin" button on Calibre's Preferences->Plugins page. Enter your 10 digit PID.  If you have more than one PID separate them with a comma (no spaces).  If you have a standalone Kindle include the 16 digit serial number (these typically begin "B0...") in this list (again separated from the PIDs or other serial numbers with a comma (no spaces).

 

 Some additional notes on Calibre

 

      Excelent book on how to use & Install Calibre  Guide to Calibre and ebook Management.

Calibre will ask for a default directory for the “Calibre Library” – write down the path or change its location to C:\Calibre Library\ or any other easily remembered location. [It also can be changed from within the program.]  New default is in Documents !

Calibre will work if you plug in your eBook to your computer, but if you can access the book files independently, you can create a new directory in the Calibre Library for your original book files.

Once you have the books in their own file folders, they can be added to the Calibre library by using the Red + icon at the top left of the program.

Once the files are in the library [they will be sorted by authors] they can be converted to other readable formats which will appear in the author’s folders.

See the Calibre web site for more features, User Manual, books, demos, etc.

See DRM free Calibre Books to browse 2957 Open Books in 15 genres as of 03/11/2012.

 

A Link to Comparison Tables of Features and Supporting Hardware of various ebook formats.

http://en.wikipedia.org/wiki/Comparison_of_e-book_formats#Comparison_tables

 

If you are interested in more information on Python and programming in Python go to http://www.python.org and/or http://www.activestate.com/activepython