View Full Version : Okay, seriously confused about MobiDeDrm


wallflower75
10-26-2008, 12:54 PM
Okay, while I love technology and new gadgets bring a tear to my eye, I'm sorry to say that when it comes to something like...oh, programming...I'm clueless. I have a book that I need to use MobiDeDrm on. I've tried and tried and TRIED to decipher the Idiot's Guide to using Python and all the other (I'm sure they really are to someone other than me) "helpful" guides to using this software. But not only do I not know what I'm doing, I don't even know if I've got the MobiDeDRM software! I downloaded a zip file with MobiDeDRM text files--but what the heck do I do with those? What's the point of those?

Is there any way I could get someone to take me through the process step-by-step (if you're allowed to, that is) so I can figure it out? Once I get it, I should be fine, but right now I've got a bunch of pieces that I can't quite figure out how to put together. Any help would be greatly appreciated!

:thanks:

Ireadfreely
10-26-2008, 02:20 PM
join the club. Im lost too. I got so frustrated last night, I slammed my keyboard.

wallcraft
10-26-2008, 02:41 PM
I downloaded ... text files--but what the heck do I do with those? In general, when you download source code from (say) pastebin.com it comes as a .txt file. You need to rename it to indicate its language. If it is a Python script, change .txt to .py. After it is renamed, if you have Python installed, Windows will recognize the file as a Python script and you can use it as a command name on the command line.

wallflower75
10-26-2008, 03:29 PM
Okay, I did that and it does recognize the file as a Python script, but when I click on the file to open it, a little black screen pops up, then disappears entirely. I know I'm doing this soooo wrong... :smack:

Ireadfreely
10-26-2008, 03:30 PM
I get this message.


File '<stdin> ", line 1 in "<module>"
nameerror: name "mobidedrm" is not defined.

the script I have is mobidedrm04.py which i placed in the scripts folder.

pilotbob
10-26-2008, 03:56 PM
Okay, I did that and it does recognize the file as a Python script, but when I click on the file to open it, a little black screen pops up, then disappears entirely. I know I'm doing this soooo wrong... :smack:

You can't just double click on the script.

You need to open a command window. Navigate to the dir where the script is on your hard drive. Then, type the name of the script and press enter. It should respond with a message about the copyright and version number. Can you get that far?

BOb

wallflower75
10-26-2008, 04:14 PM
You can't just double click on the script.

You need to open a command window. Navigate to the dir where the script is on your hard drive. Then, type the name of the script and press enter. It should respond with a message about the copyright and version number. Can you get that far?

BOb

Sadly, no. At the risk of sounding even dumber than I feel right now, the command window is the little black box that disappeared on me, isn't it? When I've opened it before, I've tried typing stuff into it and all I get are errors.

pthwaite
10-26-2008, 04:35 PM
I now how you feel, it has taken me a few weeks to work out where ad what to do on the MAC, but finally got it working last night.

I'm sorry if you already know this but, to run a "DOS box" which is what I think pilotbob is suggesting, go to your start button and find the "Run" command/icon/instruction, when it opens, type in either CMD and hit enter, or Command and hit enter. In your case I don't think it will mattter which you use.

At that point one of 2 things will happen.

Either your whole screen goes black with a little white line and C:> appears at the top left or you get a "Dos Box" with the same inside it. (If the screen goes all black it just means your "Dos" is set to run full screen.
Then, navigate to where your script is on your hard drive within the Dos box, by means of the DOS commands.

eg if your script is in a file called "Softwarehack" in your C drive it would be:

"cd softwarehack" & then enter (ignore all quotes)

to check, just type: "dir" & enter & it should display all the files in that folder.

Then try running your script

wallflower75
10-26-2008, 05:21 PM
Okay, the little black box popped up, but instead of just the C:> prompt, I get C:\DOCUME~1\WALLFLOWER~1> instead. I typed in python25 and got a version number and copyright message. But when I typed in the name of the script, all I got was

Traceback <most recent call last>:
File "<stdin>", line 1, in <module>
Name error: name is not defined

Am I at least on the right track????

pilotbob
10-26-2008, 05:24 PM
Okay, the little black box popped up, but instead of just the C:> prompt, I get C:\DOCUME~1\WALLFLOWER~1> instead. I typed in python25 and got a version number and copyright message. But when I typed in the name of the script, all I got was

Traceback <most recent call last>:
File "<stdin>", line 1, in <module>
Name error: name is not defined

Am I at least on the right track????

Yep. That is the C: prompt. It is set up to show you the path of your current folder too. If you type dir do you see the .py file in the list? If so, what are you typing at the command line to get the above error?

BOb

wallflower75
10-26-2008, 05:29 PM
Yep. That is the C: prompt. It is set up to show you the path of your current folder too. If you type dir do you see the .py file in the list? If so, what are you typing at the command line to get the above error?

BOb

The.py file doesn't show up when I type dir.

And I get the error when I type the name of the file (f2a681132). I've tried typing in the name of the program and got the same message.

Dave Berk
10-26-2008, 05:34 PM
Copy both the script and the ebook you want to open into your My Document folder. Then repeat the steps you did before to get to the black screen. Once you do all type the following into the black screen: mobidedrm04.py name-of-ebook your-PID
(Replace name-of-ebook with your ebook name and your-PID with the your PID number)

wallflower75
10-26-2008, 05:46 PM
Copy both the script and the ebook you want to open into your My Document folder. Then repeat the steps you did before to get to the black screen. Once you do all type the following into the black screen: mobidedrm04.py name-of-ebook your-PID
(Replace name-of-ebook with your ebook name and your-PID with the your PID number)

I get the following message:

mobidedrm04.py is not recognized as an internal or external command, operable program or batch file.

And back to the C prompt I go. Is there an icon for throwing your keyboard through the monitor??

Boston
10-26-2008, 05:50 PM
I get the following message:

mobidedrm04.py is not recognized as an internal or external command, operable program or batch file.

And back to the C prompt I go. Is there an icon for throwing your keyboard through the monitor??

Try locating the script (and document you are converting) within the python25 folder..and running it from there.

Dave Berk
10-26-2008, 05:51 PM
I get the following message:

mobidedrm04.py is not recognized as an internal or external command, operable program or batch file.

And back to the C prompt I go. Is there an icon for throwing your keyboard through the monitor??

Sorry. My fault. After opening the command prompt (black screen) type first: cd "My Documents" (with the quotes)
Then type this line: mobidedrm04.py name-of-ebook your-PID

wallflower75
10-26-2008, 05:55 PM
Sorry. My fault. After opening the command prompt (black screen) type first: cd "My Documents" (with the quotes)
Then type this line: mobidedrm04.py name-of-ebook your-PID

AARRGGHHH!!!

This is what I get when I type cd "My Documents":

Parameter format not correct - "My

And back to the prompt.

Dave Berk
10-26-2008, 06:08 PM
AARRGGHHH!!!

This is what I get when I type cd "My Documents":

Parameter format not correct - "My

And back to the prompt.

Let's got through this step by step by step.

1. Copy both the mobidedrm04.py and the ebook to your "My Document" folder.

2. Go into start->run-> type: cmd and press enter.

3. Inside the command prompt type: dir

4. Do you see the words "my documents" anywhere? if so, continue.

5. Type: cd my

6. Press the TAB key. See the sentence complete itself to cd "my documents" Then press enter. You should now be inside your my document folder.

7. Type: dir

8. Do you now see your mobidedrm04.py and your ebook? If so, continue.

9. Type: mobidedrm04.py name-of-ebook your-PID

Hope that works.

wallflower75
10-26-2008, 06:09 PM
Question. The Python program I downloaded came with something called PythonWin Editor. What is that--and would using it make this any easier???

Dave Berk
10-26-2008, 06:16 PM
Question. The Python program I downloaded came with something called PythonWin Editor. What is that--and would using it make this any easier???

Nope. I think that's for editing the source code not for running the completed script :)

cstross
10-26-2008, 06:26 PM
Wallflower75: I suspect your problem is that you need to work your way through a tutorial on using a command shell (http://www.cs.sjsu.edu/web_mater/cs46a/cs46alab/lab1/tutorial.html) to boss your computer around. (Hint: read the first intro which explains the difference between a graphical user interface and a command shell like the DOS command prompt, then skim ahead to section 20 -- reading stuff that's unfamiliar -- which is where the introduction to using the command line begins.

MobiDeDrm is a command line tool; you need to know where it is, how to invoke it by pathname (and if necessary by telling Python to run it), and how to tell it the name of a file to convert (and where it is). You're not going to get anywhere with it unless you acquire the basics of using a command line (be it the Windows command.exe one, or the Linux shell).

wallflower75
10-26-2008, 06:30 PM
Let's got through this step by step by step.

1. Copy both the mobidedrm04.py and the ebook to your "My Document" folder.

2. Go into start->run-> type: cmd and press enter.

3. Inside the command prompt type: dir

4. Do you see the words "my documents" anywhere? if so, continue.

5. Type: cd my

6. Press the TAB key. See the sentence complete itself to cd "my documents" Then press enter. You should now be inside your my document folder.

7. Type: dir

8. Do you now see your mobidedrm04.py and your ebook? If so, continue.

9. Type: mobidedrm04.py name-of-ebook your-PID

Hope that works.

I was doing great until the end. Everything came up the way you had it (I was typing "command" instead of "cmd" to start, which was a big part of the problem). But when I typed step 9 in (I have mobidedrm02.py, not mobidedrm04.py--wasn't sure where the latter could be found), all I got was a repeat of the MobiDeDrm prompt, as if I hadn't typed anything at all.

I can see the other side, I really can...I'm just not there yet.

JSWolf
10-26-2008, 07:17 PM
If all you have is MobiDeDRM.py 0.02, then you will find that this version will not work on all Mobipocket eBooks to remove the DRM. There is a bug in the code. There is code posted someplace on MR to fix that and convert it to 0.04. But you'll have to search for it.

Dave Berk
10-26-2008, 07:43 PM
But when I typed step 9 in (I have mobidedrm02.py, not mobidedrm04.py--wasn't sure where the latter could be found), all I got was a repeat of the MobiDeDrm prompt, as if I hadn't typed anything at all.

I can see the other side, I really can...I'm just not there yet.
Try running step 9 as: python mobidedrm02.py name-of-ebook your-PID

slayda
10-26-2008, 08:24 PM
Let's got through this step by step by step.

1. Copy both the mobidedrm04.py and the ebook to your "My Document" folder.

2. Go into start->run-> type: cmd and press enter.

3. Inside the command prompt type: dir

4. Do you see the words "my documents" anywhere? if so, continue.

5. Type: cd my

6. Press the TAB key. See the sentence complete itself to cd "my documents" Then press enter. You should now be inside your my document folder.

7. Type: dir

8. Do you now see your mobidedrm04.py and your ebook? If so, continue.

9. Type: mobidedrm04.py name-of-ebook your-PID

Hope that works.

Wallflower, these instructions above may lead you into trouble if you name the folder "My Documents" because you are essentially using DOS commands here and DOS will not recognize the "blank" in that name. Better to use a simple & short name like "MyDocs".

Also when the command tool window opens if you see something more than "C:>", you are starting in a sub-folder and need to go back to the root folder before using the "cd" command to reach your desired folder.

A basic knowledge of DOS is very useful here.

If you are not in the root folder you can type "cd \" to get there {Note that is a back slash "\" not a forward slash "/".
At that point you can type "cd mydocs" to get to the "mydocs" folder. (Note: these names are not case sensitive so "MyDocs" is the same as "mydocs".
Step two depends on the "MyDocs" folder being at the root level and not further down, i.e. "mydocs" can not be a subfloder in say "MyStuff". Also none of these names can have blanks in them.


An yes I know that Dos commands require "exact" syntax. You can not make any errors in the typing and get the correct results.

Hope this helps and isn't talking down to anyone.

Oh, and when you get done with the "command tool" window, it prefers that you type in "exit" instead of closint the window as you normally would.

pilotbob
10-26-2008, 09:17 PM
Try running step 9 as: python mobidedrm02.py name-of-ebook your-PID


Actually, that is the wrong command line.. you need to type:

mobidedrm02.py name-of-ebook.prc name=of-ebook_free.prc your-PID

You need to specify the output file name as the second parameter. As, if you installed python from python.org then you don't need to type the word python, however typeing it will not hurt anything.

BOb

wallflower75
10-26-2008, 10:39 PM
I got it!!! There were two things I was doing wrong: I didn't know to include the output file name and I didn't realize that the file name (which was a long string of numbers and letters) included two underscores instead of just one. Once I corrected those two things, the program worked just fine!

Thanks for all your help--and thanks for not losing patience with me! I owe you guys one! :thumbsup: :thanks:

And now that I've converted my Mobipocket book into an lrf file, I'll be off to do a little of this ====> :book2:

Ireadfreely
10-27-2008, 02:04 AM
I got the dark reverser txt etc.


However, it says my PID is wrong.

Error: no key found. Maybe the PID is incorrect

Skyblue
10-27-2008, 04:19 AM
If you are unsure of your pin, go to the place where you downloaded it, and it should be on that site. For example Fictionwise, just check out your bookshelf, and the pin is under the Secure Mobipocket ID. Otherwise you should be able to find it in Mobipocket Reader. Hope this helps.

pdurrant
10-27-2008, 05:00 AM
This sounds like you have an unserialised eBook. Some eBook stores let you download a book without any embedded PID. You have to open it in Mobipocket Reader, which will connect to Mobipocket and generate a new version of the eBook with the PID for your copy of Mobipocket Reader embedded in it.

So - open the book on Mobipocket Reader. Now find the new copy that has been created, presumably in some folder in the "My Documents" folder.

Now try with that eBook instead.


I got the dark reverser txt etc.


However, it says my PID is wrong.

Error: no key found. Maybe the PID is incorrect

koland
10-28-2008, 06:06 PM
The easiest way to use mobidedrm is to automate it with a couple of batch (command) files -- once you do this, you no longer have to use the command line to run the program at all (plus it will do all the files in a directory at once, moving them to a "WithDRM" and "NoDRM" directories (or the names of your choice) as it works. Not only is it easier to use for a power user, it's useable by anyone that can save a file to a specific location on their desktop and click a mouse (those two skills will probably be a minimum requirement that can't be worked around). I can post the batch files and setup, if anyone is interested (and there is some permanent place it will be easily found by those looking for it).

wallcraft
10-28-2008, 06:36 PM
I can post the batch files and setup, if anyone is interested (and there is some permanent place it will be easily found by those looking for it). As you say, it isn't hard to make mobidedrm and ereader2html easier to use, the problem is the DMCA in the US, and similar laws in other places, makes in unlawful to do so. Posting such software to a web site (any public web site) is definitely illegal in the US, and would open you up to potential prosecution if you ever touch down in the US (even if you are on a plane to somewhere else). I am obviously pointing out the worse case outcome here, but take legal advice before doing anything publicly with DRM stripping software. Note that in some cases using DRM stripping software is legal, but it is almost never legal to write or distribute such software.

koland
10-28-2008, 07:51 PM
Actually, posting a batch file that calls another batch file and the second one that calls a program would in no way violate the DMCA. No actual code that touches the mobi file is in the two batch files - it's basically an extension of the attempts here to help those who can't figure out the command line and using the FOR command, a couple of MOVEs and a REN to make "it" more automated. The "it" could be mobidedrm or mobi2mobi or any program of any kind - it just depends on what you put in the 2nd batch file (which has the same command as has been posted here over and over on how to call mobidedrm). Obtaining the python scripts would be something you must do on your own (and the legal considerations something for you to figure out).

My offer was only on (a) better directions to help those who can't figure out the command line, using only folders on their desktop and (b) a couple of batch files that can be modified to call whatever external program you want, processing every PRC file in a directory, while preserving both the original and a created copy (if that's what the program you call does).

hhardegen
10-31-2008, 09:40 PM
Hi

I'm fairly new to this forum having only had my Sony ebook Reader since July but I love it and am totally addicted. So far I've managed to find plenty of books to read that I can convert to lrf with calibre. However I really want to read two books that I couldn't get in lrf (as Sony online shop won't let me buy from there 'cos I'm in Australia) and so I've bought and downloaded them from Mobipocket with DRM. And now I really want to read them! :-)

I've read through lots of the past stuff about python and DRM and have got to the point where I have a batch file which runs but comes up with an error message : Error: no key found. Maybe the PID is incorrect

The PID I'm using is the one that Mobipocket gave me when I registered with them and it is one for my PC as I couldn't get my PRS505 to be seen by Mobipocket at the time. Is this the right PID to use or should I have a different one for each book?

Thanks for your help. It's a great forum.

Helen

pilotbob
10-31-2008, 09:47 PM
Thanks for your help. It's a great forum.

Helen

Are you using the PID that shows up in the Mobireader software? And, the software can read the book that you have downloaded? Every book will have the same PID.

BOb

hhardegen
10-31-2008, 09:54 PM
The PID I'm using is the one that I get when I log in to Mobipocket's website. They call it my device PID. It's 10 digits long.

I haven't been able to get the books to read on my PC using the Mobipocket Reader software but haven't really worried about that as I don't want to read them on my PC. I can see the two books listed there. Is there a way to check the PID there?

Thanks
Helen

pilotbob
10-31-2008, 10:02 PM
The PID I'm using is the one that I get when I log in to Mobipocket's website. They call it my device PID. It's 10 digits long.

I haven't been able to get the books to read on my PC using the Mobipocket Reader software but haven't really worried about that as I don't want to read them on my PC. I can see the two books listed there. Is there a way to check the PID there?

Thanks
Helen

YEs, on the left click on devices, then a pic of a PC should show... then click Edit Properties and it should show you the PID.

What command line are you using with the script?

BOb

hhardegen
10-31-2008, 10:06 PM
Yep, edit properties comes up with the same PID I'm using. My script line is :

MobiDeDRM.py bookname.prc bookname.txt MY-PID

The MobiDeDRM.py is a script file I downloaded that was previously a txt file but I renamed it.

Does that help?

Helen

JSWolf
10-31-2008, 10:19 PM
Yep, edit properties comes up with the same PID I'm using. My script line is :

MobiDeDRM.py bookname.prc bookname.txt MY-PID

The MobiDeDRM.py is a script file I downloaded that was previously a txt file but I renamed it.

Does that help?

Helen
When you try to open the book in Mobipocket Reader, does it ask you for a username & password?

hhardegen
10-31-2008, 10:32 PM
OK, I might be getting somewhere with help from PilotBob and JSWolf. I've been back to Mobipocket's website and downloaded a totally new copy of the book just in case messing around with the first one 'upset' it. With this new copy, I can read the book on my PC. Also, the python batch file runs and happily says it's decrypted successfully so that part seems to be working. I've tried putting the converted file through calibre but it comes up with a page of errors, starting with

"UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-6: ordinal not in range(128)"

The converted book file loads on my book reader but the text is in computer-gobbledegook. This problem probably belongs in a different forum section now and I probably need to do more research.

Thanks
Helen

JSWolf
10-31-2008, 10:50 PM
Do you have the latest version of Calibre? 0.4.100 is the current version. Another question is what version MobiDeDRM.py do you have? if you have 0.01, you'll need to find 0.02. If you have 0.02 you'll need to update it to 0.04. Thsin link to find the patches that you have to apply yourself to 0.02 are in http://www.mobileread.com/forums/showthread.php?p=222142#post222142. The error you have is possibly due to the wrong version of MobiDeDRM.py being used on that book.

RWJ
10-31-2008, 11:25 PM
Thanks - this is enough info for my better half to get it set up for me to use this.

I second the comment about how surreal it is to have to go to elaborate lengths to read the thing I just bought. Publishers need to make it a little bit easier for us to give them money in exchange for getting what we want - most books, if I can't buy them in a format I can read easily in an electronic version, I'll put on my queue at the public library.

And thank you especially to the people who offered and provided help!

RWJ
11-01-2008, 12:00 AM
As usual, I spoke too soon - I got it working on a book from FW without difficulty, only to try it on a book from CyberRead.com and get this:
Error: no key found. maybe the PID is incorrect

Everything was exactly the same as it was when I did it (successfully) with the FW book.

Any suggestions?

:help:

ETA: I found my error, with the help of search and MR. For the benefit of any others who might have the same problem, this is what helped:
Taylor514ce:
Here's the problem and the solution: human error, of course. When you download a Mobipocket PX book, you don't have to register the PID on the site. When you open the book in Mobipocket Reader for the first time, it prompts you to login to the site from which you purchased the book, to activate it. This creates a DRM'd copy of the book.

It's rather important to de-DRM THIS file, not the original file you downloaded.

Umm, duh.
And this is indeed exactly what worked. I tried to open it using the Mobipocket Reader on my laptop, it asked me to log in, and then I moved the copy of the file from "My eBooks" to the folder in which my mobidedrm.py lives, and all was well.

hhardegen
11-01-2008, 12:29 AM
I'm back now.

Have upgraded Calibre to latest 4.101 version
Have added the patch lines to the MobiDeDRM.py file to take the 0.02 one I was using to 0.04

The decrytion says it works in the cmd box

When I try to convert the supposedly decrypted file using Calibre, I get a long error message. Hope you don't mind me copying it all here but maybe it's important:

Job: **Convert book: LordoftheSilent(2)** **tuple**: ('UnicodeEncodeError', u"'ascii' codec can't encode characters in position 4-6: ordinal not in range(128)") **Traceback**: Traceback (most recent call last): File "parallel.py", line 928, in worker File "parallel.py", line 886, in work File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\any\c onvert_from.py", line 192, in main File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\any\c onvert_from.py", line 162, in process_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\txt\c onvert_from.py", line 96, in process_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\ convert_from.py", line 1918, in process_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\ convert_from.py", line 273, in __init__ File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\ convert_from.py", line 387, in add_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\ convert_from.py", line 330, in preprocess File "calibre\ebooks\BeautifulSoup.pyo", line 1432, in __init__ File "calibre\ebooks\BeautifulSoup.pyo", line 1055, in __init__ File "calibre\ebooks\BeautifulSoup.pyo", line 1094, in _feed File "calibre\ebooks\sgmllib.pyo", line 99, in feed File "calibre\ebooks\sgmllib.pyo", line 138, in goahead File "calibre\ebooks\sgmllib.pyo", line 315, in parse_endtag File "calibre\ebooks\sgmllib.pyo", line 353, in finish_endtag UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-6: ordinal not in range(128) **Log**: Converting text to HTML... MARKDOWN-CRITICAL: "We've got a problem header!" Processing u'index.html' Parsing HTML... ('UnicodeEncodeError', u"'ascii' codec can't encode characters in position 4-6: ordinal not in range(128)") Traceback (most recent call last): File "parallel.py", line 928, in worker File "parallel.py", line 886, in work File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\any\c onvert_from.py", line 192, in main File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\any\c onvert_from.py", line 162, in process_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\txt\c onvert_from.py", line 96, in process_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\ convert_from.py", line 1918, in process_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\ convert_from.py", line 273, in __init__ File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\ convert_from.py", line 387, in add_file File "C:\Program Files\calibre\library.zip\calibre\ebooks\lrf\html\ convert_from.py", line 330, in preprocess File "calibre\ebooks\BeautifulSoup.pyo", line 1432, in __init__ File "calibre\ebooks\BeautifulSoup.pyo", line 1055, in __init__ File "calibre\ebooks\BeautifulSoup.pyo", line 1094, in _feed File "calibre\ebooks\sgmllib.pyo", line 99, in feed File "calibre\ebooks\sgmllib.pyo", line 138, in goahead File "calibre\ebooks\sgmllib.pyo", line 315, in parse_endtag File "calibre\ebooks\sgmllib.pyo", line 353, in finish_endtag UnicodeEncodeError: 'ascii' codec can't encode characters in position 4-6: ordinal not in range(128)

I'm probably missing something obvious. Sorry.

Helen

wallcraft
11-01-2008, 12:47 AM
try it on a book from CyberRead.com and get this:
Error: no key found. maybe the PID is incorrect Some MOBI ebooks have no DRM and so don't need mobidedrm, but the more likely reason is that some Secure MOBIs are delivered with no active PIDs and Windows MobiPocket Reader "calls home" to get a new version with the PID included. So I suggest you first open the ebook with Windows MobiPocket Reader and then try mobidedrm using the PC's PID on the copy of the ebook in the MobiPocket directory (usually My Documents\My eBooks).

RWJ
11-01-2008, 12:49 AM
Thanks, wallcraft, you hit the nail on the head.

myral
11-01-2008, 04:52 PM
OK, I know this thread is about MobideDRM, but I'm having similar problems with the eReader2html tool, and you people seem to be very helpful and patient. I have read all threads about the eReader conversion, but was just more puzzled the more I read. I know nothing about programming or python and would be happy to continue in blissful ignorance if only there was a way for me to read my legally purchased secure eReader books on my new CyBook, which only supports mobipocket format. (previous reader crashed, so no hope there...)

I have downloaded a script by darkreverser, but it shows up as .txt even when I change the name to .py, so to tell you the truth, I'm not even sure that I have downloaded the right stuff.

Is anybody up to the herculean task of guiding me through the process step by step? (I really loved the "point your mouse and move the file" suggestion... sigh...)

pilotbob
11-01-2008, 04:58 PM
Is anybody up to the herculean task of guiding me through the process step by step? (I really loved the "point your mouse and move the file" suggestion... sigh...)

Pretty much everything written about mobidedrm applies to the ereader one. You have to install python, they you run the script. If you run it without passing any parameters it will tell you what it is expecting.

But, knowing exactally what you have done, command you are running, errors you are getting would make it easier to help.


BOb

wallcraft
11-01-2008, 05:15 PM
it shows up as .txt even when I change the name to .py The thread How to make Igor's script work (http://www.mobileread.com/forums/showthread.php?t=18310) contains detailed instructions on installing python. Once it is installed the file should be identified as a "Python File".

myral
11-01-2008, 05:43 PM
I have downloaded and installed the Python, which shows up as Python25, and then moved it into the My Documents folder. I downloaded the .txt files and put them into the Python\Tools\scripts folder. Then I copied them to the My Documents folder, as well as the e-book that I want to convert.
Having opened a command prompt (Start>All Programs>Accessories) I followed the procedure specified in this thread until I got into the My Documents Directory, where both the e-book, the Python25 and the script file (it appears as: f1fc790cb.py.txt) show up. Then I get this command line:
D:\Documents and Settings\XXXX\My Documents>
and I don't know how to continue.
I tried something like this:
D:\Documents and Settings\XXXX\My Documents>f1fc790cb.py.txt original_ebook.pdb . "My name" Credit_Card_Number
and a Notepad window opened up with the script that I had downloaded. Then a new command line appears, the same as the last one, no messages:
D:\Documents and Settings\XXXX\My Documents>

What to do now?
I don't really know what "run the script" means...
Thank you.

wallcraft
11-01-2008, 06:37 PM
and the script file (it appears as: f1fc790cb.py.txt) show up. This is the problem (or a problem), you need to remove the ".txt". In a standard window open on this directory click on the Tools icon and select Folder Options -> View and then uncheck "Hide extensions for known file types". Then right click on f1fc790cb.py.txt and select rename. You should see the full name (including the .txt), rename the file to ereader2html.py. There will be a pop up asking if you want to change the file type, answer yes.

pilotbob
11-01-2008, 07:32 PM
I have downloaded and installed the Python, which shows up as Python25, and then moved it into the My Documents folder.

Are you saying "it" being python? You shouldn't have moved python anywhere.

BOb

GatorDeb
11-01-2008, 11:20 PM
I have downloaded a script by darkreverser, but it shows up as .txt even when I change the name to .py, so to tell you the truth, I'm not even sure that I have downloaded the right stuff.

Change the extension via the command line and not Windows. You probably have a file named .py.txt.

petermillard
11-02-2008, 05:54 AM
Myral, looks like you're doing OK, just getting snagged on a couple of points.

This is what worked for me:-

OK, so you've downloaded and installed python into "Python25" folder - I'd leave it there; as pilotbob says, you don't need to move it anywhere. And you've downloaded the script - rename this, removing the ".txt" and replacing it with ".py" - this tells your operating system that it's a python script, and the icon will change accordingly; if it doesn't, there's something wrong. As others have said, according to your example, it looks like you've added '.py' into the filename, not replaced it.

So, you should now have a small file called (e.g.) "yourscriptname.py" on your computer. Copy this into your "Python25" folder, along with the ebook you want to convert - I find keeping it all in c:\python25 makes the filepaths easier to manage, especially if this command-line stuff is all new to you.

And you've managed to get a DOS window open and functioning; now you need to point it at the directory where your scripts and books are, using the command "CD" - stands for "Change Directory" - followed by a space, then the path to your directory. It isn't case-sensitive, but the spaces, colons and back-slashes are important. So if your scripts and books are in c:\python25, you type this:-

cd c:\python25

then hit return. Now you should have another line of text in the window like this

C:\Python25>

Directly after the ">" prompt, type "yourscriptnamel.py" (no quotes, no spaces) and hit return. You should get a few lines of text giving creator & copyright information, and "usage' which has five distinct parts, or parameters, each separated by a space. I've listed them line-by-line here for clarity:-

yourscriptname - you need to type this with the extension ".py" to make DOS find and run the script
infile.pdb - this is the name of the book you want to convert
outdir - this is the folder you want the converted book to be saved to
"your name" - this is your name written exactly as it was when you bought the book, contained in quotation marks; the quote marks are important, so don't miss them out!
credit_card_number - as the script says, it's enough to enter the last 8 digits of the credit-card used.

So in this example:-

C:\Python25>ereader2html.py blackmonday.pdb c:\python25 "James Bond" 00700700

Somebody called James Bond is converting the book blackmonday.pdb using the ereader2html.py script and saving the converted files back to the python25 folder using his highly improbaby credit-card number.

To run this script, you'd simply hit return after the last digit of the c/card number. The script will say that it's 'processing...' then 'Done' when it's finished.

As I say, it works for me - hope it helps you to make sense of it all!

Best, Pete.

Leep
11-02-2008, 02:19 PM
myral:
The above are great instructions, however I suggest that you put your script in the subdirectory Python25\tools\scripts rather than in the Python25 directory.

cheers

myral
11-02-2008, 02:39 PM
Thanks everybody for your suggestions. I haven't yet had the time to try them out, but will do so at some point. I'll be back to let you know how it went.

readnswim
11-20-2008, 04:18 AM
Thanks for all the help in these forums so far. I have a problem that I haven't been able to find anywhere else.
I think I have the mobidedrm script working alright in that I get an output file, but the output file is empty (0 KB) I have tried it with three different books and all the same result.

I have the mobidedrm.py file in with the scripts. The books are there as well. I am using the PID from the computer which is what Fictionwise is using. I created a batch file that goes like this:

mobidedrm.py nameofbook.prc nameofbook.mobi PID

As I said I get the output file, it just is empty.

..Later on I did find a post about this suggesting that it was due to using Python 2.4 or earlier. I am using Python 2.6 and still have the problem.

pilotbob
11-20-2008, 03:13 PM
mobidedrm.py nameofbook.prc nameofbook.mobi PID

As I said I get the output file, it just is empty.


I assume you are getting an error message when running this command. Can you paste the results of the above command into a message here?

BOb

readnswim
11-20-2008, 05:10 PM
I assume you are getting an error message when running this command. Can you paste the results of the above command into a message here?

BOb

I am getting the same invalid PID checksum error as those above (I was using a batch file and didn't see the command window). I am going to try all the other things. Thanks so far!

Finally!!!!! I used post #13 on the invalid PID forum and made sure all the books were already opened and I retrieved them from MyeBooks in the MyDocuments folder.

Love the posts! thank you!

papa4ahe
12-01-2008, 05:41 PM
Change the extension via the command line and not Windows. You probably have a file named .py.txt.

I have read and read about mobidedrm and when I do dir in dos from the python25 file, I do see ModiDeDRM.py 0.02 .txt. When I try to ren this to anything else, nothing seems to happen. For instance, ren to ModiDeDRM2.py or something like that. Can someone tell me what to do with the .py .txt situation so I can try to run mobidedrm? Thanks for your help.

pilotbob
12-01-2008, 05:55 PM
I have read and read about mobidedrm and when I do dir in dos from the python25 file, I do see ModiDeDRM.py 0.02 .txt. When I try to ren this to anything else, nothing seems to happen. For instance, ren to ModiDeDRM2.py or something like that. Can someone tell me what to do with the .py .txt situation so I can try to run mobidedrm? Thanks for your help.

How are you renaming it? Just right click on the file in Explorer and choose rename... type in mobidedrm.py and press enter.

BOb

papa4ahe
12-01-2008, 06:09 PM
How are you renaming it? Just right click on the file in Explorer and choose rename... type in mobidedrm.py and press enter.

BOb
I did that. Went to cmd python25 which contains the script and did dir*.py and nothing was found. Then did dir*.txt and there it was. Mobidedrm.py 0.02.txt
So I have tried to rename on the command line and in explorer. What next? Thanks for helping.
lar

daffy4u
12-01-2008, 06:11 PM
I did that. Went to cmd python25 which contains the script and did dir*.py and nothing was found. Then did dir*.txt and there it was. Mobidedrm.py 0.02.txt
So I have tried to rename on the command line and in explorer. What next? Thanks for helping.
lar

If this is the name of the file: "Mobidedrm.py 0.02.txt"

You need to rename it: "Mobidedrm02.py"

papa4ahe
12-01-2008, 06:22 PM
If this is the name of the file: "Mobidedrm.py 0.02.txt"

You need to rename it: "Mobidedrm02.py"

I renamed it as suggested and ran dir *.py and got "file not found". However, it no longer shows up as a .py .txt file. It just doesn't show up. Isn't this fun? Thanks so much for your help.

JSWolf
12-01-2008, 06:29 PM
I renamed it as suggested and ran dir *.py and got "file not found". However, it no longer shows up as a .py .txt file. It just doesn't show up. Isn't this fun? Thanks so much for your help.
If you are using explorer to rename it, then you will see it in your explorer window. If you use explorer to view that directory, you should also see it there.

daffy4u
12-01-2008, 06:30 PM
I renamed it as suggested and ran dir *.py and got "file not found". However, it no longer shows up as a .py .txt file. It just doesn't show up. Isn't this fun? Thanks so much for your help.

I suggest you download Python 2.6 (http://www.python.org/download/releases/2.6/).

pilotbob
12-01-2008, 06:33 PM
I did that. Went to cmd python25 which contains the script and did dir*.py and nothing was found. Then did dir*.txt and there it was. Mobidedrm.py 0.02.txt
So I have tried to rename on the command line and in explorer. What next? Thanks for helping.
lar

Apparently you didn't rename it properly. Do a rename in explorer again... right click on file, choose rename... then right arrow until the cursor is right after the "y" and then press the delete button until the " 0.02.txt" is deleted, then press enter.

You should now see it in explorer as "mobidedrm.py".

BOb

pilotbob
12-01-2008, 06:33 PM
I suggest you download Python 2.6 (http://www.python.org/download/releases/2.6/).

Won't affect renaming the file though.

daffy4u
12-01-2008, 06:35 PM
Won't affect renaming the file though.

No, but mobidedrm was included with the files when I downloaded it.

pilotbob
12-01-2008, 06:36 PM
No, but mobidedrm was included with the files when I downloaded it.

What? You are saying that the mobidedrm.py script is included in the python2.6 installer download?

daffy4u
12-01-2008, 06:38 PM
What? You are saying that the mobidedrm.py script is included in the python2.6 installer download?

I take that back. I don't know how I got a copy of it. I have python 26 installed in Vista and in XP. For some reason I have it on Vista but not XP and I don't know where I got it.

wallcraft
12-01-2008, 06:39 PM
Apparently you didn't rename it properly. I'm not sure if rename shows the filename extension if they are "hidden". If you select "Folder Options" in Windows Explorer, then "View", and clear the "Hide extensions for known file types" box you'll then definitely see the extensions.

papa4ahe
12-01-2008, 06:51 PM
Apparently you didn't rename it properly. Do a rename in explorer again... right click on file, choose rename... then right arrow until the cursor is right after the "y" and then press the delete button until the " 0.02.txt" is deleted, then press enter.

You should now see it in explorer as "mobidedrm.py".

BObIn Explorer, I now see mobidedrm02.py but if I try to run it the message is "not recognized as an internal or external command." So something is missing or I'm missing something.

daffy4u
12-01-2008, 07:00 PM
In Explorer, I now see mobidedrm02.py but if I try to run it the message is "not recognized as an internal or external command." So something is missing or I'm missing something.

Have you had a chance to read the Visual Kindle Guide (http://wiki.mobileread.com/wiki/Visual_Kindle_Guide)? It will teach you how to run python scripts. You should check out the beginning of KindlePID to learn how to put the python scripts in your path and KindleFIX as a mirror on what you're trying to do.

papa4ahe
12-01-2008, 07:23 PM
Have you had a chance to read the Visual Kindle Guide (http://wiki.mobileread.com/wiki/Visual_Kindle_Guide)? It will teach you how to run python scripts. You should check out the beginning of KindlePID to learn how to put the python scripts in your path and KindleFIX as a mirror on what you're trying to do.

I read all of that before and have just reread it again. I just don't see where I have done anything different. I downloaded python26 but that doesn't seem to make a difference. Still says not recognized as an internal or external command. One thing maybe: When I type mobidedrm on the command line, shouldn't I see something happen or do I actually have to have a book in place before anything at all happens. With clit, I got several messages before I ever tried a book. And it works just fine. Why should this be any different? Any more suggestions. Thanks again for all the help.

daffy4u
12-01-2008, 07:29 PM
I read all of that before and have just reread it again. I just don't see where I have done anything different. I downloaded python26 but that doesn't seem to make a difference. Still says not recognized as an internal or external command. One thing maybe: When I type mobidedrm on the command line, shouldn't I see something happen or do I actually have to have a book in place before anything at all happens. With clit, I got several messages before I ever tried a book. And it works just fine. Why should this be any different? Any more suggestions. Thanks again for all the help.

If you just entered the script name (including the ".py" part) at the command prompt and hit enter, you would get instructions on how to write the command.

papa4ahe
12-01-2008, 07:37 PM
If you just entered the script name (including the ".py" part) at the command prompt and hit enter, you would get instructions on how to write the command.

I did just that and still get not recognized as an internal or external commnd.
I have renamed in explorer and from command line from "MobiDeDrm.py 0.02.txt to MobiDeDRM02.py and it shows up that way in explorer but not in the directory when I so dir *.py. So I must be doing something wrong.

daffy4u
12-01-2008, 07:44 PM
I did just that and still get not recognized as an internal or external commnd.
I have renamed in explorer and from command line from "MobiDeDrm.py 0.02.txt to MobiDeDRM02.py and it shows up that way in explorer but not in the directory when I so dir *.py. So I must be doing something wrong.

Is it located in the Scripts folder? Is the Scripts folder in your path? Otherwise, maybe the script is bad.

Python25>Tools>Scripts

papa4ahe
12-01-2008, 08:02 PM
Is it located in the Scripts folder? Is the Scripts folder in your path? Otherwise, maybe the script is bad.

Python25>Tools>Scripts
Yes, its in the correct path. I will try to find another download of mobededrm and try it. Thanks for all the help.

DaleDe
12-01-2008, 09:06 PM
I did just that and still get not recognized as an internal or external commnd.
I have renamed in explorer and from command line from "MobiDeDrm.py 0.02.txt to MobiDeDRM02.py and it shows up that way in explorer but not in the directory when I so dir *.py. So I must be doing something wrong.

If you don't see it with dir *.py then you likely have something wrong. Try dir Mobi* and see what you get. If there are extra extensions then rename using the ren command on the command line to remove them.

Dale

papa4ahe
12-01-2008, 09:12 PM
Yes, its in the correct path. I will try to find another download of mobededrm and try it. Thanks for all the help.

Ok, so I tried a different script from another download. When I use dir *.py on the command line, it says file not found. But I do see it explorer in the Scrips file in the python26 path. I took the file "MobiDeDRM.py 0.02.txt and changed it to MobiDeDRM.py by eliminating all the other parts. Also, I have tried MobiDeDRM02.py without success. Not sure what to do now. Seems like I have checked and rechecked everything ten times. When I try to run it, it says not recognized as an internal or external file. Any ideas where to go from here. I did clit easily so I figured I could do this one. Oh my!!

DaleDe
12-01-2008, 09:18 PM
Ok, so I tried a different script from another download. When I use dir *.py on the command line, it says file not found. But I do see it explorer in the Scrips file in the python26 path. I took the file "MobiDeDRM.py 0.02.txt and changed it to MobiDeDRM.py by eliminating all the other parts. Also, I have tried MobiDeDRM02.py without success. Not sure what to do now. Seems like I have checked and rechecked everything ten times. When I try to run it, it says not recognized as an internal or external file. Any ideas where to go from here. I did clit easily so I figured I could do this one. Oh my!!

Well Clit.exe was an executable while a .py is not really a command but depends on the installation of python to work. What is supposed to happen is typing or clicking MobiDeDRM.py should cause python to start and execute the script for you. This depends on an association between python and the extension .py. This is like .doc will cause word to open.

The second solution is to try to get python working first. Go to your installation of Python and look for the .exe startup program and typing it in. Likely python.exe. Does this work? If so you could copy the mobidedrm.py script to the same folder and then type: python mobidedrm.py and see if this does anything. Report your findings.

Dale

daffy4u
12-01-2008, 09:20 PM
Ok, so I tried a different script from another download. When I use dir *.py on the command line, it says file not found. But I do see it explorer in the Scrips file in the python26 path. I took the file "MobiDeDRM.py 0.02.txt and changed it to MobiDeDRM.py by eliminating all the other parts. Also, I have tried MobiDeDRM02.py without success. Not sure what to do now. Seems like I have checked and rechecked everything ten times. When I try to run it, it says not recognized as an internal or external file. Any ideas where to go from here. I did clit easily so I figured I could do this one. Oh my!!

I'm still concerned that the Scripts folder not be in your path. Did you following one of these directions depending on your OS from the Visual Guide.

Vista (http://wiki.mobileread.com/wiki/KindlePID_Vista)

Step 4) Add the location of the Python directories to your PATH variable, This is important so that your system finds the Python scripts.

In Windows Vista, right-click on "My Computer", then select “Properties” from the menu.

From the "Tasks" menu on the left side, click on the “Advanced system settings" link. When the "System Properties" window opens, go the bottom and click on ‘Environmental Variables”

Step 5) In the System Variables window scroll down until you find and highlight "PATH". Click on "Edit".

Step 6) Add two paths, ;c:\Python26 and ;c:\Python26\Tools\Scripts. Please note that each path starts with a semi-colon ";" Be sure your typing is correct.

XP (http://wiki.mobileread.com/wiki/KindlePID_XP)

Step 4) Add the location of the Python directories to your PATH variable, This is important so that your system finds the Python scripts.

In Windows XP, right-click on "My Computer", then select "Properties" from the menu.

When the "System Properties" window opens click on the tab marked "Advanced"

Step 5) Go to the bottom and click on 'Environmental Variables"

Step 6) In the System Variables window scroll down until you find and highlight "PATH". Click on "Edit".

Step 7) Add two paths, ;c:\Python26 and ;c:\Python26\Tools\Scripts. Please note that each path starts with a semi-colon ";" Be sure your typing is correct.

wallcraft
12-01-2008, 09:31 PM
I think the actual filename is probably MobiDeDRM.py.txt and you have hidden known filename extensions, see my post #71. One way to check is to right click on the file and see what is in the "open with" tab. One of the options should be python and you may also see edit with phthonwin. If you view "details" in the file window (last icon) these should show up as "Python File".

papa4ahe
12-01-2008, 10:07 PM
I think the actual filename is probably MobiDeDRM.py.txt and you have hidden known filename extensions, see my post #71. One way to check is to right click on the file and see what is in the "open with" tab. One of the options should be python and you may also see edit with phthonwin. If you view "details" in the file window (last icon) these should show up as "Python File".

Wow, I think it works. Going to folders options and changing hidden file ext. made all the difference. Once I could see the txt ext and remove it, it worked. Not sure why it wouldn't work in explorer but so be it. Now to do a book. Once I dedrm the book, where will I find it on the computer. Will it be in the mobipocket reader file? Thanks again for all your help. You all make it possible for us non-coder types to function.

wallcraft
12-01-2008, 10:21 PM
Once I dedrm the book, where will I find it on the computer. Will it be in the mobipocket reader file? If you do something like: MobiDeDRM.py nameofbook.prc nameofbook.mobi PID The DRM-free .mobi version will be in the same directory as the .prc (i.e. the current directory). If the filenames have spaces in them, include the filenames in quotes.

pilotbob
12-01-2008, 10:39 PM
you have hidden known filename extensions

DOH! I didn't think of that.... because they first thing I do on any computer I setup/use I disable hide extensions. I think that is a dumb default.

BOb

bbusybookworm
12-01-2008, 11:21 PM
DOH! I didn't think of that.... because they first thing I do on any computer I setup/use I disable hide extensions. I think that is a dumb default.

BOb

I do the same thing on my personal machine, but can appreciate the reason for doing so.

If extensions are visible, it can often confuse people, not to mention the fact that it makes it very easy to change the extension (Which I often do) but which can mess up a novice user's computer quiet a bit.

DaleDe
12-02-2008, 12:25 PM
I do the same thing on my personal machine, but can appreciate the reason for doing so.

If extensions are visible, it can often confuse people, not to mention the fact that it makes it very easy to change the extension (Which I often do) but which can mess up a novice user's computer quiet a bit.

It also allows virus' to hide the fact that they are executable. There is no really good reason in my opinion to hide extension. If you change the extension there is a warning message. That should be enough. Dumbing down the user view only opens the user up to being taken advantage of.

Dale

bbusybookworm
12-02-2008, 12:59 PM
It also allows virus' to hide the fact that they are executable. There is no really good reason in my opinion to hide extension. If you change the extension there is a warning message. That should be enough. Dumbing down the user view only opens the user up to being taken advantage of.

Dale

True, But I have seen some users manage to mess up spectacularly with extension, file associations and hidden system files. That's usually ended up causing more problems the just leaving them hidden.

So its usually the lesser of the two evils. While its a risk, you have to balance the two and based on the user and how tech savy and active they are.

My price example are my elder female relatives (Mom, aunt, etc). As they only go online to read a few sites, and hardly ever download any files directly, and mainly get mails from close relatives , its easier to hide everything, and just ensure that AV is kept updated, and runs scans regularly, and have a way to remotely fix problems.

pilotbob
12-02-2008, 02:08 PM
My price example are my elder female relatives (Mom, aunt, etc). As they only go online to read a few sites, and hardly ever download any files directly, and mainly get mails from close relatives , its easier to hide everything, and just ensure that AV is kept updated, and runs scans regularly, and have a way to remotely fix problems.

:offtopic:

Frankly I have come to the conclusion that people that basically use a PC for Web/Mail are much better off with Mac/Linux than Windows. They are much safer and you can use a much less powerful (cheaper) PC and get better performance to boot.

BOb

bbusybookworm
12-02-2008, 03:34 PM
:offtopic:

Frankly I have come to the conclusion that people that basically use a PC for Web/Mail are much better off with Mac/Linux than Windows. They are much safer and you can use a much less powerful (cheaper) PC and get better performance to boot.

BOb

I tend to disagree with that. The problem with that approach is twofold.

First, Mac's generally tend to be more expensive, with basic PC laptops available for very low prices. While you may be able to get a eMac for a reasonable price, PC hardware is usually cheaper.

The second problem that pops up is when something goes wrong (and it will no matter what OS) ar they need to know how to do something, who will provide support.

I nor anyone in my immediate group of family or friends use OSX, so there is a lack of knowledge on how to use and fix any issues. This support structure problem is quiet commonplace, as outside the US, a very small percentage of users (about 5% I think) have Macs.

The problem is even wore with Linux, as getting support, especially for someone not very Tech literate. I'm pretty comfortable with Tech, but getting something done in Linux can be very convoluted at times, even with friendly builds like Ubuntu. While the pre loaded version on the eeepc looks interesting and easy to use, it still has its limitation.

With windows, despite its issues, you can be pretty sure that most anywhere in the world you can find someone to help you with it if needed. You can also find that it is much more easier to find software and utilities for it, with most new programs or services offering PC support first.

As such while I would personally like to get used to OSX, I would be very doubtful on switching a person to a Mac, without a support structure, be that of friends or family, or the Local Apple Genius bar.

daviddem
12-11-2008, 04:31 PM
Hi,

Having read this thread, I feel sorry for those among us who are not so computer literate. Has anybody thought of converting the Python scripts into .exe's and make a small GUI? A quick Googling session tells me it should be possible. I am not a Python expert, but I could try my hand at it, as my contribution to the community. Of course I would not post the files here or link to them...

Can a Python expert here tell me if there would be any major issue with this?

pilotbob
12-11-2008, 05:59 PM
Having read this thread, I feel sorry for those among us who are not so computer literate.

It is amazing to me how many people use a computer today are not computer literate. It is painful to watch some people use the PC. Computer literate to me is that you understand...

...what a folder/directory is.
...how to navigate in Explorer with the folders view open.
...how to navigate in the cmd window.
...what the PATH is.
...what the windows update shield means.
...how to customize/navigate their start menu so they don't just have 50 icons on the desk top.
...that you can delete an installer after you run it (rather than leaving it as an icon on your deskop.

Anyway... I see no reason why you could not make a Python UI for this. Other than the fact that creating DRM removing tools is a violation of the DMCA (in the US). The command line script is just the least common denominator and very easy to distribute since it is just plan text.

BOb

bbusybookworm
12-11-2008, 06:32 PM
I also have a question for our Python Maestros :)

While I'm currently using the script without difficulty, I was wondering about something which could speed up my process somewhat.

I currently have ereader2html.bat file in my scripts folder inside which I have the following sequence

" ereader2html.py NameofFile.pdb NameofFolder "MYName" 12345678 "

Now I was wondering whether it was possible to modify this command so that when I run it, it automaticly detects any files with a pdb extension in the same folder and runs the script on it and then saves it to a folder of the same name.

so if there was a file xyz.pdb in the same folder it would convert it and save it to a folder xyz in the same place.

thoughts?

daviddem
12-11-2008, 06:33 PM
OK, so I managed to create an exe file using py2exe (it actually creates the exe and puts all the needed dependencies (dll's, etc) in a folder, ready for distribution. It seems to work. I say seems, because I don't owe a DRMed file to try it, but the program runs and acts normally if I run it on a non DRMed file, or with bad PID, etc.

So now I could create a GUI with Visual Basic to handle the exe. Trouble is I don't have my VB here with me. Maybe I will look at doing the interface in Python/tk, but as I said, I have no knowledge of Python programming. I did some work in tk in the past though.

Will see.

koland
12-12-2008, 02:55 PM
Now I was wondering whether it was possible to modify this command so that when I run it, it automaticly detects any files with a pdb extension in the same folder and runs the script on it and then saves it to a folder of the same name.

so if there was a file xyz.pdb in the same folder it would convert it and save it to a folder xyz in the same place.

Not sure how easy it would be in python, but it is a trivial excercise to do this using a command/batch file. Just as it is to do the same the mobidedrm. You end up needing two batch files, one processes each file in the directory, the second accepts the variable needed to define the filename/directory and calls the python script.

DaleDe
12-12-2008, 03:54 PM
Not sure how easy it would be in python, but it is a trivial excercise to do this using a command/batch file. Just as it is to do the same the mobidedrm. You end up needing two batch files, one processes each file in the directory, the second accepts the variable needed to define the filename/directory and calls the python script.

Actually one batch should do it.

The command would appear like:

For %%i in (*.pdb) Do command parameters.

Where command is the python script and the parameters are the standard arguments for the script. Use %%i wherever you need the file name.

For help open a cmd window and type: help for

bbusybookworm
12-12-2008, 06:09 PM
Actually one batch should do it.

The command would appear like:

For %%i in (*.pdb) Do command parameters.

Where command is the python script and the parameters are the standard arguments for the script. Use %%i wherever you need the file name.

For help open a cmd window and type: help for

The following Syntex works to Pick up the file name

For %%i in (*.pdb) Do ereader2html.py %%i Foldername "My Name" 12345678

But How can I get it to get the folder name from the file name itself without gaining the pdb extension?

Just Dropping the %%i instead of the folder name is obviously not going to work.

For %%i in (*.pdb) Do ereader2html.py %%i %%i "My Name" 12345678

While adding an additional character to that i.e. %%i-1 does work, it still leaves the .pdb extension as part of the Foldername.

For %%i in (*.pdb) Do ereader2html.py %%i %%i-1 "My Name" 12345678

So when the file name is xyz.pdb, the output folder comes out as xyz.pdb-1


While it is a great improvement in terms of speed from my previous approach and I appreciate you help i this , I'll like to get rid of the pdb from the Folder name .

pilotbob
12-12-2008, 06:24 PM
But How can I get it to get the folder name from the file name itself without gaining the pdb extension?

%%~pi

From the for help:

In addition, substitution of FOR variable references has been enhanced.
You can now use the following optional syntax:

%~I - expands %I removing any surrounding quotes (")
%~fI - expands %I to a fully qualified path name
%~dI - expands %I to a drive letter only
%~pI - expands %I to a path only
%~nI - expands %I to a file name only
%~xI - expands %I to a file extension only
%~sI - expanded path contains short names only
%~aI - expands %I to file attributes of file
%~tI - expands %I to date/time of file
%~zI - expands %I to size of file
%~$PATH:I - searches the directories listed in the PATH
environment variable and expands %I to the
fully qualified name of the first one found.
If the environment variable name is not
defined or the file is not found by the
search, then this modifier expands to the
empty string



BOb

bbusybookworm
12-12-2008, 06:27 PM
Just an update that the Batch command really works well with MobiDeDRM, using the following syntex


For %%i in (*.prc) Do mobiddrm04.py %%i %%~ni-1.prc 5UMRXH2$UK

pause


This combined with a Mobi2HTML Batch script is really going to save me a lot of time, especially when I go on one of my Book buying Binges :)

MOdified it slightly to leave the original file there, so that there is less chance of confusion

JSWolf
12-12-2008, 06:49 PM
Just an update that the Batch command really works well with MobiDeDRM, using the following syntex

For %%i in (*.prc) Do mobiddrm04.py %%i %%i 5UMRXH2$UK

pause

This combined with a Mobi2HTML Batch script is really going to save me a lot of time, especially when I go on one of my Book buying Binges :)
I suggest switching to mobi2oeb instead of mobi2html. Mobi2oeb works when the Mobipocket eBook is in high compression. mobi2html will not work in those cases. And I have come across some highly compressed commercial eBooks.

bbusybookworm
12-12-2008, 07:01 PM
I suggest switching to mobi2oeb instead of mobi2html. Mobi2oeb works when the Mobipocket eBook is in high compression. mobi2html will not work in those cases. And I have come across some highly compressed commercial eBooks.

Hmm, your right about Mobi2Html not working with every file.
I currently have both Mobi2Html and MobiHuff scripts and swith when one doesn't work.

Where can I find the Mobo2Oeb script? In Calibre?

If so, is the syntex the same as for these others scripts ?

Thanks

bbusybookworm
12-12-2008, 07:04 PM
%%~pi

From the for help:

In addition, substitution of FOR variable references has been enhanced.
You can now use the following optional syntax:

BOb

Thanks, adding %%~ni removes the extension.

As I've never really used the FOR etc, I appreciate all and any help you and the others are providing :)

pilotbob
12-12-2008, 07:08 PM
Thanks, adding %%~ni removes the extension.

As I've never really used the FOR etc, I appreciate all and any help you and the others are providing :)

Sure... this thread is like deja vu... perhaps a Wiki entry is in order?

BOb

JSWolf
12-12-2008, 07:12 PM
Hmm, your right about Mobi2Html not working with every file.
I currently have both Mobi2Html and MobiHuff scripts and swith when one doesn't work.

Where can I find the Mobo2Oeb script? In Calibre?

If so, is the syntex the same as for these others scripts ?

Thanks
Mobi2oeb is not quite the same. If you are mass converting, then you'll end up with the images all in the same images directory if you do it all in the same directory. But you could modify your script to sort out the eBooks based on the title and create seperate directories and move each eBook and go to each directory and then run the command. Mobi2oeb works way better then mobihuff. And in some cases, better then mobi2html.

bbusybookworm
12-12-2008, 07:22 PM
Sure... this thread is like deja vu... perhaps a Wiki entry is in order?

BOb

Might be a good idea, as there are probably quiet a few members like me who actually learned how to do this just to strip DRM, and as such are not aware of how to change or modify things.

Also, being a bit lazy :) I don't like to spend ages converting books, especially when I've buy them by the dozen, so this was something I was keen to do for a while, but couldn't figure how to so asked here.

bbusybookworm
12-12-2008, 07:29 PM
Mobi2oeb is not quite the same. If you are mass converting, then you'll end up with the images all in the same images directory if you do it all in the same directory. But you could modify your script to sort out the eBooks based on the title and create seperate directories and move each eBook and go to each directory and then run the command. Mobi2oeb works way better then mobihuff. And in some cases, better then mobi2html.

So By default, Mobi2Oeb uncompress's all files to one folder?

Can you set which folder it uncompress's to, or does it only allow to the root folder.

If it does, could you use something similar to what you can do with Mobi2Html, where you can put an output folder, which in combination with the FOR command

For %%i in (*.prc) Do mobi2html.exe %%i %%~ni


Extracts all the files (images and all) in a ebook to a folder of the same name

JSWolf
12-12-2008, 07:35 PM
Usage: mobi2oeb [options] myebook.mobi

Whenever you pass arguments to mobi2oeb that have spaces in them, enclose the ar
guments in quotation marks.

Options:
--version show program's version number and exit

-h, --help show this help message and exit

-o OUTPUT_DIR, --output-dir=OUTPUT_DIR
Output directory. Defaults to current directory.

--verbose Useful for debugging.


Created by Kovid Goyal <kovid@kovidgoyal.net>
You can set what output directory you want to extract to.

ritibelle
12-16-2008, 01:38 PM
Sorry if I'm being dumb, but where do I find the mobi2oeb.py?
I've tried Calibre but as far as I can see it only converts to lrf and I wanted to convert my prc file to html.

wallcraft
12-16-2008, 02:07 PM
where do I find the mobi2oeb.py? This is a command-line utility that is included with Calibre. If you installed Calibre this command should already be in your "path" and so to use it just type mobi2oeb in any command window.

Justy
12-16-2008, 03:21 PM
Just an update that the Batch command really works well with MobiDeDRM, using the following syntex

For %%i in (*.prc) Do mobiddrm04.py %%i %%~ni-1.prc PID

pause


MOdified it slightly to leave the original file there, so that there is less chance of confusion
Thank you for posting this, it works a charm and has already saved me sooo much time with my bulk purchases and downloads. :D

bbusybookworm
12-16-2008, 05:06 PM
Thank you for posting this, it works a charm and has already saved me sooo much time with my bulk purchases and downloads. :D

Your Welcome, But the real thanks go to Pilotbob, DaleDe and JSwolf for having the patience for talking me through the modifications, and answering any queries.

I've used this script, slightly modified to create bat files for MobiDeDRM, eReader2html, mobi2html, mobihuff, etc so its really easy to do batches of files.

ritibelle
12-16-2008, 06:15 PM
just type mobi2oeb in any command window.

After discovering you were talking about dos, not python it was indeed not that difficult. :rolleyes:

Thanks for the heads up!

Justy
12-16-2008, 09:07 PM
Your Welcome, But the real thanks go to Pilotbob, DaleDe and JSwolf for having the patience for talking me through the modifications, and answering any queries.
My heartfelt Thanks go out to Pilotbob, DaleDe, and JSwolf!!! Chocolate of your choosing to all of you!

koland
12-19-2008, 11:11 AM
:offtopic:

Frankly I have come to the conclusion that people that basically use a PC for Web/Mail are much better off with Mac/Linux than Windows. They are much safer and you can use a much less powerful (cheaper) PC and get better performance to boot.


Every Mac I see advertised is roughly double the price of an equivalent PC - been that way since about the time the Mac was invented (maybe since about the IIc). And as badly as they handle Windows, the thought of them having to cope with linux is even more scary.

What they need are windows terminals that just play on the web (for real apps, they hook up to managed terminal servers, where hopefully someone that knows what they are doing does the installs and backups).

koland
12-19-2008, 11:22 AM
Actually one batch should do it.

The command would appear like:

For %%i in (*.pdb) Do command parameters.

Where command is the python script and the parameters are the standard arguments for the script. Use %%i wherever you need the file name.


Yes, but this leaves the original behind (perhaps to be converted again), while using a second batch file lets you add commands to move it out of the way (rather than depending on the user to remember to do so). For mobidedrm, this is even more essential, at least if you want both the original and the new file to have the same name - my 2nd batch file does the conversion, moves the original, renames the new file and then moves it to a different directory. One directory always has the originals, the other those ready to read and if the conversion directory is clean, there is nothing new to convert.

But, I do have a question -- if I have an epub, what is the best way to convert it to mobi?

wallcraft
12-19-2008, 11:28 AM
if I have an epub, what is the best way to convert it to mobi? To convert a DRM-free ePub to MOBI, import it to Windows MobiPocket Reader (MOBI will be in the standard MobiPocket ebook directory) or use the command line program mobigen from MobiPocket (WIndows or Linux).

pilotbob
12-19-2008, 01:19 PM
Every Mac I see advertised is roughly double the price of an equivalent PC - been that way since about the time the Mac was invented (maybe since about the IIc). And as badly as they handle Windows, the thought of them having to cope with linux is even more scary.

Ok... double is certainly an exaggeration. But, I said Mac/Linux meaning one or the other... not a Mac running Linux. You can buy a basic Dell desktop with Linux on it for less (about $120) than a Dell with Windows on it. But, if you want better support and usability (in my opinion) go with the Mac.

A Mac mini (1.83Ghz Core 2 Duo, 1GB Ram, 80Gb hard drive) is $600. Then you will need a monitor and keyboard mouse. A similar Dell Vostro is probably around $400 or so. Not quite 1/2. BUt then again "low end" machines isn't really Apples market.

Still, if you do get the Dell, get it with Ubuntu. I still contend your average Web Surfing eMailer will be much safer with Ubuntu that with Windows. Firefox is pretty much the same on both systems.

BOb

DaleDe
12-19-2008, 01:54 PM
Yes, but this leaves the original behind (perhaps to be converted again), while using a second batch file lets you add commands to move it out of the way (rather than depending on the user to remember to do so). For mobidedrm, this is even more essential, at least if you want both the original and the new file to have the same name - my 2nd batch file does the conversion, moves the original, renames the new file and then moves it to a different directory. One directory always has the originals, the other those ready to read and if the conversion directory is clean, there is nothing new to convert.

But, I do have a question -- if I have an epub, what is the best way to convert it to mobi?

You don't need a second batch file, just a second line in the one you start with, unless you need to do this independently of the first task.

To convert an ePUB to mobi download the latest version of the Windows Mobipocket Reader and then you can simply drag the epub file to the reader icon.

Dale

koland
12-19-2008, 03:46 PM
You don't need a second batch file, just a second line in the one you start with, unless you need to do this independently of the first task.

But the FOR command only works on the one command, not on a second command in the same batch file. So, for example, you can process a bunch of ereader files, naming the directories the same as the original file, but all of them will be called book.html, which means more work to change those names before converting to another format (such as using mobicreator). Sure, you could move all the originals out when done - but if you are downloading more while the batch file is running, they can be skipped; using two batch files both ensures this doesn't happen and lets you rename that book.html file that gets created (as well as do anything else you want to do).

If using mobidedrm, you must either name the new file with a variation of the original name use a combo of two directories in the one command (which can be a bit trickier to do, but it is possible. It is just easier to use two commands.

A side benefit of the two commands - you can call the "fix" command at the command line and watch what it does, which can help with debugging, and it runs all the steps for one book. A "fixall" command then only needs the for loop in it and you can then drop a shortcut on the desktop. Once set up, the end user need know nothing (the batch files could also copy the files to a reader (if plugged in or nteworked ) or send them via email, providing you have the write expertise and software to set this up, having them magically appear on a reader with just a single click, after downloading to the correct directory on the desktop.

To convert an ePUB to mobi download the latest version of the Windows Mobipocket Reader and then you can simply drag the epub file to the reader icon.

I'll give the reader another shot - the version I have claims to do that, but looks pretty bad when you do. Does it create a PRC or MOBI file or just copy the epub into it's directory (not that I could not look it up, I'm just being lazy)

wallcraft
12-19-2008, 03:56 PM
I'll give the reader another shot - the version I have claims to do that, but looks pretty bad when you do. Does it create a PRC or MOBI file or just copy the epub into it's directory It converts the ePUb to a MOBI in its standard directory. See the screenshots in Mobipocket announcements at IDPF conference (http://www.mobileread.com/forums/showpost.php?p=184931&postcount=15). Things that are missing include the cover page, SVG, and the table of contents. Only a subset of the CSS is honoured.

It is likely that Calibre's any2mobi will do a better job once it is ready to go, see Next format for calibre to generate? (http://www.mobileread.com/forums/showthread.php?t=34266)

pilotbob
12-19-2008, 04:57 PM
But the FOR command only works on the one command, not on a second command in the same batch file. So, for example, you can process a bunch of ereader files, naming the directories the same as the original file, but all of them will be called book.html, which means more work to change those names before converting to another format (such as using mobicreator).

You can have your for command call another batch file which does multiple commands. I don't think there is a way to have a block of commands in a for... but wouldn't be suprised if it were possible.

Also, I'm confused, why would they all be called book.html? Or you mean... <bookname>.html were book name is different for each book.

Tell us what you are trying to do and I'm sure I can help with the batch commands to do it in one pass.

BOb

koland
12-19-2008, 05:00 PM
...hings that are missing include the cover page, SVG, and the table of contents. Only a subset of the CSS is honoured.

It is likely that Calibre's any2mobi will do a better job once it is ready to go, see Next format for calibre to generate? (http://www.mobileread.com/forums/showthread.php?t=34266)

Thanks, sounds like I should stick with HTML format downloads for now and skip epubs, at least until either the conversion tools catch up or they add epub support to my reader (and support that works better than mobipocket's reader). Someday one-format shall rule, but until then I do have things to read.

koland
12-19-2008, 05:10 PM
You can have your for command call another batch file which does multiple commands. I don't think there is a way to have a block of commands in a for... but wouldn't be suprised if it were possible.

Also, I'm confused, why would they all be called book.html? Or you mean... <bookname>.html were book name is different for each book.

Tell us what you are trying to do and I'm sure I can help with the batch commands to do it in one pass.

Thanks Bob, but I'm not having any problems. I typed in the command in a command box for about a week before automating it all with command files.

I use two command files (the first is a FOR command that calls the second and passes in the name of the book, minus the extension). The second does the conversion (actually, I have two pairs of these - one for mobi, one for ereader). The ereader conversion creates html files (with images extracted) and you can name the directory, but the main html file is always called "book.html" (this is set in the script and apparently can't be passed in as a parameter). It isn't a big deal to do a rename of that in the batch file that does the actual conversion. Mobidedrm does allow you to specify the destination filename, but can't be exactly the same as the original, unless they are in different directories. Again, the batch file takes care of all that for me.

It's the people trying to have only one batch file that run into limitations - the FOR command can only do what is on that one command line, so what it calls must do all the other processing. No doubt I could just rewrite the python commands to do what I want, but there isn't any need when it's just as easy to maintain a tiny batch file (which is then easily changed anytime I want; editing 4 or 5 lines is much easier than messing with the python script, especially if you want to try to integrate version changes people come up with for it).

pilotbob
12-19-2008, 05:21 PM
Cool... sounds like you are on top of it.

Mobidedrm does allow you to specify the destination filename, but can't be exactly the same as the original, unless they are in different directories.

I'm pretty sure you can use the same input and output file name and your input file will be overwritten. (personally I never run it this way.)

BOb

theodoron
12-19-2008, 10:33 PM
All of you on these threads are grat. I was so frustrated with the MobiDeDRM. But, I finally got it after 3 dyas of coming home after work and trying to figure it out. Thanks for all of the input - even those I did not dialogue on the boards. I read the threads.:thanks:

nwatts88
12-20-2008, 12:53 PM
Hi all,

I carefully read through this thread to get my mobidedrm.py script working. After a few hours I finally got it and produced a DRM-free .mobi file. Unfortunately the process messed with all the chapter markers, and since importing the file into Stanza it's become unreadable. Random sentences act as chapter titles, the actual chapter titles have all been changed, all very messy. Has anyone heard of this before? And any ideas on how to either fix it up or do it again properly?

I used version 0.05 with Python 2.5 under Mac OS X 10.5.5 using this Terminal line:
python /books/mobidedrm.py /books/DRMfilled.prc /convert/DRMfree.mobi 'MyPID'

Hope I can work it out. I accidentally bought the book, thinking it'd work fine with my iPhone like the free tester did on the mobi website. But now I've come across this forum I've been really keen to try and get it all working.

edit: I just downloaded and installed ActiveState Python 2.6.1.1 and it made no difference.

Thanks for reading,
Nick

pdurrant
12-20-2008, 02:21 PM
This is most likely a Stanza conversion probelm. Check with a 'real' Mobipocket reader, like the Windows program .

Paul

Hi all,

I carefully read through this thread to get my mobidedrm.py script working. After a few hours I finally got it and produced a DRM-free .mobi file. Unfortunately the process messed with all the chapter markers, and since importing the file into Stanza it's become unreadable. Random sentences act as chapter titles, the actual chapter titles have all been changed, all very messy. Has anyone heard of this before? And any ideas on how to either fix it up or do it again properly?

I used version 0.05 with Python 2.5 under Mac OS X 10.5.5 using this Terminal line:
python /books/mobidedrm.py /books/DRMfilled.prc /convert/DRMfree.mobi 'MyPID'

Hope I can work it out. I accidentally bought the book, thinking it'd work fine with my iPhone like the free tester did on the mobi website. But now I've come across this forum I've been really keen to try and get it all working.

edit: I just downloaded and installed ActiveState Python 2.6.1.1 and it made no difference.

Thanks for reading,
Nick

nwatts88
12-21-2008, 03:23 AM
This is most likely a Stanza conversion probelm. Check with a 'real' Mobipocket reader, like the Windows program .

Paul
Thanks, it was. I changed the mobi file into an epub file using calibre and all of the formatting has returned in Stanza for iPhone (even if it didn't in Stanza desktop).

redcoatuk
12-24-2008, 05:09 PM
It took a few hours but I managed to get it done. here was the tricky process. I am using a 505, xp, light experience with scripts and programming.

Installed pyphon, three versions, 25, 26 and 30. Ended up using the activestate 26 (richarddooling) as I needed it exactly how a howto thread was laid out (internettablettalk). searched via googles and discovered pastebin. pdurrant on here supplies a version of the script. read darkreversers blog, excellent. scroll to the end to get the up to date stuff. so I got the python, got the script, moved them to my C drive and worked out the paths for command line edit. downloaded an ereader file .pdb and mobi file .prc for a few bucks and got to work. the mobi had me busy for hours. all i got was PID invalid. I read thread after thread about how to fix it, to use apostrophies or not, to miss bits off the PID. my errors were all in the command line syntax and argument.

Some have reported the need to open a book first with mobi prc files, if you do that, the standard windows file location for the opened book with its security file is C:\documents and settings\user\my documents\my ebooks

when using the windows python gui with mobidedrm.py for prc files the argument is: inputfile.prc outputfile.prc PID

when using the windows python gui with ereader.py for pdb files the argument line is: input file.pdb output file.pdb "firstname familyname" 8figurecreditcardnumber

The scripts work a treat and import direct into Calibre which will convert and export to the reader.

Somewhat longwinded but the ebooks you pay for and download are no longer hamstrung with the restrictive stuff.

Finally a big thanks to the script writers and patient experts that give advice. I found it all very helpful and an enjoyable challenge. Keep up the good work.

redcoat

SteveK
12-30-2008, 09:41 AM
I have a very basic question about Mobidedrm. I haven't downloaded it from anywhere because it seems to be available only from Torrent sites, and I'm not sure that my ISP allows Torrent files (or that I'd want to download one even if they did). Is there any way to obtain Mobidedrm without resorting to the Torrent sites?

My Palm TX reads Mobipocket files without a problem, but obviously I prefer using my PRS505. I may just take the easy way out and buy a Cybook or Bebook for Mobipocket books I purchase or borrrow from the library.

SteveK

wallcraft
12-30-2008, 11:28 AM
Is there any way to obtain Mobidedrm without resorting to the Torrent sites? The best place to start to look for copies of the MobiDeDRM python script is in the responses to DarkReverser's Weblog (http://darkreverser.wordpress.com/2008/02/13/new-blog/). Since 0.05 just came out, start with the most recent responses. The Dark Reverser originally posted the python script (source code) to pastebin.com, it gets deleted from there periodically but if you find it there the download is .txt which needs to be renamed .py.

nwatts88
01-02-2009, 02:26 AM
I have a very basic question about Mobidedrm. I haven't downloaded it from anywhere because it seems to be available only from Torrent sites, and I'm not sure that my ISP allows Torrent files (or that I'd want to download one even if they did). Is there any way to obtain Mobidedrm without resorting to the Torrent sites?

My Palm TX reads Mobipocket files without a problem, but obviously I prefer using my PRS505. I may just take the easy way out and buy a Cybook or Bebook for Mobipocket books I purchase or borrrow from the library.

SteveK

You don't want to download using torrents, a perfectly legal file sharing protocol, but do want to illegally strip DRM from your eBooks?

bathos
01-04-2009, 01:34 PM
Huge, huge, huge thanks to all the people who have posted info on how to get Mobidedrm to work. I followed through all of the steps and suggestions posted in this thread and have just converted my first drmed mobi book to use on my Sony 505.

You are all absolute stars!

To any one having problems, read through all of the posts in this thread again. I found it was the smallest thing that I was doing wrong <g>.

Sydney's Mom
01-05-2009, 10:25 PM
The suggestion to type mobidedrm4.py to get the script was what did it for me. I converted mobi to azw (having previously converted prc to mobi with mobi2mobi gui). Just tried it on the original prc file, and that worked as well. No fixing author or title. Mobile Read Forum Members ROCK!!

Debra

ccadi
04-29-2009, 03:41 PM
Yet another thank you to the contributors to this thread. Saved me probably untold hours frustration. :)

patricks
05-02-2009, 12:21 AM
I've read everything I can find on mobi DRM removal and I can't seem to figure it out. I've tried scripts 2 and 5 on windows and mac.

On the Windows Side I get the following errors:
mobiDeDRM005.py= line 22 print "Bad Key Length!"
SyntaxError: invalid syntax

mobiDeDRM002.py= line 19 print "Bad Key Length!"
SyntaxError: invalid syntax

And on the Mac Side (2&5 via applescript):
"Error: no key found. maybe the PID is incorrect"

I've used both the file I downloaded originally and the file the mobipocket reader generates in an "Unknown" folder in My Documents. The book displays normally inside the reader. Also, I've checked and re-checked the PID key.

If anyone can help I would really appreciate it

AlexBell
05-02-2009, 03:29 AM
We can't tell you on this forum; this is 'The Program which must not be named'.

I'm certainly not an expert, but if you like to send me a private message I'll describe what works for me.

Regards, Alex

AlexBell
05-02-2009, 03:31 AM
PS. I've just noticed that you use a Mac. I use Windows XP, so what works for me may not work for you.

Regards, Alex

wallcraft
05-02-2009, 10:05 AM
I've read everything I can find on mobi DRM removal and I can't seem to figure it out. When you get a syntax error from a script that is known to work, the most likely cause is the wrong version of Python. Most scripts still require version 2.6, not the very new Python 3.0.

The usual reason for a PID problem, e.g. with my (perfectly legal) pid_checksum (http://www.mobileread.com/forums/showthread.php?p=317502#post317502) script, is that the arguments may need to be in quotes (single quotes on the Mac).

Another possible reason is that the MOBI isn't protected by a PID. Open Desktop Mobipocket Reader in "eBook" view, right click on the ebook, and select properties -> summary. If it says "Content Encrypted" then the ebook has DRM but no PID, see content encryption (http://www.mobileread.com/forums/showpost.php?p=425158&postcount=32).

JSWolf
05-02-2009, 10:15 AM
When you get a syntax error from a script that is known to work, the most likely cause is the wrong version of Python. Most scripts still require version 2.6, not the very new Python 3.0.
Python 2.5.x. also works.

Also, get Python from http://www.python.org

patricks
05-02-2009, 10:38 AM
Working now, thanks very much for all the help. 2 days of trying on both the mac and windows side, reading, searching and banging my head against the table, and all I had to do was ask a question.
This is a great forum

lotusblossom
08-15-2009, 05:39 PM
The easiest way to use mobidedrm is to automate it with a couple of batch (command) files -- once you do this, you no longer have to use the command line to run the program at all (plus it will do all the files in a directory at once, moving them to a "WithDRM" and "NoDRM" directories (or the names of your choice) as it works. Not only is it easier to use for a power user, it's useable by anyone that can save a file to a specific location on their desktop and click a mouse (those two skills will probably be a minimum requirement that can't be worked around). I can post the batch files and setup, if anyone is interested (and there is some permanent place it will be easily found by those looking for it).

I certainly kmow this post is dated a long time after yours, but I have just began looking at dedrming books because my ebook (Bebook) will no longer support drmed mobibooks and I have lots of them.

If you are still offering an automated group of batch files, I would be eternally grateful to you if you would post the link.

Am I too late?

lotusblossom

texasnightowl
08-16-2009, 12:28 PM
Hi! I'm not Koland, but I use some various batch files in my own processing. I actually make sure that all my original files are named in a specific format and then I use batch to both dedrm and set the author and title metadata. However, if you just want to remove the drm, something like this should work. The following will take any mobi files with a PRC extension and strip the DRM and rename them. For example, a DRM'd book such as "Emma by Jane Austen.PRC" would become "Emma by Jane Austen_free.PRC".


for %%i in (*.prc) do "dedrm.py" "%%i" "%%~ni_free.prc" YOURPID


Just put this in a file called doit.bat or something. Have it in the same folder as the files you wish to free and make sure your dedrm.py file is in the same folder or in your system path.

If the files you want to dedrm are mobi instead of prc extensions, just change the command to reflect that. Or if you have both, just have duplicate the command in the file - 1 with prc and the other with mobi

lotusblossom
08-17-2009, 06:01 PM
Just put this in a file called doit.bat or something. Have it in the same folder as the files you wish to free and make sure your dedrm.py file is in the same folder or in your system path.

If the files you want to dedrm are mobi instead of prc extensions, just change the command to reflect that. Or if you have both, just have duplicate the command in the file - 1 with prc and the other with mobi

Thanks, Texasnightowl - this info looks like a real winner. (I apologize for all the typos in my post - A storm was brewing so I rushed).:eek:

lb

Boxdoc
08-17-2009, 06:11 PM
For those of us that are minimally DOS proficient, Thank you for this BAT file. You make my life easier with things like this.

gbermor
09-04-2009, 11:26 AM
This thread has been really helpful! Thanks to you all! I had a nice Mobipocket library on my PDA and now that I've upgraded to a reader I won't have to loose it!:thanks:

discusaigon
09-06-2009, 12:43 PM
Hi,

I used mobidedrm005 and it worked well to remove the DRM.

but it did hurt my file (this dictionnary (http://www.mobipocket.com/en/eBooks/eBookDetails.asp?BookID=127018))

on the original file I have :

nageoire n. f. * Organe membraneux, appareil propulseur des poissons, etc.

and on the freeDRM file I have :

nageoire n. f. * Organe membraneux, appareilDҷ@R*i+2/

any chance to remove the DRM without hurting my file ?

pdurrant
09-10-2009, 10:43 AM
How embarasing. It turns out that 0.05 still has a bug, one I fixed in January. I'd just forgotten that I'd done so.

The Dark Reverser's blog may be worth looking up.

Hi,

I used mobidedrm005 and it worked well to remove the DRM.

but it did hurt my file (this dictionnary (http://www.mobipocket.com/en/eBooks/eBookDetails.asp?BookID=127018))

on the original file I have :



and on the freeDRM file I have :



any chance to remove the DRM without hurting my file ?

MelC
09-10-2009, 09:08 PM
I had a similar problem to the last one. I figured out how to run the mobidedrm in Terminal on Mac OS but the first two books I have attempted to read have been corrupted with huge chunks missing. Is it my .py, my python or something else entirely? Considering how proud I was of figuring out how to do this in the first place I don't have much hope that I'll be able to figure out the problem.

Never mind. I tried the second version of the .py and it seems to be working...now the tragedy will be whether all the books I have already blithely converted will need to be redone. Did someone say something about batching? Care to pm me with an idiot's tutorial?

Mel

AnemicOak
09-10-2009, 09:16 PM
I had a similar problem to the last one. I figured out how to run the mobidedrm in Terminal on Mac OS but the first two books I have attempted to read have been corrupted with huge chunks missing. Is it my .py, my python or something else entirely? Considering how proud I was of figuring out how to do this in the first place I don't have much hope that I'll be able to figure out the problem.

Mel

Folks will want to know which version of the script and which version of Python.


I do my de-drming on the Windows install on my Mac so I don't know if it's possibly a Mac OS issue or not. I have Python 2.6 and mobidedrm v5 and they work great, but as I said haven't tried in Mac OS. I'm sure someone here has though.

ccowie
09-11-2009, 09:48 AM
I've been working my way through this discussion and I'm having very similar problems trying to do the same thing. I get a message saying "invalid file format"
I have a Sony 505 and unwittingly purchased a set of classic books from mobipocket before realizing they wouldn't be compatible. I just want to be able to read them.

delphidb96
09-11-2009, 02:58 PM
I've been working my way through this discussion and I'm having very similar problems trying to do the same thing. I get a message saying "invalid file format"
I have a Sony 505 and unwittingly purchased a set of classic books from mobipocket before realizing they wouldn't be compatible. I just want to be able to read them.

I wonder if you have a variant of mobiDeDRM which only recognizes the older .prc ebooks which may have the phrase 'text' instead of 'mobi' embedded in them. I believe there's a section in the newer versions of MobiDeDRM which allows for both versions of mobi ebooks. Might want to check.

Derek

HarryT
09-12-2009, 05:41 AM
I've been working my way through this discussion and I'm having very similar problems trying to do the same thing. I get a message saying "invalid file format"
I have a Sony 505 and unwittingly purchased a set of classic books from mobipocket before realizing they wouldn't be compatible. I just want to be able to read them.

You will almost undoubtedly find those same classics here at MR, free to download, in much nicer versions than those sold in the bookstores. Have you taken a look at our book download forums?

krischik
09-12-2009, 04:31 PM
I do my de-drming on the Windows install on my Mac so I don't know if it's possibly a Mac OS issue or not.

You know that Mac OS X comes with python pre-installed and Windows does not, do you?

AnemicOak
09-12-2009, 04:43 PM
You know that Mac OS X comes with python pre-installed and Windows does not, do you?

No, I guess I didn't but it makes little difference to me. I do almost all, 99%, of my ebook work in Windows since a lot of my tools (Book Designer, Mobi Creator, etc.) don't work in Mac OS.

krischik
09-12-2009, 04:58 PM
I do almost all, 99%, of my ebook work in Windows

I see - it's opposite for me - Calibre is all I need now that I stopped using Mobipocket.

Martin

PS: Perl and Ruby are also pre-installed on Mac OS ;)

FlorenceArt
09-14-2009, 02:27 PM
I used version 0.05 with Python 2.5 under Mac OS X 10.5.5 using this Terminal line:
python /books/mobidedrm.py /books/DRMfilled.prc /convert/DRMfree.mobi 'MyPID'


Thank you Nick and everyone who posted here :D Now I finally understand how to run the script, and.......... I was just about to ask a stupid question but I figured out what I was doing wrong just before I hit post and made a fool of myself :smack:

IT WORKS :thanks:

So now I'll start cleaning up all the drmed prc files I have, but I'm not sure I will buy any more. I may follow HarryT's advice (on another thread) and just start buying only non-drmed books. It looks like Amazon is slowly killing off the mobi format, so I'm reluctant to buy more PRCs, but I'm also not very keen to embark on another adventure with drmed epubs, it's just too much trouble to bother.

I may stick to non-infested books from now on, and buy the rest in p-book format, at least I can resell them when I'm through... but we'll see how long that resolve sticks :rolleyes:

Anyway, thanks again to everyone here, you guys rock :iloveyou:

discusaigon
09-14-2009, 05:00 PM
thanks again pdurrant.

One more question :

Does removing the DRM also remove any information from the original file such as PID ?

in other word, does the new unDRM file still has some information that could make someone identifie you as the initial buyer ?

wallcraft
09-14-2009, 05:08 PM
Does removing the DRM also remove any information from the original file such as PID ?

in other word, does the new unDRM file still has some information that could make someone identifie you as the initial buyer ? I don't think it has any individual purchaser information, but it does still include all the standard metadata that identifies it as an ebook that is only available with DRM. This includes which store you bought the ebook from.

nklein
03-02-2010, 08:44 PM
if anyone wants to help me now that would be great
I have a imac with parallels desktop on it so I can use which ever one u want to show me :)
I'm lost !!

KevinH
03-04-2010, 10:45 AM
if anyone wants to help me now that would be great
I have a imac with parallels desktop on it so I can use which ever one u want to show me :)
I'm lost !!

Your quest for help was answered in the previous thread in which you asked for help.

http://www.mobileread.com/forums/showpost.php?p=814459&postcount=361

angelad
03-11-2010, 12:55 PM
A behemoth thread back from the grave.