A library written in rust to extract data from .mobi
format ebooks It's purely for the sake of learning.
Writing a program like this: ```rust use mobi::Mobi;
fn main() {
let m = Mobi::init(Path::new("/home/wojtek/Downloads/lotr.mobi"));
println!(
"{:#?} {:#?} {:#?} {:#?}",
m.header, m.palmdoc, m.mobi, m.exth
);
}
Would yield such result:
Header {
name: "LordoftheRings-Fellowship\u{0}",
attributes: 0,
version: 0,
created: 1299709979,
modified: 1299709979,
backup: 0,
modnum: 0,
appinfoid: 0,
sortinfoid: 0,
type: "BOOK",
creator: "MOBI",
uniqueidseed: 292,
nextrecordlistid: 0,
numofrecords: 292,
} PalmDocHeader {
compression: 2,
textlength: 1151461,
recordcount: 282,
recordsize: 4096,
encryptiontype: 0,
} MobiHeader {
identifier: 232,
headerlength: 2,
mobitype: 65001,
textencoding: 3428045761,
id: 6,
genversion: 4294967295,
firstnonbookindex: 284,
name: "Lord of the Rings - Fellowship of the Ring",
nameoffset: 1360,
namelength: 42,
language: 2057,
inputlanguage: 0,
outputlanguage: 0,
formatversion: 6,
firstimageindex: 287,
firsthuffrecord: 0,
huffrecordcount: 0,
firstdatarecord: 0,
datarecordcount: 0,
exthflags: 80,
hasexthheader: true,
drmoffset: 4294967295,
drmcount: 0,
drmsize: 0,
drmflags: 0,
lastimagerecord: 288,
fcisrecord: 290,
flisrecord: 289,
} ExtHeader {
identifier: 1163416648,
headerlength: 1109,
record_count: 11,
records: [
(
36,
101,
"HarperCollins Publishers Ltd",
),
(
813,
103,
"
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.
\'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
", ), ( 24, 100, "J. R. R. Tolkien", ), ( 50, 503, "Lord of the Rings - Fellowship of the Ring", ), ( 33, 106, "2010-12-21T00:00:00+00:00", ), ( 51, 108, "calibre (0.7.31) [http://calibre-ebook.com]", ), ( 21, 104, "9780261102316", ), ( 33, 106, "2010-12-21T00:00:00+00:00", ), ( 12, 201, "\u{0}\u{0}\u{0}\u{0}", ), ( 12, 203, "\u{0}\u{0}\u{0}\u{0}", ), ( 12, 202, "\u{0}\u{0}\u{0}\u{1}", ), ], } ``` Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
kroo for inspiration and idea.