Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 06-19-2025, 08:52 AM   #1006
RustyHill
Enthusiast
RustyHill began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Feb 2023
Device: Kindle
Thank you - good advice. I'll do that.
RustyHill is offline   Reply With Quote
Old 06-19-2025, 09:14 AM   #1007
RustyHill
Enthusiast
RustyHill began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Feb 2023
Device: Kindle
Ah! Interesting..

[deleted stuff]

File "calibre\devices\mtp\driver.py", line 441, in prepare_addable_books
FileNotFoundError: [WinError 206] The filename or extension is too long: 'C:\\Users\\xxx\\AppData\\Local\\Temp\\calibre-ol17m72z\\3fvk151z_prepare_mtp\\o122AC\\Gobbelino London & a Menace of Mermaids_ Cats, snark, & dangerous waters - a complete funny, cozy urban fantasy series (Gobbelino London, PI Book 6)_B0C3YZN5SP.sdr'


So file name too long.. which it is.

[deleted]

Job: 3 Prepare files for transfer from device started
DeviceJob: 3 Prepare files for transfer from device done, calling callback
DeviceJob: 3 Prepare files for transfer from device callback returned
Job: 3 Prepare files for transfer from device finished
No details available.
Gather KFX-ZIP (from KFX Input) 2.25.0: Importing \\?\C:\Users\xxx\AppData\Local\Temp\calibre-ol17m72z\3fvk151z_prepare_mtp\o122AC\Gobbelino London & a Menace of Mermaids_ Cats, snark, & dangeroban fantasy series (Gobbelino London, PI Book 6)_B0C3YZN5SP.kfx
Gather KFX-ZIP (from KFX Input): Cannot locate some files needed for the book. KFX files must remain in their original folder structure for successful import.
Gather KFX-ZIP (from KFX Input): Gathered 1 file(s) as C:\Users\xxx\AppData\Local\Temp\calibre-ol17m72z\jayfq09y.kfx-zip
DeDRM v10.0.9: Trying to decrypt jayfq09y.kfx-zip
Decrypting KFX-ZIP ebook: jayfq09y
Found 9 keys to try after 0.8 seconds
DeDRM v10.0.9: Failed to decrypt with error: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher


So that all makes perfect sense. The file name is beyond the limits allowed, so can't be imported.

For normal files I'd shorten their names but I've no idea if this can be done in a 'live' Kindle...anyone got any clues please?

In the meanwhile, many thanks to JHowell and I'll try some experiments.
RustyHill is offline   Reply With Quote
Advert
Old 06-19-2025, 09:30 AM   #1008
RustyHill
Enthusiast
RustyHill began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Feb 2023
Device: Kindle
OK, so doing some careful copies and renames still fails.

[I]Gather KFX-ZIP (from KFX Input) 2.25.0: Importing C:\Users\xxx\AppData\Local\Temp\calibre-syc0y5z6\h1kroh3r_prepare_mtp\o12D19\Gobbelino London & a Menace of Mermaids_.kfx
Gather KFX-ZIP (from KFX Input): Gathered 1 file(s) as C:\Users\xxx\AppData\Local\Temp\calibre-syc0y5z6\qxrj7c43.kfx-zip
DeDRM v10.0.9: Trying to decrypt qxrj7c43.kfx-zip
Decrypting KFX-ZIP ebook: qxrj7c43
Found 9 keys to try after 0.7 seconds
DeDRM v10.0.9: Failed to decrypt with error: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher[/I]


I guess the DRM Voucher is still referencing the original name and not my shorted one. The voucher is correctly present but is encrypted and I guess references the original silly long file name and so doesn't match.

I think at this point I give up!
RustyHill is offline   Reply With Quote
Old 06-19-2025, 11:11 AM   #1009
RustyHill
Enthusiast
RustyHill began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Feb 2023
Device: Kindle
OK, I didn't give up....☺

I set up K4PC 2.4.0 (70904) (Last updated 09.06.2025) and registered it. It prompted me to update, which I declined and set to 'Not auto update'.

I then synced with Amazon and got my library. Hunted for the books with the long files names (see previous posts) and imported the books into Calibre. Interestingly, they had d/ld as azw files and imported OK. I could then convert to Epub OK.

So RESULT. [But probably not for very long...]

As an aside, one book still failed to convert, appearing as an azw but Calibre thinking it was a KFX-ZIP. Odd.

Job: 0 Convert book 1 of 1 (The Demon, the Hero, and the War for Widdershins: A Mal & Reg Novel of Widdershins) finished
Convert book 1 of 1 (The Demon, the Hero, and the War for Widdershins: A Mal & Reg Novel of Widdershins)

DeDRM v10.0.9: Trying to decrypt yyes0dqe.kfx-zip
Decrypting KFX-ZIP ebook: yyes0dqe
Found 9 keys to try after 0.8 seconds
Decrypting KFX DRM voucher: amzn1.drm-voucher.v1.e50accb8-e4c9-4536-baa0-d7dac7224b6e.voucher
Decryption failed, trying next fallback
Decryption failed, trying next fallback
Decryption failed, trying next fallback

[deleted]
Exception: Incorrect padding - Wrong key
DeDRM v10.0.9: Failed to decrypt with error: Failed to decrypt KFX DRM voucher with any key
Traceback (most recent call last):
File "calibre_plugins.dedrm.__init__", line 950, in KindleMobiDecrypt
File "C:\Users\xxx\AppData\Roaming\calibre\plugins\DeDR M.zip\k4mobidedrm.py", line 204, in GetDecryptedBook
File "C:\Users\xxx\AppData\Roaming\calibre\plugins\DeDR M.zip\kfxdedrm.py", line 68, in processBook
File "C:\Users\xxx\AppData\Roaming\calibre\plugins\DeDR M.zip\kfxdedrm.py", line 112, in decrypt_voucher
Exception: Failed to decrypt KFX DRM voucher with any key
DeDRM v10.0.9: Looking for new default Kindle Key after 0.9 seconds
searching for kinfoFiles in C:\Users\xxx\AppData\Local
No K4PC kindle.info/kinf/kinf2011 files have been found.
DeDRM v10.0.9: Ultimately failed to decrypt after 1.0 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools...master/FAQs.md
Running file type plugin DeDRM failed with traceback:


So this seems to be the lack of a key but I thought K4PC had a default key built in....

Last edited by RustyHill; 06-19-2025 at 11:14 AM.
RustyHill is offline   Reply With Quote
Old 06-19-2025, 01:43 PM   #1010
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,545
Karma: 145863177
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by RustyHill View Post
OK, so doing some careful copies and renames still fails.

[I]Gather KFX-ZIP (from KFX Input) 2.25.0: Importing C:\Users\xxx\AppData\Local\Temp\calibre-syc0y5z6\h1kroh3r_prepare_mtp\o12D19\Gobbelino London & a Menace of Mermaids_.kfx
Gather KFX-ZIP (from KFX Input): Gathered 1 file(s) as C:\Users\xxx\AppData\Local\Temp\calibre-syc0y5z6\qxrj7c43.kfx-zip
DeDRM v10.0.9: Trying to decrypt qxrj7c43.kfx-zip
Decrypting KFX-ZIP ebook: qxrj7c43
Found 9 keys to try after 0.7 seconds
DeDRM v10.0.9: Failed to decrypt with error: The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher[/I]


I guess the DRM Voucher is still referencing the original name and not my shorted one. The voucher is correctly present but is encrypted and I guess references the original silly long file name and so doesn't match.

I think at this point I give up!
You cannot rename the .kfx file. It needs to have the original file name in order for all the bits to be able to be combined into one file.
JSWolf is offline   Reply With Quote
Advert
Old 06-19-2025, 03:36 PM   #1011
RustyHill
Enthusiast
RustyHill began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Feb 2023
Device: Kindle
Thanks - that's what I assumed. So any ideas how to decrypt books with absurdly long fine names? ☺

In this case I fired up an old K4PC instance which worked but that might not be possible for much longer...;
RustyHill is offline   Reply With Quote
Old 06-19-2025, 04:11 PM   #1012
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,981
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Move where the Temp folder resides (there is a FAQ)
Your current (windows default) is
Code:
C:\Users\xxx\AppData\Local\Temp
+ however you logon really is
Make a C:\tmp folder and configure calibre to use that
theducks is offline   Reply With Quote
Old 06-19-2025, 04:39 PM   #1013
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,059
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Quote:
Originally Posted by RustyHill View Post
File "calibre\devices\mtp\driver.py", line 441, in prepare_addable_books
FileNotFoundError: [WinError 206] The filename or extension is too long: 'C:\\Users\\xxx\\AppData\\Local\\Temp\\calibre-ol17m72z\\3fvk151z_prepare_mtp\\o122AC\\Gobbelino London & a Menace of Mermaids_ Cats, snark, & dangerous waters - a complete funny, cozy urban fantasy series (Gobbelino London, PI Book 6)_B0C3YZN5SP.sdr'
In order to import books from newer Kindles that connect using MTP connections the multiple KFX files that make up each book are first copied by calibre from the Kindle to local storage. Apparently I didn't handle long file names properly when I contributed that code to calibre. I will look into fixing it for a future release.

In the mean time a work around would be to manually copy the main .kfx file along with all of the additional files in the associated .sdr folder to someplace on your PC, create a .zip file containing all of those files, rename the extension from .zip to .kfx-zip, and then import that into calibre.

(Or just use another source for the book as I see you have done.)
jhowell is online now   Reply With Quote
Old 06-19-2025, 04:45 PM   #1014
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,059
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Quote:
Originally Posted by RustyHill View Post
As an aside, one book still failed to convert, appearing as an azw but Calibre thinking it was a KFX-ZIP. Odd.
That version of Kindle for PC always uses the file extension .azw regardless of the actual book format, KFX in this case.

Quote:
Originally Posted by RustyHill View Post
Job: 0 Convert book 1 of 1 (The Demon, the Hero, and the War for Widdershins: A Mal & Reg Novel of Widdershins) finished
Convert book 1 of 1 (The Demon, the Hero, and the War for Widdershins: A Mal & Reg Novel of Widdershins)
...
DeDRM v10.0.9: Ultimately failed to decrypt after 1.0 seconds. Read the FAQs at noDRM's repository: https://github.com/noDRM/DeDRM_tools...master/FAQs.md
For assistance with DRM removal ask at the site hosting the DeDRM plugin.
jhowell is online now   Reply With Quote
Old 06-19-2025, 04:59 PM   #1015
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 79,545
Karma: 145863177
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I didn't know some author's used such stupid names in the metadata for their eBooks.

I would go on Amazon and put in a complaint about the title. Also, if you can contact the author, do so and tell said author how stupid he/she is.

Last edited by JSWolf; Yesterday at 05:38 AM.
JSWolf is offline   Reply With Quote
Old 06-19-2025, 06:18 PM   #1016
RustyHill
Enthusiast
RustyHill began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Feb 2023
Device: Kindle
Thanks for all the feedback & suggestions.. I'll try (some) of them out Friday. ☺
RustyHill is offline   Reply With Quote
Old Yesterday, 08:02 AM   #1017
RustyHill
Enthusiast
RustyHill began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Feb 2023
Device: Kindle
OK, so this turned out to be the (stupidly long) book name problem. The full book name, excluding extension, is 154 Char$ long. Calibre and plugins fail on this length of name. (see the debug logs)

The problem was also (probably) not helped by my using the default Temp/tmp dir, which also defaults to a long path and so might well cause problems when matched with a very long book file name.

So, of course I then changed two things at once!

First off launch Calibre from a batch file which also sets it's own (short) path variable. In my case like this:

::
:: 2025/06/20
::
SET TEMP=D:\TMP
SET TMP=D:\TMP
SET CALIBRE_TEMP_DIR=D:\TMP
START CALIBRE.EXE

So these are not persistent and only affect the current Calibre session.

I then copied *all* the files related to the book of interest from my KPW to d:\tmp

It's essential to keep the same dir structure, so in my case that was found in:

This PC\Kindle Paperwhite\Internal Storage\documents\Downloads\Items01

Copy the actual book file..

Gobbelino London & a Worry of Weres_ Cats, snark, & canine problems - a complete funny, cozy urban fantasy series (Gobbelino London, PI Book 5)_B09WYV7QFN.kfx

Then under that dir you'll find a sub dir you'll find a dir with the same name but ending in .sdr. Copy this to the same d:\tmp dir as before. In my case it had 10 items in it - 8 files and 2 further dirs. (assets & data) Both these dirs also had sub dirs... make sure they have copied too. (assets holds attachables sub dir data holds .pagination.cache sub dir)

So in my case that's 12 files & associated sub dirs.

Then import the top level book file into Calibre's library from the HD. Calibre and the plugins will then also use the remaining files to allow DeDRM and then conversion to Epub.

So that's two methods which still work with 'new' Kindle books, esp. those with far too long file names - K4PC 2.4.0 (70904) and this manual copying.

All so I have a backup just in case! Phew.
RustyHill is offline   Reply With Quote
Old Yesterday, 08:42 AM   #1018
RustyHill
Enthusiast
RustyHill began at the beginning.
 
Posts: 28
Karma: 10
Join Date: Feb 2023
Device: Kindle
Yep - stupidly long filename.

See https://www.mobileread.com/forums/sh...d.php?t=291290

This all works fine now - many thanks for the great support.
RustyHill is offline   Reply With Quote
Old Today, 07:00 AM   #1019
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,059
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
The next version of calibre after 8.5.0 will have a fix for importing books with very long names from Kindles that use MTP.
jhowell is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
KFX conversion, transfer back to library issue. shoelesshunter Conversion 9 04-13-2025 11:15 AM
[Conversion Input] Microsoft Doc Input Plugin igi Plugins 77 03-08-2025 04:04 AM
[Conversion Input] LaTeX Formulas Input Conversion Plugin sevyls Plugins 0 03-23-2015 05:52 AM
[Input Plugin] DOCX Input SauliusP. Plugins 42 06-05-2013 04:01 AM
Looking For MHT Input Conversion Plugin FlooseMan Dave Plugins 4 03-30-2010 05:52 PM


All times are GMT -4. The time now is 08:23 AM.


MobileRead.com is a privately owned, operated and funded community.