View Single Post
Old 02-06-2017, 05:36 PM   #1
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: 6,496
Karma: 84420419
Join Date: Nov 2011
Location: Tampa Bay, Florida
Device: Kindles
Dealing with Kindle for PC/Mac 1.19 (and later) and KFX in calibre

It is possible to import into calibre and convert the vast majority of books downloaded using the latest release of Kindle for PC (version 2.3.1) or Kindle Classic for Mac (version 1.40.3) as long as both the DeDRM (version 10.0.9 beta) and KFX Input plugins are installed in calibre.

Some books that Amazon always delivers with the strongest encryption may not work when downloaded using these programs, however no other method is likely to work for those books anyway.

The newer Kindle for PC app available in the app store for Windows 11 and the latest Kindle for Mac app (7.0) cannot be used to download usable books.

Most books downloaded using the PC/Mac apps will be in KFX format. This format is highly processed by Amazon. In most cases KF8 (azw3) format is closer to the original file format provided to Amazon by the publisher. Users who desire that format should use other methods.

For methods of obtaining usable Kindle books that do not involve the PC and Mac apps see the threads Amazon and DRM changes and DRM workaround: Kindle for Android.

Older methods that no longer apply in most cases have been moved to the following spoiler.
Spoiler:

Important update: Amazon has made a change to their service so the books published since Jan 3 2023 can no longer be downloaded using Kindle for PC or Mac versions prior to 1.39. (Details in this thread.)This means that methods 1, 2, and 4 described below are no longer effective for those books. Methods 3 and 5 still work. There is also a new method (#6) using an old version of the Kindle for Android app described here.

The Kindle for PC and Kindle for Mac programs use Amazon's KFX format for most books. Each book will appear in a separate subdirectory of the "My Kindle Content" folder with a file extension of ".azw". Unless additional steps are taken, these books will fail to convert in calibre with the error: "KFXError: This is an Amazon KFX book. It cannot be processed."

There are several methods for either avoiding or handling KFX format. The following descriptions apply both to Kindle for PC and Kindle for Mac unless one is mentioned explicitly.


Method 1 - Revert to an older version of Kindle for PC/Mac

Older Kindle for PC/Mac version 1.17 can sometimes be installed to work around this problem. (Note: This is a 32-bit program and so it is not compatible with MacOS Catalina and later.)

Perform the following steps:
  • Launch Kindle and under the menu choice "Tools", "Options", "General", uncheck "Automatically install updates when they are available without asking me.", and save. (Note: This option is not available in some Kindle for Mac versions.)
  • Exit the Kindle program.
  • Delete the contents of the "My Kindle Content" folder within your "Documents" folder.
  • Download and verify version 1.17 of Kindle for PC/Mac. (See instructions later in this post.)
  • Install the downloaded version 1.17 software.
  • Launch it and check that the option to automatically install updates is still turned off.
  • Kindle may need to be registered by signing in to your Amazon account within the program. Some users have reported being unable to sign in to their Amazon account within Kindle for PC once version 1.17 is reinstalled. If that occurs go to the Amazon website and on the manage your content and devices page, and on the "Your Devices" tab locate "Kindle for PC" (or Mac) and deregister it using the "..." "Actions" menu. Wait a few minutes for it to take effect and try to sign in again. (If all else fails then re-install and register again and start over with step 1.)
  • Re-download your books before importing into calibre.
  • If asked if you want to update to the new version always reject it. (Choose "Skip this version".)
  • Kindle may try to update itself without asking for permission. See the end of this post for ways to prevent undesired updating of the Kindle app.


Method 2A - Disable KFX support in Kindle for PC at startup

It is possible to prevent versions of Kindle for PC up to version 1.34 from making use of KFX format by using a special batch file to launch the program. (This method does not apply to Kindle for Mac or to Kindle for PC version 1.35 and later.)

KFX_begone4.bat can be downloaded from this post. (Thanks to DNSB.) When launched this batch file will start Kindle for PC and then apply a registry change to disable KFX format. The batch file may take several seconds to terminate. After that any books downloaded using Kindle for PC will be in the older Kindle formats.

If a book downloads while the batch file is in progress it may be delivered in KFX format. If that happens remove the book and download it again.

If Kindle for PC is started without using KFX_begone4 it will revert to allowing KFX. The batch file must always be used to launch Kindle for PC before downloading books.


Method 2B - Disable KFX support in Kindle for PC/Mac

It is possible to prevent some older versions of Kindle for PC/Mac from making use of KFX format by applying a change to the software.

The last Kindle for PC version in which KFX can be disabled using the method described below is 1.24.3 (51068) and the last Kindle for Mac version is 1.31. It will not work if a later version is installed.

Perform the following steps:
  • Exit the Kindle program.
  • Open a command window (PC) or terminal window (Mac).
  • Cut and paste the appropriate command for your operating system to disable the renderer-test program.
    PC:
    ren %localappdata%\Amazon\Kindle\application\renderer-test.exe renderer-test.xxx
    Mac:
    chmod -x /Applications/Kindle.app/Contents/MacOS/renderer-test
    This prevents the renderer-test program from executing, blocking the use of KFX.

    PC Note: The renderer-test program may be in a different location in some Kindle for PC installations. If the rename command fails look in other folders, such as C:\Program Files\Amazon\Kindle.

    Mac Note: If the chmod command fails with a permission error try again using sudo.
  • After restarting the Kindle program any books previously downloaded in KFX format will no longer open. You will need to remove them from your device and re-download them. All future downloads will use the older Kindle formats instead of KFX although they will continue to be placed in one individual subdirectory per book.
  • See the post by odamizu for additional instructions required when using Kindle for Mac 1.25.2 or later. (link)
  • If the Kindle software is updated or re-installed these steps will need to be repeated. See the end of this post for ways to prevent undesired updating of the Kindle app.


Method 3 - Use an e-ink Kindle instead

If you have an e-ink Kindle device registered to your Amazon account you have the option of downloading books directly from Amazon instead of using Kindle for PC/Mac.
  • From the Amazon website access "Account & Lists" -> "Manage Your Content and Devices".
  • Find a book you want to import into calibre and press the "..." button in the "Actions" column for that book.
  • In the menu that pops up choose "Download & transfer via USB". Then select the name of your registered kindle device in the drop down menu and press the "Download" button.
  • Import the downloaded file into calibre using the same procedure that you would use for a file from Kindle for PC. You will need to select the proper folder containing the downloaded file. (This folder will be different from the "My Kindle Content" folder used by Kindle for PC.)

Note that Download & Transfer is not available for every book. Books borrowed through Kindle Unlimited or Prime Lending do not have this option. And there are other miscellaneous categories of books where this is unavailable.

In addition, the owners of older e-ink Kindles running firmware prior to 5.6.5 (August 2015) can access books in non-KFX formats directly from the device via USB.


Method 4 - Convert from KFX to other formats

It is possible to convert books from KFX to other formats in calibre by installing the optional KFX Input plugin. This can be useful for books that are only available in KFX format, such as those in Arabic and Traditional Chinese.

Using the most recent pre-release version of the DRM removal plugin (10.0.9) it is possible to removal KFX DRM from books downloaded using certain versions of Kindle for PC (up to version 2.0) and Kindle for Mac (up to version 1.40.1).

Amazon is aggressive in updating KFX DRM whenever it is broken so anyone desiring to do this should act quickly. Newer versions of these app with new DRM are in the process of being rolled out.

Method 5 - Choose books not available in KFX format

Books that are unavailable in KFX format will be delivered to Kindle for PC in Amazon's older formats for which DRM removal is possible. Unfortunately these are only a very small subset of the Kindle books available on Amazon and it is difficult to tell ahead of time which books they are. For those books this works using even the latest version of Kindle for PC.

Many comics and manga should work. If the product description of a book shows "Enhanced typesetting: Enabled" then that book will almost certainly not work.

You can obtain the free sample of a prospective book and test whether that works before purchasing. However there will be cases when a sample is not delivered in KFX format but the full book is. If you download the book and there is a "voucher" file present then it is in KFX format.


Method 6 - Use an old version of Kindle for Android

The Kindle for Android app can be run using emulator software on just about any system. An Android device is not required.

See the thread: DRM workaround: Kindle for Android for details.


**********************************************
Obtaining and verifying older versions of Kindle for PC/Mac software

Older versions of the Kindle PC/Mac software are no longer available directly from Amazon. You will need to search online for the proper file name and download it from a third party site. The file name to search for each version is listed below.

Important: After downloading you should verify the SHA-256 hash of the file in order to avoid malware. If the hash does not match, delete the downloaded file and try again from another site. Do not install a file that has an incorrect hash!

One way to verify a hash in Windows is to open a command window, change to the folder containing the downloaded program, and enter the command:
certutil -hashfile <filename> SHA256

In MacOS use the command:
shasum -a 256 <filename>

(Replace <filename> with the actual name of the downloaded file.)


version 1.17/1.17.1
filename: KindleForPC-installer-1.17.44170.exe
SHA-256: 14e0f0053f1276c0c7c446892dc170344f707fbfe99b695176 2c120144163200

filename: KindleForMac-44182.dmg
SHA-256: 28dc21246a9c7cdedd2d6f0f4082e6bf7ef9db9ce9d485548e 8a9e1d19eae2ac

version 1.24
filename: KindleForPC-installer-1.24.51068.exe
SHA-256: c7a1a93763d102bca0fed9c16799789ae18c3322b1b3bdfbe8 c00422c32f83d7

version 1.26
filename: KindleForPC-installer-1.26.55076.exe
SHA-256: c9d104c4aad027a89ab92a521b7d64bdee422136cf562f8879 f0af96abd74511

filename: KindleForMac-55093.dmg
SHA-256: 580957ca56b1e77b7952f41970836481f37ada3071eaee3552 265069b89ef757

version 1.28
filename: KindleForPC-installer-1.28.57030.exe
SHA-256: 6feea6ec44ff3d3b7be23e7a969fe14ab884a7b19e23bc2c74 237730411559f6

filename: KindleForMac-57029.dmg
SHA-256: b4de86ba1b78966c754d220fe09fd7dbdbadd874b19e51d261 d8308e6e0d4cb3

version 1.34.1
filename: KindleForPC-installer-1.34.63103.exe
SHA-256: 3dc62b3895954fc171d4a3d08f2b7a1a503233e373c163adb7 bc7fd34cdeff49


**********************************************
Preventing undesired updates

The Kindle app can be aggressive about updating itself to the latest version. Even after the option to automatically install updates is deselected the software sometimes will update itself unexpectedly.

To block automatic updates under Windows locate the "updates" folder within your Kindle for PC installation and replace it with a file of the same name. The attached batch file ("disable k4pc download.bat") will perform that process automatically as long as Kindle for PC has been installed for single user use. After running this file Kindle for PC will still try to download the new update each time it is restarted, but it will be unable to do so.

See this post by odamizu for instructions to block automatic updates on the Mac platform.

When running the app if a dialog pops up indicating that a newer version is available always choose the option to "skip this version".
Attached Files
File Type: bat disable k4pc download.bat (658 Bytes, 13044 views)

Last edited by jhowell; 03-08-2024 at 10:10 AM.
jhowell is offline   Reply With Quote