Shiny New E-Book Gizmo: The Amazon Kindle


View Full Version : How to make Igor's script work


sunshine6855
01-01-2008, 04:58 PM
I love technology but I am clueless when it comes to software. How does a fairly intelligent person who does not do computer programing make this script work to change Mobi drm to be readable on Kindle. I have put in an order for the device but it will be 4-6 weeks before it arrives. Plenty of time to convert the legally purchased Mobi books I have to work on Kindle. I still have v.6.0 mobi reader on one computer so maybe it will tell me the Kindle PID. However, if that doesn't work, what to do.

I have a pc with XP. What do I need to do to make theses work? can someone programming illiterate do this?

DaleDe
01-01-2008, 06:15 PM
I love technology but I am clueless when it comes to software. How does a fairly intelligent person who does not do computer programing make this script work to change Mobi drm to be readable on Kindle. I have put in an order for the device but it will be 4-6 weeks before it arrives. Plenty of time to convert the legally purchased Mobi books I have to work on Kindle. I still have v.6.0 mobi reader on one computer so maybe it will tell me the Kindle PID. However, if that doesn't work, what to do.

I have a pc with XP. What do I need to do to make theses work? can someone programming illiterate do this?

first you need the ID from the Kindle so you can't even start yet.

Dale

wallcraft
01-01-2008, 08:23 PM
There is nothing you can actually do until you get the serial number for your Kindle. Also, note that this proceedure won't work on e-books from mobipocket.com and some other sites.

You will need Python. See Python On Windows XP: 7 Minutes To “Hello World!” (http://www.richarddooling.com/index.php/2006/03/14/python-on-xp-7-minutes-to-hello-world/).

If you download Igor's programs, the included readme.txt includes a test example. Open a command window (START > All Programs > Accessories > Command Prompt). In the command window: cd dirpath
kindlepid.py serialnumber
The full "dirpath" starts with a capital letter, e.g. C:\, and I usually get it by copying and pasting from the Address header of a windows open on that directory (in this case the azw-0.1 directory). The serialnumber is under the back cover or on the box, or use Igor's test number for now. Note that the arrow keys allow you to recall previous command lines and you can edit them to create modified commands.

Then register the PID at your e-book seller's web site and re-download your e-books. Finally use kindlefix.py in a command window to convert each .prc (or .mobi) file to a valid .azw file.

TallMomof2
01-02-2008, 10:21 AM
I was a total novice when it came to running scripts on my XP PC. It took me a couple of days of trial and error but this is what worked.

1. Download and install Python. I installed version 2.5. It is in a directory labeled: c:\Python25
2. Download and unzip Igor's scripts. Either unzip or move the scripts to c:\Python25\Tools\Scripts
3. Edit the PATH to include the Python executable and the path to the scripts (where you placed Igor's scripts). In XP right-click on "My Computer" then click on "Properties","Advanced" tab, "Environmental Variables". In the System Variables window find and highlight "PATH" and click edit. Add the paths. The two paths I added were ;c:\Python25 and ;c:\Python25\Tools\Scripts. Please note that each path starts with a semi-colon ";" Be sure your typing is correct and click "OK" Keep clicking "OK" until you're out of the System Properties window.
4. Now you can go to the command prompt and run kindlepid.py serialnumber to find out your Kindle PID.
5. You have to take that PID to your ebook seller and enter it in so that your MobiPocket DRMed books can be regenerated with the Kindle PID. Download those regenerated books and put into a folder you can easily find under the command prompt.
6. Go to the command prompt and navigate to the folder where you placed your regenerated MobiPocket books.
7. Then run kindlefix.py All the books I downloaded had .prc extension so the command I used was:
kindlefix.py MyBook.PRC MyKindlePID

I was able to convert all my MobiPocket ebooks from one of two ebook stores. *However*, 95% of the books did not show titles when loaded onto the Kindle. There's a fix for that MobiPerl thread (http://www.mobileread.com/forums/showthread.php?p=133359#post133359) Fortunately, you won't have to install Perl to get this to work assuming the Windows executables work in Vista. I was able to add back title and author to the file so that I could see them on the Kindle.

I'm no expert but I'm not afraid to try new (at least to me) things on the PC.

I don't know what, if any, differences there are to running all this in Vista but if there are, I hope you let us know.

HTH

sunshine6855
01-03-2008, 10:41 PM
Ok. I downloaded python and put Igor's scripts in the scripts folder. I edited my path to include c:\python25 and c:\python25\tools\scripts. I ran the kindlePID.py using Igor's serial and got the PID. So far so good.

I then downloaded a book using the PID. Now I don't know what to do.

In command prompt, I entered the path to where the book was located and entered kindlefix.py ClassifiedChristmas-586.prc V176CXM*FZ and received
'kindlefix.py' is not recognized as an internal or external command, operable program or batch file.

I then went to path: c:\python25\tools\scripts and enter the same as above and received to much to write. Needless to say, it didn't work.

So, what am I doing wrong? I am excited I got the kindlepid.py to work. Now if I would just figure out the rest.

sunshine6855
01-03-2008, 11:15 PM
Please ignore previous post. I finally figured it out. I am so excited!!! Now all I need is a Kindle so I can do it with my books. Thanks for the tools Igor.

TallMomof2
01-04-2008, 12:16 PM
Glad you got it to work! It took me hours over several days to figure out how to do this.

sunshine6855
01-04-2008, 05:26 PM
The true test will be when I get my own Kindle and try to change my own books. I could not have done it without you instructions. Thanks so much.

revmike
02-20-2008, 05:52 PM
would the above procedure work with books purchased from the palm ebooks site, for use on a sony 505 reader?

sheaps98
02-25-2008, 03:02 PM
How do I get the script to work on a Macbook. I have downloaded Phython for Mac and the script. Now what.
Thanks
Susan

MatLu
04-28-2008, 12:16 AM
For the life of me, I can't this script to work with Vista with Python 2.5.2. I thought I did everything correctly, but it just isn't working. I don't know anything about this sort of stuff, so it is possible I'm going something stupid and obvious. I keep on getting a:

When using the Command Line thing I get a NameError: name 'kindlepid' is not defined

I have ;c:\Python25;c:\Python25\Tools\Scripts\ entered in the system variables thing. I have the scripts put into the Scripts folder with the rest of them. I'm typing in kindlepid.py (serial number). I don't know what else to do.

kfchan
05-30-2008, 09:34 AM
OK, I've been trying to convert my secured MOBI books into a Kindle compatible format, but I can't seem to figure it out. Can someone post step by step directions? When I run the script, it doesn't recognize my book - I've tried moving the files to different locations, but it doens't work. Thanks!

wallcraft
05-30-2008, 09:58 AM
Have you tried putting the PRC filename in quotes? This is necessary if it contains spaces. If you type the 1st few letters and then use <tab> to complete the filename the shell will add quotes for you if they are needed. If this is the problem you should have been getting the error "PID not valid". If not, what error do you get?

Also, A Beginner's Guide to Kindle Content (http://www.mobileread.com/forums/showthread.php?t=19649) has a good discussion of which retailers allow you to specify a Kindle PID for your ebooks.

kfchan
05-30-2008, 11:44 AM
I tried using the quotes, still no luck. The error I get is "The file could not be opened - no such file or directory (2)"

Where should I be storing the ebooks I want converted - in the same folder as the python script?

Edited to add: Never mind, I figured it out. Thanks for the help, it was the quotation marks that made the difference.

vinothjaguva
06-11-2008, 02:19 AM
Hi

Please post the kindlefix.py and kindlepid.py python scripts

Thanks in Advance

Leep
06-11-2008, 07:55 PM
Thanks for all the detailed instructions. Had no problem getting my PID, (did notice that CAPS are very important). But I am having problems getting the book to convert. I keep getting the following error: PID is not valid! (should be in format AAAAAAA*DD). I am using the following pid
VYICCG1*S3

Any hints on what I'm doing wrong?

Leep
06-11-2008, 08:08 PM
Ok - I figured it out. Need to run kindlefix from the directory where the book is located, not just add the path name to the book

Thanks to all for your detailed instructions.

wallcraft
06-11-2008, 08:48 PM
Please post the kindlefix.py and kindlepid.py python scripts See Mobipocket books on Kindle (http://igorsk.blogspot.com/2007/12/mobipocket-books-on-kindle.html).

JSWolf
06-23-2008, 08:05 PM
Hi

Please post the kindlefix.py and kindlepid.py python scripts

Thanks in Advance
Please see the following thread. It has a link to get the Python scripts.

http://www.mobileread.com/forums/showthread.php?t=17239

fiosar
06-25-2008, 02:03 PM
Ok - I figured it out. Need to run kindlefix from the directory where the book is located, not just add the path name to the book

Thanks to all for your detailed instructions.

I can't figure out the running of kindlefix.py.

Can someone (LEEP?) help me get the detailed instructions.

Thanks!

Leep
06-25-2008, 02:33 PM
Assume that you have your PID from running the kindlepid.py script. If you have gotten from running the python script, we know that you have python installed properly. If not, you probably want to review Tallmomof2's great instructions in #4 of this thread. Once you know the python scripts run properly and have your PID, open a c:\command prompt window and change to the directory where you have downloaded your book. For example: I keep mine on in a directory on the desktop called ebookstoconvert (cd desktop\ebookstoconvert) Once you see that the directory is correct, the command is kindlefix.py "name of your book.prc(or .mobi)" "your Kindle PID"
As example: kindlefix.py The Great Gatsby.prc 6FKDMIH*PV
You should get confirmation that kindlefix has created a .awz file of the same name as your book. I then email the awz file to my Kindle as an attachment (no subject, no text in the email) I had problems at first because I did not run kindlefix from the directory where my downloaded book was located. Hope this helps.

fiosar
06-26-2008, 03:01 AM
Thanks for the quick response.
Yes, I have my PID from running the kindkepid.py script. Now, I follow precisely TallMomof2's excellent instructions and I navigate, in the command prompt, to the folder (which I named kbooks) where I have placed the book to fix. The name of the book is 0316160172-Mobi.prc as downloaded, with my new PID, from fictionwise. This gives me: C:\kbooks> kindlefix.py 0316160172-Mobi.prc MyKindlePID. However, I get the following message:
Traceback <most recent call last>:
File "c:\Python25\Tools\Scripts\kindlefix.py", line 1, in <module>
import prc, sys, struct
ImportError: No module named prc

Can you see what is wrong?
Thanks again.

Leep
06-26-2008, 10:32 AM
That's a bit of a strange name. Why don't you try renaming the original file leaving out the -mobi part and try that. Else your problem is way beyond me. Think you might need someone experienced in python scripts to help. Sorry that's I'm just a struggler myself.

Cheers

pilotbob
06-26-2008, 10:39 AM
Thanks for the quick response.
Yes, I have my PID from running the kindkepid.py script. Now, I follow precisely TallMomof2's excellent instructions and I navigate, in the command prompt, to the folder (which I named kbooks) where I have placed the book to fix. The name of the book is 0316160172-Mobi.prc as downloaded, with my new PID, from fictionwise. This gives me: C:\kbooks> kindlefix.py 0316160172-Mobi.prc MyKindlePID. However, I get the following message:
Traceback <most recent call last>:
File "c:\Python25\Tools\Scripts\kindlefix.py", line 1, in <module>
import prc, sys, struct
ImportError: No module named prc

Can you see what is wrong?
Thanks again.

Does Kindlefix need the PID? I thought it just fliped a bit in the book. If you run kindlefix without any arguments does it return with the correct usable parameters?

BOb

igorsk
06-26-2008, 11:12 AM
The file prc.py should be next to kindlefix.py.

fiosar
06-26-2008, 01:37 PM
The file prc.py should be next to kindlefix.py.

That's it! I had, in fact, only placed the kindlepid.py and kindlefix.py files to C:\Python25\Tools\Scripts and NOT the prc.py file as well.
After correcting this I have now been able to convert to .azw just fine.

I am now looking for a way to modify the title, if possible on a Mac...

I am really grateful, Igor, for this remarkable work.
I bought my 400$ Kindle from Amazon and had it delivered to a legal address that I have in the US. I am using my Kindle in Central Africa, and I thought that I would be able to download content via my computer. However, I can't even purchase Kindle books from Amazon, because of "geographical restrictions" (which, you notice, they did not apply when I purchased the Kindle...).
Anyway, you have solved my problem and I can now enjoy a good read, even by the light of my kerosene lamp in the middle of the jungle, (thanks also to the good battery of the Kindle...).

Thanks again to all.

pilotbob
06-26-2008, 02:55 PM
I am now looking for a way to modify the title, if possible on a Mac...


find the mobiperl package. Included in a mobi2mobi script that allows you to edit the mobi file's metadata, such as Title.

BOb

fiosar
06-27-2008, 03:45 AM
Thanks Bob, I have been looking at info on downloading and installing mobi2mobi on my Mac, but I have not yet found anything that I can get my head around.

Do you (or anybody) have any pointers or suggestions for us simple users?

pilotbob
06-27-2008, 02:59 PM
Thanks Bob, I have been looking at info on downloading and installing mobi2mobi on my Mac, but I have not yet found anything that I can get my head around.

Do you (or anybody) have any pointers or suggestions for us simple users?

I haven't used it on my Mac yet... but from my understanding it is a perl script.. and I'm pretty sure perl is preinstalled on OS X (I've only had my Mac for less than two weeks no.). But, assuming perl is in the path, you should be able to run the script from the command line. I think there are some docs that come with it. Perhaps when I get home (to my Mac) I'll give it a go.

BOb

pilotbob
06-28-2008, 11:54 AM
Thanks Bob, I have been looking at info on downloading and installing mobi2mobi on my Mac, but I have not yet found anything that I can get my head around.

Do you (or anybody) have any pointers or suggestions for us simple users?

Ok... the mobiperl web site has step by step directions to getting the mobiperl stuf working on a Mac. I have leopard 10.5.3 so perl 5.8.8 is already on it. So, you have to install the CPAN modules and should be good to go. The URL with this info is here:

https://dev.mobileread.com/trac/mobiperl/wiki

BOb

loisanborn
07-16-2008, 12:13 PM
New related question: I successfully ran the Igor scripts on my home computer. Can I use the same kindlePID on my work computer without actually running kindlepid.py and getting a different PID than the one I already have at home?

pilotbob
07-16-2008, 12:15 PM
New related question: I successfully ran the Igor scripts on my home computer. Can I use the same kindlePID on my work computer without actually running kindlepid.py and getting a different PID than the one I already have at home?

I'm not sure what your asking. Your Kindle PID will never change... it is always the same. however, if you mean the PID for your PC in Mobipocket software, it will be different for each PC. But, you should be able to put your two PC's and your Kindles PID into the bookstore and the file would work on all three devices.

BOb

loisanborn
07-16-2008, 12:31 PM
When I had both my PCs' PIDs and my Kindle PID on my Overdrive (e-library) account, I couldn't get kindlefix to work. When I removed both PC PIDs from Overdrive and only kept my Kindle PID on it, I got it to work on my home computer. I haven't tried it yet on my work computer, but was hoping I wouldn't have to run kindlepid.py on my work computer and get a different Kindle PID to post on Overdrive.

pilotbob
07-16-2008, 12:45 PM
When I had both my PCs' PIDs and my Kindle PID on my Overdrive (e-library) account, I couldn't get kindlefix to work. When I removed both PC PIDs from Overdrive and only kept my Kindle PID on it, I got it to work on my home computer. I haven't tried it yet on my work computer, but was hoping I wouldn't have to run kindlepid.py on my work computer and get a different Kindle PID to post on Overdrive.

Ah... no, given a certain Kindle s/n kindlepid.py will always result in the same PID no matter what PC you run it on.

Perhaps Kindlefix.py has only been tested with a file encrypted with a single PID. Perhaps Igorsky will chime in here and correct me though.

Do you have to run Kindle fix? I heard that if you buy from Fictionwise you didn't even need to run it.

BOb

loisanborn
07-16-2008, 01:00 PM
Thanks, Bob. I just ran kindlepid.py and you're right about the Kindle PID staying the same. I just ran kindlefix.py on my work computer and it worked just fine like it does on my home computer. And thanks to Igor for such a great Kindle script!!

Lois

Leep
07-16-2008, 01:31 PM
Glad to see someone else using ebooks from the library. Since many of the libraries subscribe to the Overdrive service, maybe we'll see more and more books available online. Unfortunately, Netlibrary (my other libraries subscription) does not even offer mobipocket format.

cheers

ribbon_cable
07-16-2008, 10:28 PM
Can I get instructions for the Mac like the ones below for PC? I have installed Python but I have no idea how to get the script to work. Dont know how to edit my PATH...

Help!


I was a total novice when it came to running scripts on my XP PC. It took me a couple of days of trial and error but this is what worked.

1. Download and install Python. I installed version 2.5. It is in a directory labeled: c:\Python25
2. Download and unzip Igor's scripts. Either unzip or move the scripts to c:\Python25\Tools\Scripts
3. Edit the PATH to include the Python executable and the path to the scripts (where you placed Igor's scripts). In XP right-click on "My Computer" then click on "Properties","Advanced" tab, "Environmental Variables". In the System Variables window find and highlight "PATH" and click edit. Add the paths. The two paths I added were ;c:\Python25 and ;c:\Python25\Tools\Scripts. Please note that each path starts with a semi-colon ";" Be sure your typing is correct and click "OK" Keep clicking "OK" until you're out of the System Properties window.
4. Now you can go to the command prompt and run kindlepid.py serialnumber to find out your Kindle PID.
5. You have to take that PID to your ebook seller and enter it in so that your MobiPocket DRMed books can be regenerated with the Kindle PID. Download those regenerated books and put into a folder you can easily find under the command prompt.
6. Go to the command prompt and navigate to the folder where you placed your regenerated MobiPocket books.
7. Then run kindlefix.py All the books I downloaded had .prc extension so the command I used was:
kindlefix.py MyBook.PRC MyKindlePID

I was able to convert all my MobiPocket ebooks from one of two ebook stores. *However*, 95% of the books did not show titles when loaded onto the Kindle. There's a fix for that MobiPerl thread (http://www.mobileread.com/forums/showthread.php?p=133359#post133359) Fortunately, you won't have to install Perl to get this to work assuming the Windows executables work in Vista. I was able to add back title and author to the file so that I could see them on the Kindle.

I'm no expert but I'm not afraid to try new (at least to me) things on the PC.

I don't know what, if any, differences there are to running all this in Vista but if there are, I hope you let us know.

HTH

nohmi2
07-17-2008, 08:04 PM
I was a total novice when it came to running scripts on my XP PC. It took me a couple of days of trial and error but this is what worked.

1. Download and install Python. I installed version 2.5. It is in a directory labeled: c:\Python25
2. Download and unzip Igor's scripts. Either unzip or move the scripts to c:\Python25\Tools\Scripts
3. Edit the PATH to include the Python executable and the path to the scripts (where you placed Igor's scripts). In XP right-click on "My Computer" then click on "Properties","Advanced" tab, "Environmental Variables". In the System Variables window find and highlight "PATH" and click edit. Add the paths. The two paths I added were ;c:\Python25 and ;c:\Python25\Tools\Scripts. Please note that each path starts with a semi-colon ";" Be sure your typing is correct and click "OK" Keep clicking "OK" until you're out of the System Properties window.
4. Now you can go to the command prompt and run kindlepid.py serialnumber to find out your Kindle PID.
5. You have to take that PID to your ebook seller and enter it in so that your MobiPocket DRMed books can be regenerated with the Kindle PID. Download those regenerated books and put into a folder you can easily find under the command prompt.
6. Go to the command prompt and navigate to the folder where you placed your regenerated MobiPocket books.
7. Then run kindlefix.py All the books I downloaded had .prc extension so the command I used was:
kindlefix.py MyBook.PRC MyKindlePID

I was able to convert all my MobiPocket ebooks from one of two ebook stores. *However*, 95% of the books did not show titles when loaded onto the Kindle. There's a fix for that MobiPerl thread (http://www.mobileread.com/forums/showthread.php?p=133359#post133359) Fortunately, you won't have to install Perl to get this to work assuming the Windows executables work in Vista. I was able to add back title and author to the file so that I could see them on the Kindle.

I'm no expert but I'm not afraid to try new (at least to me) things on the PC.

I don't know what, if any, differences there are to running all this in Vista but if there are, I hope you let us know.

HTH

I seem to have come to a full-stop.
I have come to No.6 and am having trouble with the Command Prompt.
1. Have Python 2.5.2
2. Downoaded Igor's scripts.
3. Have entered the PATH's
4. Got Kindle PID.
5. Entered PID with MobiPocket and downloaded two books(bought) and put in file BOOKS. Extensions are also .prc
6. This is where my woes begin. I am unable to navigate in Command Prompt.
(I am a budding idiot!)
7. How do I run kindlefix.py?
I have used the formula given:-
kindlefix.py BOOKS.PRC My kindlePID

I am using Win.XP SP2
I have been locked in mortal combat with this off-and-on for two weeks, as I felt like an idiot for not getting it right.
Any suggestions would be most welcome.
Many thanks

TallMomof2
07-17-2008, 08:51 PM
By navigate you need to use the cd command (change directory).

For example on my PC is goes something like this:

cd c:\documents and settings\XXXX\my documents\my ebooks

When I've entered this my command prompt changes to:

c:\documents and settings\XXXX\my documents\my ebooks>

What I do is keep a window open showing my ebooks that I want to massage. At the top of the window will be the path so I don't have to try and remember it or write it down on a sticky note that I invariably misplace when I need it. And since all the files are right there in the window I can easily type them into the kindlefix.py script.

HTH

nohmi2
07-18-2008, 12:07 AM
By navigate you need to use the cd command (change directory).

For example on my PC is goes something like this:

cd c:\documents and settings\XXXX\my documents\my ebooks

When I've entered this my command prompt changes to:

c:\documents and settings\XXXX\my documents\my ebooks>

What I do is keep a window open showing my ebooks that I want to massage. At the top of the window will be the path so I don't have to try and remember it or write it down on a sticky note that I invariably misplace when I need it. And since all the files are right there in the window I can easily type them into the kindlefix.py script.

HTH
Many thanks for such a quick response.
Command Prompt now tells me
Import Error: No module named .prc

I never even got that far before.

Leep
07-18-2008, 12:28 AM
you don't seem to have changed to the directory where your ebook is located. Like TallMom says, if you open the folder where your ebook is, and have it open as well as your command prompt window, this should help you put together the correct cd command. for example, because I keep my ebooks in a directory on my desktop called "ebooks to convert", my command is: cd desktop\ebooks to convert If you keep your ebooks in a directory call my ebooks, probably the command you need is: cd my documents\my ebooks

Then try your kindlefix command again - it looks to be in the right format

cheers

Just reread your posts. Is your folder called BOOKS on your desktop? If so then your first command line would be: cd desktop\BOOKS
Then run your kindlefix command

wallcraft
07-18-2008, 05:12 PM
Command Prompt now tells me
Import Error: No module named .prc This might be a failure to pick up prc.py (or prc.pyc) which should be in the same directory as kindlefix.py.

What I do is copy these files to the directory where I want to run kindlefix (copy kindlefix.py and prc.py to the ebook directory, or copy the ebooks to a dedicated kindlefix directory). This gets round issues with the PATH.

nohmi2
07-19-2008, 12:43 AM
It seems that it isn't my fate to do this right.
Now Command Prompt tells me that "kindlepid.py is not recognised" etc.
I have over one-hundred legally bought books from MobiPocket and my iPaq PDA isn't the easiest to read from. Would have left it at that, but Amazon own MobiPocket, so feel a bit ticked-off about that. Grrrr!!!