Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 04-28-2011, 11:37 AM   #1
SteveC100
Member
SteveC100 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2011
Device: kindle
Decompress Mobi Format

I hope this is a basic question, but I can't find the answer anywhere. All I want to do is take a non-DRM'd mobi file and decompress it. Then I'll make some changes in the css. When that's done, I want to recompress it back to mobi format. I'm using a Mac.

I can do this easily with epub files, but I can't see how to do it with mobi files.

I'm not eager to convert mobi to epub. I don't want to convert anything or rewrite any of the files. Just decompress, so I can edit. Then recompress.

Is there a way to do this?

Thanks to anyone who can help,
Steve
SteveC100 is offline   Reply With Quote
Old 04-28-2011, 12:00 PM   #2
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
https://dev.mobileread.com/trac/mobiperl
user_none is offline   Reply With Quote
Advert
Old 04-28-2011, 04:09 PM   #3
SteveC100
Member
SteveC100 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2011
Device: kindle
Thanks very much.

I'm working on a Mac. OSX 10.6.6

I downloaded it and tried running mobi2html. Terminal opens and tells me that it "Can't locate GD.pm"

I wish I were a little more savvy with Terminal, but this isn't for the faint of heart. Got any suggestions?

Thanks again,
Steve
SteveC100 is offline   Reply With Quote
Old 04-28-2011, 04:16 PM   #4
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
Try this MOBI decompiler tool for OSX.

G
GRiker is offline   Reply With Quote
Old 04-29-2011, 11:05 AM   #5
SteveC100
Member
SteveC100 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Apr 2011
Device: kindle
Got it. Thank you very much!

S
SteveC100 is offline   Reply With Quote
Advert
Old 05-07-2011, 10:49 AM   #6
illustrata
Enthusiast
illustrata began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Aug 2010
Location: Venice, Italy
Device: iphone, ipad, kindle
I'm attempting to do the same thing...just need to take a look at the .mobi files after Calibre .epub to .mobi conversion.

I downloaded both files from the links provided in the post link above, ran the script that asked me to select the python file, selected mobiunpack.py -- and that's where it ended.

Could I get a bit more insight as to how this program should work? It would be such a boon to be able to take a look at the exploded mobi files.

(I since installed python...still no success...)

Last edited by illustrata; 05-07-2011 at 01:52 PM.
illustrata is offline   Reply With Quote
Old 05-11-2011, 04:25 AM   #7
travger
Evangelist
travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.travger ought to be getting tired of karma fortunes by now.
 
travger's Avatar
 
Posts: 485
Karma: 270594
Join Date: Aug 2010
Device: palm tx, Windows7, Galaxy A5
I had the same wish. After digging around I downloaded and installed ActiveState's ActivePython 2.X - don't remember now what it is, just that I needed it.
There is a gui version (i.e no command line needed) called MobiUnpack.pyw, it 'opens up' mobi, but it worked only when I put mobiunpack.py and others into folder 'lib' next to pyw - just like in zip file.
travger is offline   Reply With Quote
Old 05-18-2011, 10:08 AM   #8
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 73,707
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
Quote:
Originally Posted by illustrata View Post
I'm attempting to do the same thing...just need to take a look at the .mobi files after Calibre .epub to .mobi conversion.

I downloaded both files from the links provided in the post link above, ran the script that asked me to select the python file, selected mobiunpack.py -- and that's where it ended.

Could I get a bit more insight as to how this program should work? It would be such a boon to be able to take a look at the exploded mobi files.

(I since installed python...still no success...)
Once you've told the Applescript where the unpack python script is to be found, just drag&drop mobipocket files onto the Applescript.
pdurrant is offline   Reply With Quote
Old 06-16-2011, 01:35 PM   #9
illustrata
Enthusiast
illustrata began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Aug 2010
Location: Venice, Italy
Device: iphone, ipad, kindle
It worked, it worked. Tra la la...

Thanks, pdurrant, and everyone.
illustrata is offline   Reply With Quote
Old 06-16-2011, 02:26 PM   #10
osnova
Kindler of the Flame
osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.osnova ought to be getting tired of karma fortunes by now.
 
osnova's Avatar
 
Posts: 582
Karma: 646016
Join Date: Oct 2009
Location: US of A
Device: K DX,3,KT,KP,KF, KFHD; Nook C, PRS600, iPad, Xoom, N900, N810, Zaurus
By the way, my understanding is that mobi is not just an archive or a package, it is a compiled file. All the "unpackers" are based on reverse engineering of the mobi format but do not create 1-to-1 correspondence to the original html source file that was used to create the mobi file. So, you may lose some data if you just unpack the mobi (e.g., dictionary tags will be lost, link anchors will be renamed). I may be wrong but I haven't seen yet tools that keep all these data.
osnova is offline   Reply With Quote
Old 06-16-2011, 02:41 PM   #11
illustrata
Enthusiast
illustrata began at the beginning.
 
Posts: 41
Karma: 10
Join Date: Aug 2010
Location: Venice, Italy
Device: iphone, ipad, kindle
I just wanted to see what was in there because the Kindle navigation isn't working and I would like it to. It's curious because there is no .ncx file (thus no navpoints), not an h tag to be found, and nothing but html height= and size= on the <p> tags to control spacing and size.
illustrata is offline   Reply With Quote
Old 06-16-2011, 04:03 PM   #12
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 73,707
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
Quote:
Originally Posted by osnova View Post
By the way, my understanding is that mobi is not just an archive or a package, it is a compiled file. All the "unpackers" are based on reverse engineering of the mobi format but do not create 1-to-1 correspondence to the original html source file that was used to create the mobi file. So, you may lose some data if you just unpack the mobi (e.g., dictionary tags will be lost, link anchors will be renamed). I may be wrong but I haven't seen yet tools that keep all these data.
For non-dictionary Mobipocket, it's pretty good. The HTML export is only tweaked enough to fix the links in the HTML and to add character set metadata. If yo look at the python code, there are some commented out bits if you really want to extract the exact raw text.

There are some problems with the metadata. Specifically, the code currently only handles one instance of each EXTH type, while there can be more than one, e.g. more than one author.

But yes, it's a compiled up file, not just a zipped up file like ePub. The current tools get you something that you can recompile with minimal metadata losses using Kindlegen.
pdurrant is offline   Reply With Quote
Old 06-16-2011, 04:04 PM   #13
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 73,707
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
Quote:
Originally Posted by illustrata View Post
I just wanted to see what was in there because the Kindle navigation isn't working and I would like it to. It's curious because there is no .ncx file (thus no navpoints), not an h tag to be found, and nothing but html height= and size= on the <p> tags to control spacing and size.
Mobipocket was designed to be used on early PDAs with limited processing power and metadata. There's no CSS and limited formatting of the HTML, which most closely resembles HTML 3.2, but with many modifications.
pdurrant is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mobi format on the Boox Purple Lady Onyx Boox 16 08-25-2010 07:30 PM
ePub to Mobi Format greeny Bookeen 10 02-24-2009 02:54 PM
Mobi format limitations wmaurer Workshop 15 01-09-2009 02:16 PM
new books in mobi format sassanik IMP 11 09-08-2008 09:40 AM
mobi format sassanik Sony Reader 7 09-04-2008 01:52 PM


All times are GMT -4. The time now is 07:13 AM.


MobileRead.com is a privately owned, operated and funded community.