View Full Version : mobi2lrf


kovidgoyal
02-15-2008, 09:29 AM
After an 8-hour hackathon I'm happy to announce mobi2lrf. Converts (non DRMed) .mobi/.prc files to LRF. Supports all three levels of compression in .mobi files. Also converts metadata. Part of libprs500 v0.4.37 (http://libprs500.kovidgoyal.net). It's integrated into the GUI as well as a commandline tool, so using it is just as easy as using the rest of libprs500.

This is an initial release, so it likely is crawling with bugs. Thanks to darkninja for the HUFF/CDIC decompression code.

igorsk
02-15-2008, 09:53 AM
Awesome!

AnemicOak
02-15-2008, 09:57 AM
This is great, thanks Kovid.

HarryT
02-15-2008, 10:14 AM
Jolly good show!

Minigal
02-15-2008, 03:41 PM
Thanks!

JSWolf
02-15-2008, 07:01 PM
I just took a look at the changelog. Very impressive!

kovidgoyal
02-15-2008, 08:21 PM
Thanks :)

Ervserver
02-15-2008, 10:20 PM
Good stuff, converted 2 books thus far. Didn't notice any bugs

lovebeta
02-18-2008, 07:19 PM
Thanks so much. It is a god send for us with both Kindle & PRS.

I tried with one of my mobi file and it seemed that the ToC identification/generation was not working.

JSWolf
02-18-2008, 07:23 PM
I'm going to grab a few mobi format eBooks from the library and try mobi2lrf to test it out.

kovidgoyal
02-18-2008, 08:23 PM
Yeah the mobi files probably use special markup for the TOC. If someone can send me a few samples I can fix that.

JSWolf
02-18-2008, 09:57 PM
I'll dig up a few Mobi files and send them your way tomorrow.

sindget41
02-23-2008, 12:42 PM
HI Kovid: I am so happy to see you getting around to MOBI PRC's... I tested the program this morning and found that it has problems with all my MOBI files (all non-DRM'ed from a single source in .NL)

Here's the error messages:

IndexError: string index out of range
Failed to perform job: Convert book:This_Means_War
Detailed traceback:
Traceback (most recent call last):
File "parallel.py", line 95, in run_job
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 166, in main
File "libprs500\ebooks\lrf\any\convert_from.pyo", line 143, in process_file
File "libprs500\ebooks\lrf\mobi\convert_from.pyo", line 40, in process_file
File "libprs500\ebooks\lrf\mobi\convert_from.pyo", line 29, in generate_html
File "libprs500\ebooks\mobi\reader.pyo", line 168, in extract_content
File "libprs500\ebooks\mobi\reader.pyo", line 213, in extract_text
File "libprs500\ebooks\mobi\huffcdic.pyo", line 123, in decompress
File "libprs500\ebooks\mobi\huffcdic.pyo", line 116, in sizeof_trailing_entries
File "libprs500\ebooks\mobi\huffcdic.pyo", line 104, in sizeof_trailing_entry
IndexError: string index out of range

I hope you can fix it -- as I have 3GB of MOBI files I would like to convert!
Thanks for ALL your efforts!

kovidgoyal
02-23-2008, 12:56 PM
Send me one of these files.

sindget41
02-24-2008, 02:08 PM
Kovid:

Thanks for the reply! Here's a random PRC file from this site in .NL that converts fanfic into PRC format for the palm. I have about 1200 of these files!
10847

-- Bob

kovidgoyal
02-24-2008, 02:41 PM
Will be fixed in the next release.

JSWolf
02-24-2008, 05:48 PM
html2mobi will not properly explode 408.prc. My guess it's highly compressed.

kovidgoyal
02-24-2008, 05:52 PM
The svn version of mobi2oeb in libprs500 works on it just fine.

JSWolf
02-24-2008, 05:59 PM
Look forward to the next version.

sindget41
02-25-2008, 10:40 AM
Thanks Kovid!!!

Between this program, and BD, my Sony Reader will handle almost all my needs!!

(Well, full size PDF's, and lack of index-jumps for reference materials -- but hey, can't have everything!)

timepasser
05-19-2008, 02:30 PM
Hello,

Maybe I am doing something wrong, but the LRF ebook resulting from the conversion of the mobi book doesn't have most (if not all) of the images in the original mobipocket ebook.

I am using calibre to do the conversion and then sony's connect to transfer the ebook to my prs 500. Am I doing something wrong or are the images not supported yet?

P.S. I used a free ebook by mobipocket website.
http://www.mobipocket.com/freebooks/download.aspx?id=17966

Best Regards

timepasser

kovidgoyal
05-19-2008, 03:14 PM
images are most definitely supported, there's probably something weird about that file, i'll take a look it.

timepasser
05-19-2008, 03:22 PM
Thank you for your quick reply.

I tried some stuff since my first post. If I use mobi2html and then html2lrf, the resulting lrf does contain the images.

kovidgoyal
05-19-2008, 03:36 PM
yeah there's a bug in the image extraction code of mobi2oeb, it's already been fixed. The fix will be in the next release of calibre.

jerryleejr
06-20-2008, 11:13 AM
Kovid,
Quick question for mobi conversions. I have converted .prc files just fine from mobipocket now will secure mobipocket convert as easily? Or can I expect to encounter a DRM stripping requirement? I know for the 505 .lit files are the preferred format for conversion but not all the books I am looking at are in MS Reader format.

wallcraft
06-20-2008, 11:54 AM
will secure mobipocket convert as easily? Use mobidedrm, see DarkReverser's WebLog (http://darkreverser.wordpress.com/2008/02/13/new-blog/) (look at its most recent comments).

kovidgoyal
06-20-2008, 12:01 PM
you have to strip DRM from secure mobi, calibre wont do it for you

ctrscencio
02-14-2010, 11:22 AM
How do I install it on my nexus one? My files are .prc and i cant read them.