First things first, thanks so much for the plugin! I'm having some trouble when using the calibredb CLI tool to add a KFX .azw book. calibre tries to read the metadata using its built-in support for .azw files, which obviously fails. If I ZIP up the files into a .kfx-zip beforehand and then add that from the CLI, all goes as intended. Here's my command and output:
Code:
> calibredb.exe add --duplicates "L:\Dropbox\Documents\My Kindle Content\B00KFEJN3Q_EBOK\B00KFEJN3Q_EBOK.azw"
Traceback (most recent call last):
File "site-packages\calibre\customize\ui.py", line 417, in get_file_type_metadata
File "site-packages\calibre\customize\builtins.py", line 284, in get_metadata
File "site-packages\calibre\ebooks\metadata\mobi.py", line 494, in get_metadata
File "site-packages\calibre\ebooks\mobi\reader\headers.py", line 284, in __init__
File "site-packages\calibre\ebooks\mobi\reader\headers.py", line 312, in identity
MobiError: Unknown book type: ???|?"
Gather KFX-ZIP File Type (from KFX Input) 1.3.0: Importing L:\Dropbox\Documents\My Kindle Content\B00KFEJN3Q_EBOK\B00KFEJN3Q_EBOK.azw
KFX Input: Gathered 4 files as <redacted>\calibre_temp\calibre_t6twf1\ll_ch9.kfx-zip
DeDRM v6.6.0: Trying to decrypt ll_ch9.kfx-zip
# <DeDRM stuff>
DeDRM v6.6.0: Finished after 0.3 seconds
Package KFX File Type (from KFX Input) 1.3.0: Packaging <redacted>\calibre_temp\calibre_t6twf1\lcksco.kfx-zip
Processing container: B00KFEJN3Q_EBOK.azw
Processing container: CR!1RM96FWSQH7ZZ8854T5S9EA6ZFHW.azw.md
Processing container: CR!EGDG5953SN2Y9474REC37D1B6EWZ.azw.res
kfxgen version: 7.66.1.0/PackageVersion:YJReaderSDK-1.5.195.0 Month-Day:04-20/668
Features: kfxgen.pidMapWithOffset-1, kfxgen.textBlock-1, reflow-style-1
Metadata: ASIN=B00KFEJN3Q, asset_id=CR!BBH3ZQB3XS1BH6WGPYR8GB3Y7F4P, author="Forsyth, Mark", author="Mark Forsyth", cde_content_type=EBOK, content_id=B00KFEJN3Q, cover_image=600x927, creator_version=2.15.0, description=..., file_creator=YJConversionTools, is_sample=False, issue_date=2013-11-07, language=en, override_kindle_font=False, publisher="Icon Books Ltd", reading_orders=1, selection=enabled, title="The Elements of Eloquence: How to Turn the Perfect English Phrase"
KFX Input: Imported as <redacted>\calibre_temp\calibre_t6twf1\avf5gn.kfx
Added book ids: 1
> calibredb.exe list --for-machine --fields all
[
{
"author_sort": "Unknown",
"authors": "Unknown",
"formats": [
"<redacted>/calibre_library/Unknown/B00KFEJN3Q EBOK (1)/B00KFEJN3Q EBOK - Unknown.kfx"
],
"id": 1,
"identifiers": {},
"isbn": "",
"languages": [],
"last_modified": "2018-05-16T18:50:52+00:00",
"pubdate": "0101-01-01T00:00:00+00:00",
"series_index": 1.0,
"size": 2187156,
"tags": [],
"timestamp": "2018-05-16T18:50:49+00:00",
"title": "B00KFEJN3Q EBOK",
"uuid": "d98de7ea-b34b-4e7f-9c4f-3ea650fe7ef9"
}
]
Any idea how I can force calibre to use your metadata reader plugin instead of its built-in one when importing from the command line? If I import the same .azw file via the calibre GUI, the metadata is read fine.