Remove Drm from Amazon Kindle azw
I like to read Kindle books in an electronic form on my iPhone, but find that it’s pretty hard to come by them legally; there are many different sellers and formats, some of which have certain books but not others. Sometimes they have the book, but not in a format I can do anything with. It’s generally easier just to illegally download them from torrent sites.
Amazon has tons and tons of books available for Kindle, and have chosen the standard MobiPocket format as the one their reader uses, meaning it is theoretically trivial to purchase them and convert them to something else. Except that they won’t sell them to you unless you have already purchased a $400ish Kindle on which to read them. Meaning you don’t need to convert them…
In any case , somebody do not like Kindle, or they have iPhone or iPad, want to transfer the Kindle books to other devices, here need a method to remove drm from Kindle and convert Amazon .azw eBooks to ePub, THML, Text or orther types.
Now, here is the method for striping drm from Kindle.
Howto:
Step 1) On the Kindle, go to the Settings menu, and type ‘411’ on the keypad. This will bring up a little information dialog with a bunch of things in it, of which you only need the Serial. It is a 16-character string of letters and numbers. Write it down.
Step 2) Log in to Amazon account and navigate to ‘Kindle Downloads‘ page from your computer. The Kindle Downloads page will list all the books purchased. Click ‘Download to computer’ and you’ll get a file named ‘Title-of-Book.azw’
Step 3) Download MobiDeDRM.zip, which is a small suite of Python scripts that some kind soul wrote and then distributed through links that expire all the time and can be kind of a pain to track down. This .zip file contains mobidedrm.py, mobidedrm2.py, kindlepid.py and mobihuff.py.
(These scripts require you install Python on your system.)
The easiest way to get your PID (or secret code used to unlock the Kindle book) is to use Preston Lee’s online Kindle PID generator. Simply follow the instructions there.
Now that you’ve got your PID, we’ll need to remove the DRM from any books purchased for that Kindle.
Step 4) Now it’s time to remove the DRM. Do this:
python mobidedrm.py Title-of-Book.azw Title-of-Book.mobi Z1QFCDQ*74
where the 10-character gibberish string is replaced with the one you made note of in the last step. When it finishes you’ll see:
Decrypting. Please wait... done
Now the the kindle drm decrypted , you will have a decrypted MobiPocket-formatted ebook that you can read in any MobiPocket reader.
Userfull guide: How to convert Amazon Kindle for PC books.
If, however, you want to convert AZW to HTMLto read on any device you wish, you’ll want to install MobiPerl. (This, of course, will require you to install Perl. MobiPerl’s website will walk you through that.)
5) With MobiPerl installed, do this:
mobi2html Title-of-Book.mobi
This will create a directory named ‘unpacked’ that will contain Title-of-Book.html
Things that can go wrong:
Amazon seems to compress longer books in a slightly different manner than shorter books. If your resulting .mobi file and/or .html file are oddly gibberishy (for example, if the first line starts in the middle of a sentence, and clearly not the beginning of the book), let’s go back to step 5.
Step 4b) These ‘huffdic-compressed’ books require a slightly different script to remove the DRM. Do this:
python mobidedrm2.py Title-of-Book.azw Title-of-Book.mobi Z1QFCDQ*74
Note the ‘2’ in ‘mobidedrm2.py’ in this one and remember to replace my gibberish PID with yours.
5b) The ‘huffdic-compressed’ files also require a different script to convert them to HTML. Do this:
python mobihuff.py Title-of-Book.mobi Title-of-Book.html
This script will output the .html file in the directory from which you are running it.
- Laura
- Re:Remove Drm from Amazon Kindle azw
- 1/8/2011 7:13:56 AM
- 71.206.202.3
I did all of the above with python; however when I type in the code:
python mobidedrm2.py Title-of-Book.azw Title-of-Book.mobi Z1QFCDQ*74with my Kindle info and the book title info I get SyntaxError: invalid syntax.
I have no idea what I am doing wrong.
- Laura Werner
- Re:Remove Drm from Amazon Kindle azw
- 1/9/2011 12:08:14 AM
- 208.106.97.251
Just a guess: You probably need to install a different version of Python. If you installed 3.0, try installing 2.6 or 2.7, and vice-versa. There were some non-backwards-compatible syntax changes between Python 2.x and 3.0.
-- (different) Laura
- mahlon
- Re:Remove Drm from Amazon Kindle azw
- 1/20/2011 1:43:56 AM
- 124.148.51.205
Laura, I've just gone thru the same process. You need to put all scripts and files in the same folder (I called it 'kindle') somewhere easy to describe - like directly under C:. The from the windows command prompt type (e.g.):
cd C:\kindlepython mobidedrm.py "C:\kindle\Title-of-Book.azw" "C:\kindle\Title-of-Book.mobi" XXXXXXX*X0
That worked to get the script to work for me without error - unfortunately the scripts to return a valid don't seem to work for kindle 3 which is what I've got. Still searching for a solution.
- Kurt
- Re:Remove Drm from Amazon Kindle azw
- 3/27/2011 1:43:27 PM
- 71.142.232.48
I seem to be missing a basic step. I have my PID.
Step 4) Now it’s time to remove the DRM. Do this:python mobidedrm.py Title-of-Book.azw Title-of-Book.mobi Z1QFCDQ*74
Wait! What? Where do I type that in? There's something missin here.