mobi-rs

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

Usage

Print the whole book into stdout

rust use mobi::Mobi; fn main() { let m = Mobi::init("/home/wojtek/Downloads/lotr.mobi").unwrap(); println!("{}", m.book_content_raw().unwrap()); }

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: Lord of the Rings - Fellowship of the Ring Author: J. R. R. Tolkien Publisher: HarperCollins Publishers Ltd Description:

From Library Journal

New Line Cinema will be releasing "The Lord of the Rings" trilogy in three separate installments, and Houghton Mifflin Tolkien's U.S. publisher since the release of The Hobbit in 1938 will be re-releasing each volume of the trilogy separately and in a boxed set (ISBN 0-618-15397-7. $22; pap. ISBN 0-618-15396-9. $12).
Copyright 2001 Reed Business Information, Inc.

Review

'An extraordinary book. It deals with a stupendous theme. It leads us through a succession of strange and astonishing episodes, some of them magnificent, in a region where everything is invented, forest, moor, river, wilderness, town and the races which inhabit them.' The Observer 'Among the greatest works of imaginative fiction of the twentieth century.' Sunday Telegraph

ISBN: 9780261102316 Publish Date: 2010-12-21T00:00:00+00:00

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

HEADER Name: LordoftheRings-Fellowship Attributes: 0 Version: 0 Created: 2011-03-09 22:32:59 Modified: 2011-03-09 22:32:59 Backup: 0 Modnum: 0 Appinfoid: 0 Sortinfoid: 0 Type: BOOK Creator: MOBI Uniqueidseed: 292 Nextrecordlistid: 0

Numofrecords: 292

PALMDOC HEADER Compression: 2 Text length: 1151461 Record count: 282 Record size: 4096

Encryption type: 0

MOBI HEADER Identifier: 1297039945 HeaderLength: 232 Mobi type: Mobipocket Book Text encoding: UTF-8 Id: 3428045761 Gen version: v6 First non book index: 284 Name: Lord of the Rings - Fellowship of the Ring Name offset: 1360 Name length: 42 Language: ENGLISH Input language: 0 Output language: 0 Format version: 6 First image index: 287 First huff record: 0 Huff record count: 0 First data record: 0 Data record count: 0 Exth flags: 80 Has Exth header: true Has DRM: false DRM offset: 4294967295 DRM count: 0 DRM size: 0 DRM flags: 0 Last image record: 288 Fcis record: 290

Flis record: 289

EXTHEADER Identifier: 1163416648 Headerlength: 1109 Recordcount: 11 Records: { 203: "\u{0}\u{0}\u{0}\u{0}", 202: "\u{0}\u{0}\u{0}\u{1}", 101: "HarperCollins Publishers Ltd", 100: "J. R. R. Tolkien", 201: "\u{0}\u{0}\u{0}\u{0}", 106: "2010-12-21T00:00:00+00:00", 503: "Lord of the Rings - Fellowship of the Ring", 108: "calibre (0.7.31) [http://calibre-ebook.com]", 104: "9780261102316", 103: "

From Library Journal

New Line Cinema will be releasing \"The Lord of the Rings\" trilogy in three separate installments, and Houghton Mifflin Tolkien\'s U.S. publisher since the release of The Hobbit in 1938 will be re-releasing each volume of the trilogy separately and in a boxed set (ISBN 0-618-15397-7. $22; pap. ISBN 0-618-15396-9. $12).
Copyright 2001 Reed Business Information, Inc.

Review

\'An extraordinary book. It deals with a stupendous theme. It leads us through a succession of strange and astonishing episodes, some of them magnificent, in a region where everything is invented, forest, moor, river, wilderness, town and the races which inhabit them.\' The Observer \'Among the greatest works of imaginative fiction of the twentieth century.\' Sunday Telegraph

",

}

```

TODO:

kroo for inspiration and idea.