View Single Post
Old 03-11-2021, 10:54 AM   #9
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 xxyzz View Post
I'm using the following code to get acr:

Code:
book = YJ_Book(book_path)
book.get_metadata()
return book.get_asset_id()
That looks like that will work.

In the future I will include the asset_id as part of the YJ_Metadata object returned by get_metadata to avoid the need to call get_asset_id. I did not intend for get_asset_id to be used by external software.

Quote:
Originally Posted by xxyzz View Post
Do I need to call 'book.final_actions() to clear temp files?
It should not be necessary. I will look at the code and if it is needed I will do it inside of get_metadata.

Quote:
Originally Posted by xxyzz View Post
Why 'convert_to_single_kfx' calls 'decode_book' again?
Just in case it has not been called previously. decode_book will do nothing if it is called more than once.

Quote:
Originally Posted by xxyzz View Post
Should I just use the first and the last test location as srl and erl or get them from header or somewhere?
I don't know why the XRAY file contains those fields. You may need to experiment to find out what values will work.

Quote:
Originally Posted by xxyzz View Post
I'm using regex('>[^<>]+<') to find the text between tags for MOBI and AZW3 books, it there a better way(faster and skip tags like <style>) to get the book text and their locations?
A regex sounds like a good idea to me. Perhaps someone else will have another suggestion.

Quote:
Originally Posted by xxyzz View Post
I guess kfx doesn't have a header similar to Unique-ID?
That is correct. That field does not occur in KFX format.

Quote:
Originally Posted by xxyzz View Post
How do you know all these stuffs about Kindle?
Online research and looking at what code I can find.
jhowell is offline   Reply With Quote