11-12-2010, 08:01 AM | #1 |
Zealot
Posts: 115
Karma: 20
Join Date: Jul 2010
Device: Kindle3 3G, Kindle Paperwhite 2
|
Extract table of contents from mobi file
Hi,
are you aware of any way to extract a tabe of contents from a mobil file? I would need the following information: - chapter/section name - location of chapter/section Here is what I would love to do: I would like to process the "My Clippings" file for kindle and regroup the annotations to a book such that they are grouped under the chapters. Since I know the positions of the annotations I could group them according to chapters when I know the chapter positions and titles. I would be fine with any programming language (python, ...). Thanks, Jens P.S.: Of course it would be great if I could also extract the toc for DRMed kindle books. |
11-12-2010, 12:55 PM | #2 |
Wizard
Posts: 2,251
Karma: 3720310
Join Date: Jan 2009
Location: USA
Device: Kindle, iPad (not used much for reading)
|
TOCs don't work by referencing locations. They are HTML-based, and reference a tag on the chapter heading. If you run mobi2html (Perl program from MobiPerl), and look at the HTML output, there is usually just a chunk that is the list of hyperlinks forming the TOC.
|
Advert | |
|
11-12-2010, 04:01 PM | #3 | |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
Quote:
|
|
11-12-2010, 07:35 PM | #4 |
Zealot
Posts: 115
Karma: 20
Join Date: Jul 2010
Device: Kindle3 3G, Kindle Paperwhite 2
|
Thanks for the answer. But excuse my ignorance:
What is the opf file? Is that clear text xml? Thanks, Jens |
11-13-2010, 05:58 AM | #5 |
eBook Enthusiast
Posts: 85,544
Karma: 93383043
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
|
The OPF file is the file that contains all the "instructions" on how to make a Mobipocket book. It contains all the metadata, the list of files that make up the book, and what order they should be arranged in, the "Guide" section (which contains links to the cover image, the table of contents, and the point at which the book should be initially opened) and so on.
You can unpack a Mobi file to its OEB source (which will include the OPF file) using the "ebook-convert" tool that's a part of Calibre. |
Advert | |
|
11-13-2010, 10:43 AM | #6 |
Zealot
Posts: 115
Karma: 20
Join Date: Jul 2010
Device: Kindle3 3G, Kindle Paperwhite 2
|
That's cool. Thank you very much. So I could write a script to extract the toc and use that later on.
|
04-16-2012, 11:57 AM | #7 |
Junior Member
Posts: 3
Karma: 10
Join Date: Apr 2012
Device: HTC Evo Shift 4g
|
Originality
'You can unpack a Mobi file to its OEB source...using the "ebook-convert" tool that's a part of Calibre.'
Hi, When I performed this on a .mobi file, the resulting styles.css file contained Calibre's styles. HTML files were laced with Calibre's styles. File names for images were altered from the original. Is there a way to unpack to the original files, bit for bit? Or, is all that original information left aside as the conversion software packs the file into a .mobi archive? Thanks! |
04-16-2012, 01:10 PM | #8 | |
Grand Sorcerer
Posts: 28,054
Karma: 199770456
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Mobi_unPack.py |
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Old Thread] Table of contents forced to end not start of .mobi | irishpolyglot | Conversion | 4 | 05-24-2011 09:33 PM |
Table of Contents RTF > MOBI | daxmon87 | Calibre | 12 | 10-09-2010 01:46 AM |
Table of Contents - html to Mobi problem | thames | Calibre | 3 | 06-02-2010 08:24 PM |
Pocketbbook 360: Table of Contents & file formats | mimosavj | PocketBook | 6 | 04-08-2010 11:05 AM |
PRS-500 Can I add a table of contents to a given lrf file? | harpum | Sony Reader Dev Corner | 0 | 07-13-2007 09:36 PM |