View Single Post
Old 02-22-2022, 10:43 AM   #3
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 7,097
Karma: 92190113
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Quote:
Originally Posted by olof-ynwa View Post
How does locations in kindle actually work?
A location is a reference an approximate location in a book. Each location represents 150 bytes of raw HTML in MOBI format. The other Kindle formats, such as KF8 (azw3) and KFX, contain a mapping table that shows where each location starts within their content. This is done so that that the same location number will refer to the same snippet of content regardless of the particular Kindle format in which the book was delivered.

(Side note: Kindle books created by calibre in AZW3 format lack the table needed to map location numbers to a corresponding MOBI.)

Quote:
Originally Posted by olof-ynwa View Post
Is it possible to find the html associated with some location.
Yes. The method for doing this varies by Kindle format. It is only a direct mapping to HTML in MOBI format.

Quote:
Originally Posted by olof-ynwa View Post
Does the unpacking of the book actually change the html?
KindleUnpack can unpack books in various ways. One of those provides the raw HTML which relates to locations.

Quote:
Originally Posted by olof-ynwa View Post
Is it possible to do this?
Yes, but there is another possible way to approach the problem. Besides the inexact "location" numbers Kindle books also use "position" numbers to refer to an exact point within the content of a book. Those are used to refer to content in the internal representation of notes and annotations.

Some MobileRead threads with more information on this are:

azw3r highlight and note extraction info
KRDS - A parser for Kindle reader data store files

(Added disclaimer: Obtaining the content corresponding to positions will not be possible for books in KFX format, the most common format for modern Kindles, due to unbreakable DRM.)

Last edited by jhowell; 02-22-2022 at 08:54 PM. Reason: typo
jhowell is offline   Reply With Quote