Thread: Kobo locations
View Single Post
Old 02-22-2022, 08:00 AM   #1
olof-ynwa
Junior Member
olof-ynwa began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jan 2022
Device: Kindle Paperwhite 5
Kobo locations

Hello!, Kindle user here.
I'm currently working on a annotations parser that parses the kindle annotations and then pairs them into note-highlight pairs. (Everytime a note is created in your kindle a highlight is created at the same location and at the same time). The note is then parsed into list of commands that govern if the highlight should be changed (adding text with metadata to it, search and replace, basic formatting), and where it should be written (add to line/header in markdown file) etcetera. It works fine but I want to implement some extra functionality.

I want to be able to implement a command that allows the user to extract specific images, or tables from an unpacked version of the kindle file.
Whenever a image is highlighted in the kindle, the content of the saved highlight is just an empty string as such:

Note highlight pair example from MyClippings.txt:


Highlight:
Code:
==========
Nils Holgerssons underbara resa genom Sverige. 1 (Selma Lagerlöf)
- Your Highlight on page 29 | Location 431-432 | Added on Monday, January 31, 2022 12:28:12 PM
Associated note containing commands:
Code:
==========
Nils Holgerssons underbara resa genom Sverige. 1 (Selma Lagerlöf)
- Your Note on page 29 | Location 432 | Added on Monday, January 31, 2022 12:28:12 PM

x image
The x image command above says: this is an image, Extract it from the html of the unpacked version of this book by using information about the location (preferable) or page. Replace the actual highlight content with image content (markdown image embed in this case) and copy the image source file to markdown attachements folder.

I had issues implementing this with the kindle because of the mobi format. Even when unpacking the format, I can't find any pattern connecting the locations as specified in the kindle, with the unpacked version and the unpacked html. Perhaps its easier on the kobo?

The actual questions

Can you implement something like this on the kobo?
Would it possible to pair a highlight and a note? How does locations work on the kobo. Is it possible to know the corresponding "kobo location" of the html content in the epub in some way so that you can find the html of an annotation based on location?

Thank you in advance.
olof-ynwa is offline   Reply With Quote