Thread: MobiDeDRM
View Single Post
Old 12-06-2008, 11:37 PM   #2
FizzyWater
You kids get off my lawn!
FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.
 
FizzyWater's Avatar
 
Posts: 4,220
Karma: 73492664
Join Date: Aug 2007
Location: Columbus, Ohio
Device: Oasis 2 and Libra H2O and half a dozen older models I can't let go of
cd is a DOS command to change the directory - aka "folder" - you're in. So trying to send the cd command with mobidedrm crashes becauses mobidedrm is a file (a python script, to be exact), not a folder.

I had followed the instructions in the thread "How to use Igorsk's script" , so python is in my "path" designator in Windows.

I'm also using both tompke's mobi executable files (I installed Perl, but haven't been able to get that to work yet! - the executables are saved in the "RunScripts" directory) and Kovid's Calibre (which I install and periodically update as he puts out new releases) to convert the deDRM'd file to various HTML files. (Eventually, I'll just choose one, but in the beginning I had different problems with each one, so I run all three automatically. If the file created by Kovid's Calibre mobi2oeb works, I delete the other two).

So when I'm running mobidedrm, I'm opening the Command prompt window and then doing the cd command with the folder my Mobipocket book is saved in. Then I make a folder with the book's name, move the file in it (and a copy of tompke's executable, because I'm still learning this command line stuff and couldn't figure out how to run it without it being in the same folder as the book!). I run the scripts, delete the duplicate of tompke's executable, and go on to the next book.

I'll copy the code below. I've got it saved as a text file with a .bat extension. I update the book information (using an Excel spreadsheet with formulas - I'm lazy!) for the number of books I want to convert, save and close the file, then doubleclick it from Windows Explorer to get it to start running.

Code:
@ECHO OFF
ECHO **********************************************************
ECHO ** Script to convert multiple Mobipocket files to HTML  **
ECHO **********************************************************

:: Change directory to the script folder

   j:
   CD \RunScripts


:: Create new folder for 1st book and move files into it
   ECHO.
   ECHO Creating folder for Book1 and moving files...
   ECHO.
   MD \RunScripts\Book1
   MOVE J:\RunScripts\Book1.prc J:\RunScripts\Book1
   COPY J:\RunScripts\mobi2html.exe J:\RunScripts\Book1
   CD Book1
:: Run fourth deDRM script [Format - Mobidedrm04 infile.mobi outfile.mobi PID (may replace MOBI with PRC)]
   ECHO.
   ECHO Running attempt to unlock file - make take a little while...
   ECHO.
   mobidedrm04 Book1.prc Book1_v4.prc 1aaa11aaaa
:: RunExploderScripts (mobi2oeb now converts <i> to <span class="italic">, so may want to remove it eventually)
   ECHO.
   ECHO Running conversion to html scripts on unlocked PRC file...
   ECHO.
   mobi2oeb Book1_v4.prc
   mobi2html Book1_v4.prc unpack4 --rawhtml > Book1_v4_raw.html
   mobihuff Book1_v4.prc Book1_v4_decompress.html
   DEL J:\RunScripts\Book1\mobi2html.exe
   CD ..

:: Create new folder for next book and move files into it
:: (repeat code above for Book2 want to convert, etc.)


:: End
   PAUSE
   EXIT

Last edited by FizzyWater; 12-06-2008 at 11:40 PM.
FizzyWater is offline   Reply With Quote