mobi-rs

A library written in rust to extract data from .mobi format ebooks It's purely for the sake of learning. Crates.io

Usage

Access basic info

fn main() { let m = Mobi::init(Path::new("/home/wojtek/Downloads/lotr.mobi")); println!("{}", m) } `` Runningcargo run` would yield (different data based on the file ofcourse):

```

Title: The Fellowship of the Ring Author: J. R. R. Tolkien Publisher: Houghton Mifflin Description: SUMMARY: For over fifty years, J.R.R. Tolkien’s peerless fantasy has accumulated worldwide acclaim as the greatest adventure tale ever written.No other writer has created a world as distinct as Middle-earth, complete with its own geography, history, languages, and legends. And no one has created characters as endearing as Tolkien’s large-hearted, hairy-footed hobbits. Tolkien’s The Lord of the Rings continues to seize the imaginations of readers of all ages, and this new three-volume paperback edition is designed to appeal to the youngest of them.In ancient times the Rings of Power were crafted by the Elvensmiths, and Sauron, the Dark Lord, forged the One Ring, filling it with his own power so that he could rule all others. But the One Ring was taken from him, and though he sought it throughout Middle-earth, still it remained lost to him . . . ISBN: 9780618574940 Publish Date: 2005-07-15T07:00:00+00:00

Contributor: calibre (0.7.23) [http://calibre-ebook.com]

HEADER Name: TheFellowshipoftheRing Attributes: 0 Version: 0 Created: 1286664537 Modified: 1286664537 Backup: 0 Modnum: 0 Appinfoid: 0 Sortinfoid: 0 Type: BOOK Creator: MOBI Uniqueidseed: 326 Nextrecordlistid: 0

Numofrecords: 326

PALMDOC HEADER Compression: 2 Text length: 1213227 Record count: 297 Record size: 4096

Encryption type: 0

MOBI HEADER Identifier: 1297039945 HeaderLength: 232 Mobi type: 2 Text encoding: 65001 Id: 1826426250 Gen version: 6 First non book index: 299 Name: The Fellowship of the Ring Name offset: 1840 Name length: 26 Language: 9 Input language: 0 Output language: 0 Format version: 6 First image index: 299 First huff record: 0 Huff record count: 0 First data record: 0 Data record count: 0 Exth flags: 80 Has Exth header: true Drm offset: 4294967295 Drm count: 0 Drm size: 0 Drm flags: 0 Last image record: 322 Fcis record: 324

Flis record: 323

EXTHEADER Identifier: 1163416648 Headerlength: 1588 Recordcount: 29 Records: { 100: "J. R. R. Tolkien", 503: "The Fellowship of the Ring", 108: "calibre (0.7.23) [http://calibre-ebook.com]", 104: "9780618574940", 201: "\u{0}\u{0}\u{0}\u{c}", 101: "Houghton Mifflin", 202: "\u{0}\u{0}\u{0}\u{17}", 106: "2005-07-15T07:00:00+00:00", 103: "SUMMARY: For over fifty years, J.R.R. Tolkien’s peerless fantasy has accumulated worldwide acclaim as the greatest adventure tale ever written.No other writer has created a world as distinct as Middle-earth, complete with its own geography, history, languages, and legends. And no one has created characters as endearing as Tolkien’s large-hearted, hairy-footed hobbits. Tolkien’s The Lord of the Rings continues to seize the imaginations of readers of all ages, and this new three-volume paperback edition is designed to appeal to the youngest of them.In ancient times the Rings of Power were crafted by the Elvensmiths, and Sauron, the Dark Lord, forged the One Ring, filling it with his own power so that he could rule all others. But the One Ring was taken from him, and though he sought it throughout Middle-earth, still it remained lost to him . . .", 105: "Gandalf (Fictitious character)", 203: "\u{0}\u{0}\u{0}\u{0}",

}

```

TODO:

kroo for inspiration and idea.