MobileRead Forums
Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Mobi

Welcome to the MobileRead Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community today, you will have fewer ads, access to post topics, communicate privately with other members, respond to polls, upload content and access many other special features.

If you have any problems with the registration process or your account login, please contact us.

Hint: Don't have time to visit us daily? Subscribe to our main RSS feed to receive our frontpage posts at your convenience.

Notices

Mobi Mobipocket Mobi is a widely-supported format; the Amazon Kindle format is based on it

Reply
 
Thread Tools Search this Thread Display Modes
Old 02-15-2008, 10:34 AM   #1
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five words
 
kovidgoyal's Avatar
 
Posts: 8,944
Karma: 37478
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
mobi2oeb

After an 8-hour hackathon I'm happy to announce mobi2oeb. Converts (non DRMed) .mobi/.prc files to an exploded OEBPS ebook. Supports all three levels of compression in .mobi files. Part of libprs500 v0.4.37. To use

Code:
mobi2oeb book.mobi
This is an initial release, so expect bugs. Thanks to darkninja for the HUFF/CDIC decompression code.
kovidgoyal is online now   Reply With Quote
Old 02-15-2008, 10:55 AM   #2
HarryT
eBook Enthusiast
HarryT can spell AND pronounce 'liseuse.'HarryT can spell AND pronounce 'liseuse.'HarryT can spell AND pronounce 'liseuse.'HarryT can spell AND pronounce 'liseuse.'HarryT can spell AND pronounce 'liseuse.'HarryT can spell AND pronounce 'liseuse.'HarryT can spell AND pronounce 'liseuse.'HarryT can spell AND pronounce 'liseuse.'HarryT can spell AND pronounce 'liseuse.'HarryT can spell AND pronounce 'liseuse.'HarryT can spell AND pronounce 'liseuse.'
 
HarryT's Avatar
 
Posts: 22,302
Karma: 39165
Join Date: Nov 2006
Location: UK
Device: Gen3, Opus, iRex DR1000S, iPod Touch, HTC Touch, PRS-600, Kindle 2
Great! Thanks, Kovid; this will make it very easy to edit a MobiPocket book. Use your tool to explode to OEB, make the edits, then use Mobi Creator to rebuild it.
__________________
Harry
HarryT is offline   Reply With Quote
Old 02-16-2008, 10:25 AM   #3
Ortep
Evangelist
Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.
 
Posts: 436
Karma: 468
Join Date: Sep 2007
Location: The Netherlands
Device: Cybook G3
Quote:
Originally Posted by kovidgoyal View Post
After an 8-hour hackathon I'm happy to announce mobi2oeb. Converts (non DRMed) .mobi/.prc files to an exploded OEBPS ebook. Supports all three levels of compression in .mobi files. Part of libprs500 v0.4.37.


Sounds great, But look what I got when I clicked on the link:

Code:
There is a problem with this website's security certificate. 
 
   
 The security certificate presented by this website was not issued by a trusted certificate authority.

Security certificate problems may indicate an attempt to fool you or intercept any data you send to the server.  
  We recommend that you close this webpage and do not continue to this website.  
  Click here to close this webpage.  
  Continue to this website (not recommended).  
     More information 


If you arrived at this page by clicking a link, check the website address in the address bar to be sure that it is the address you were expecting. 
When going to a website with an address such as https://example.com, try adding the 'www' to the address, https://www.example.com. 
If you choose to ignore this error and continue, do not enter private information into the website. 

For more information, see "Certificate Errors" in Internet Explorer Help.
Ortep is offline   Reply With Quote
Old 02-16-2008, 10:40 AM   #4
Nate the great
Sir Penguin of Edinburgh
Nate the great can load mercury with a pitchforkNate the great can load mercury with a pitchforkNate the great can load mercury with a pitchforkNate the great can load mercury with a pitchforkNate the great can load mercury with a pitchforkNate the great can load mercury with a pitchforkNate the great can load mercury with a pitchforkNate the great can load mercury with a pitchforkNate the great can load mercury with a pitchforkNate the great can load mercury with a pitchforkNate the great can load mercury with a pitchfork
 
Nate the great's Avatar
 
Posts: 7,287
Karma: 48386
Join Date: Apr 2007
Location: Northern Virginia
Device: Airpanel 100, Jornada 720, Kindle, Smart Q7, Zelda has Sony 600 & 700
That's because he doesn't have the money to pay for a security certificate. His site has alway been that way. I just checked again; his site is still there. I canvouch for him.
Nate the great is offline   Reply With Quote
Old 02-16-2008, 11:13 AM   #5
Ortep
Evangelist
Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.Ortep has a complete set of Star Wars action figures.
 
Posts: 436
Karma: 468
Join Date: Sep 2007
Location: The Netherlands
Device: Cybook G3
Ok, thanks

We can't be to carefull these days
Ortep is offline   Reply With Quote
Old 02-16-2008, 11:30 AM   #6
FixB
Groupie
FixB has a complete set of Star Wars action figures.FixB has a complete set of Star Wars action figures.FixB has a complete set of Star Wars action figures.FixB has a complete set of Star Wars action figures.FixB has a complete set of Star Wars action figures.
 
FixB's Avatar
 
Posts: 180
Karma: 499
Join Date: Oct 2007
Location: France, Toulouse
Device: Sony PRS500
Thanks kovidgoyal !
Once again, your work helps us all so much !!
FixB is offline   Reply With Quote
Old 02-17-2008, 02:02 AM   #7
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notes
 
nrapallo's Avatar
 
Posts: 2,386
Karma: 24558
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200, EBW1150 Device: REB1100, iLiad v2 System: WinXP SP3
Quote:
Originally Posted by kovidgoyal View Post
After an 8-hour hackathon I'm happy to announce mobi2oeb. Converts (non DRMed) .mobi/.prc files to an exploded OEBPS ebook. Supports all three levels of compression in .mobi files. Part of libprs500 v0.4.37. To use

Code:
mobi2oeb book.mobi
This is an initial release, so expect bugs. Thanks to darkninja for the HUFF/CDIC decompression code.
I used my 'mobi2imp' (version 5) to output 'SpaceEncyclopedia.mobi' into OEBFF (.oeb) output. I use:
Code:
mobi2imp --oeb 'SpaceEncyclopedia.mobi' Space
Can you check it against the output of mobi2oeb? Can you load my .oeb in mobicreator or use it with libprs500 utils?

Our (ebook format) worlds are crossing...

-Nick
Attached Files
File Type: zip Mobipocket - Space Encyclopedia-oeb.zip (689.4 KB, 297 views)
nrapallo is offline   Reply With Quote
Old 02-17-2008, 12:03 PM   #8
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five words
 
kovidgoyal's Avatar
 
Posts: 8,944
Karma: 37478
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
There are really only a handful of things to do in mobi->oeb conversion so I see no reason why your OEB output should be wrong. THey are
1) Read metadata from the EXTH header to create the .opf file
2) Decompress the text using the three possible compression chemes
3) Replace the filepos attributes
4) Replace the mobi specific tags like <mbpagebreak>
5) Extract the images and replace the <img recindex> tags

At the moment, the only not fullly implemented step is 4). The only mobi specific markup that mobi2oeb replaces is <mbpagebreak>
kovidgoyal is online now   Reply With Quote
Old 02-17-2008, 12:37 PM   #9
nrapallo
GuteBook/Mobi2IMP Creator
nrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notesnrapallo can name that song in three notes
 
nrapallo's Avatar
 
Posts: 2,386
Karma: 24558
Join Date: Dec 2007
Location: Toronto, Canada
Device: REB1200, EBW1150 Device: REB1100, iLiad v2 System: WinXP SP3
Quote:
Originally Posted by kovidgoyal View Post
There are really only a handful of things to do in mobi->oeb conversion so I see no reason why your OEB output should be wrong. THey are
1) Read metadata from the EXTH header to create the .opf file
2) Decompress the text using the three possible compression chemes
3) Replace the filepos attributes
4) Replace the mobi specific tags like <mbpagebreak>
5) Extract the images and replace the <img recindex> tags

At the moment, the only not fullly implemented step is 4). The only mobi specific markup that mobi2oeb replaces is <mbpagebreak>
Hey, this reads like psuedo-code and would be a great guide to 'rolling-your-own' program.

However, for me, this was all accomplished by using tompe's 'mobi2html' and making my .IMP specific changes to get 'mobi2imp'.

So, in the end, it appears we get the same result.

Cool!

-Nick
nrapallo is offline   Reply With Quote
Old 03-04-2008, 08:05 PM   #10
brecklundin
Wizard
brecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with others
 
brecklundin's Avatar
 
Posts: 1,050
Karma: 2802
Join Date: Jun 2007
Device: see sig...sigh...
kovid....kovid...kovid....awesome...thanks!!

here is the best I can offer in return:



She is yours...
brecklundin is offline   Reply With Quote
Old 03-04-2008, 08:24 PM   #11
kovidgoyal
Creator of calibre, Ph.D.
kovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five wordskovidgoyal can name that ebook in five words
 
kovidgoyal's Avatar
 
Posts: 8,944
Karma: 37478
Join Date: Oct 2006
Location: Albuquerque, NM
Device: PRS-500/505/700, K2, BeBook
I appreciate the gesture, but I have to say I like 'em with a leetle more meat on the bones
kovidgoyal is online now   Reply With Quote
Old 03-07-2008, 02:12 AM   #12
brecklundin
Wizard
brecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with othersbrecklundin plays well with others
 
brecklundin's Avatar
 
Posts: 1,050
Karma: 2802
Join Date: Jun 2007
Device: see sig...sigh...
your wish is our command oh great code breaker...

brecklundin is offline   Reply With Quote
Old 03-07-2008, 10:41 AM   #13
IceHand
Linux User
IceHand can extract oil from cheeseIceHand can extract oil from cheeseIceHand can extract oil from cheeseIceHand can extract oil from cheeseIceHand can extract oil from cheeseIceHand can extract oil from cheeseIceHand can extract oil from cheeseIceHand can extract oil from cheese
 
IceHand's Avatar
 
Posts: 304
Karma: 1082
Join Date: Aug 2007
Location: Germany
Device: Cybook Gen3
Nice work, thanks! One question though: is it normal that the exploded html file has only three lines? Line one is always "<html><head>" line two is "<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />" and line three is the rest. It's no problem to make some breaks with par, but the resulting html code is not very cleary arranged for manual editing.
IceHand is offline   Reply With Quote
Old 03-07-2008, 11:56 AM   #14
llasram
Reticulator of Tharn
llasram plays well with othersllasram plays well with othersllasram plays well with othersllasram plays well with othersllasram plays well with othersllasram plays well with othersllasram plays well with othersllasram plays well with othersllasram plays well with othersllasram plays well with othersllasram plays well with others
 
llasram's Avatar
 
Posts: 620
Karma: 2794
Join Date: Jan 2007
Location: EST
Device: Sony PRS-505
Quote:
Originally Posted by IceHand View Post
Nice work, thanks! One question though: is it normal that the exploded html file has only three lines? Line one is always "<html><head>" line two is "<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />" and line three is the rest. It's no problem to make some breaks with par, but the resulting html code is not very cleary arranged for manual editing.
All of the pre-.epub HTML-based e-book formats seems to do this – strip out all “unnecessary” whitespace to save space. ConvertLIT tries to fix this for LIT files by adding whitespace to the generated HTML, but it gets it wrong often enough to be troublesome. For adding whitespace and otherwise cleaning up grody HTML check out HTML Tidy.
llasram is offline   Reply With Quote
Old 03-07-2008, 12:33 PM   #15
IceHand
Linux User
IceHand can extract oil from cheeseIceHand can extract oil from cheeseIceHand can extract oil from cheeseIceHand can extract oil from cheeseIceHand can extract oil from cheeseIceHand can extract oil from cheeseIceHand can extract oil from cheeseIceHand can extract oil from cheese
 
IceHand's Avatar
 
Posts: 304
Karma: 1082
Join Date: Aug 2007
Location: Germany
Device: Cybook Gen3
Thanks for the tip, but I already knew of HTML Tidy and it won't generate a cleaned up version if the source file has errors – which includes most exploded Mobipocket html files.

Anyway, I had a closer look at the html code and it seems that running a search and replace for "> <" with ">\n<" does the trick. Maybe an idea for the next mobi2oeb version?
IceHand is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Forum Jump


All times are GMT -4. The time now is 12:44 AM.


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