Where are Amazon Kindle ebooks located on my Linux PC after I download them for offline reading with the "Kindle Cloud Reader" Chrome app, & how do I convert them to PDF format?
For Windows this seems to be the answer:
- Where does Chrome stores offline books downloaded using Amazon-Cloud Extension on Windows 7? - Stack Overflow
- Where is my Ebook that I just bought from Amazon Kindle to my PC? - Ebooks Stack Exchange
For MacOS this seems to be the answer:
But for Linux there doesn't seem to be an answer. :(
My aim is to convert the Kindle ebook to a PDF format (which I much rather prefer) for offline reading on any device. Enough of this proprietary "read through Kindle app only" garbage. I'm on Linux for Heaven's sake!
Update: in ~/.config/google-chrome
I have the following:
gabriels:~/.config/google-chrome$ ls
Avatars pnacl
BrowserMetrics Profile 1
BrowserMetrics-active.pma Profile 2
BrowserMetrics-spare.pma Safe Browsing
Certificate Revocation Lists Safe Browsing Channel IDs
CertificateTransparency Safe Browsing Channel IDs-journal
Consent To Send Stats Safe Browsing Cookies
Crash Reports Safe Browsing Cookies-journal
Dictionaries ShaderCache
FileTypePolicies SingletonCookie
First Run SingletonLock
Guest Profile SingletonSocket
Local State SSLErrorAssistant
NativeMessagingHosts Subresource Filter
OriginTrials System Profile
PepperFlash Webstore Downloads
How to convert purchased Amazon eBooks to PDF format:
This is a hard problem. However, I have a solution, but Linux users (including myself) aren't going to like it.
First off, let me say: DON'T STEAL BOOKS OR ANYTHING ELSE! BUY THEM! PAY AUTHORS FOR THE THOUSANDS OF HOURS THEY PUT INTO THEIR CRAFT AND THEN WRITING ABOUT IT. I'm going to explain how to do some things but DON'T STEAL BOOKS. This assumes you have PURCHASED AN EBOOK and are just PISSED OFF THAT WITH THAT PURCHASE YOU DON'T HAVE THE FREEDOM TO READ IT AS A PDF (A FREEDOM WHICH I THINK YOU SHOULD HAVE).
Also, there are possibly other paths to accomplish what I'm about to describe. If I see a possible alternate path I'll mark it with the word "clue", so watch for those and head down those paths to write your own improved answer if you wish.
1) Get the eBook from Amazon onto your PC for "offline reading"
What you need is the Kindle App "for PC & Mac": https://www.amazon.com/kindle-dbs/fd/kcp. However, don't use this link to download it, because the current version as of 5 Mar. 2018 is 1.21 Build 48017, and all versions after Kindle for PC 1.17 use a new "KFX format" which is currently uncrackable.
Clue: go crack the KFX format. We will all thank you for it.
Now, turn off your Ubuntu computer and boot into Windows.
Clue: You may be able to do this using Wine or by installing Windows 10 for free into a virtual machine inside Ubuntu instead.
So, go download an old version of the "Kindle for PC" app here:
https://kindle-for-pc.en.uptodown.com/windows/old. You must use version 1.17 or earlier for this to work. I used 1.16 Build 44025.
Install the App. Log in with your Amazon account, right-click the ebook you want, and go to "Download."
This will save it on your PC for offline viewing. You'll now find your downloaded book as a ".azw" file in "C:\Users\MY_USERNAME\Documents\My Kindle Content". For ex: "C:\Users\MY_USERNAME\Documents\My Kindle Content\B08137WHQ_EBOK.azw".
Clue: later versions of the Kindle for PC app will give you a folder with that name containing several other files instead, such as ".azw", ".azw.md", and ".azw.res". Apparently this is the new, uncrackable "KFX" format. Go crack it!
Clue: There is also a Chrome App called "Kindle Cloud Reader." You can install it and download your book for offline viewing too, but it uses a different format too. See comments under my question. On Windows you can find its offline book contents under the hidden folder "C:\Users\MY_USERNAME\AppData\Local\Google\Chrome\User Data\Default\databases\https_read.amazon.com_0". It contains, for example, two files named "85" and "86", with no file extension, but one is clearly the book since it's a few MB, while the other is 44KB or so. On Linux you can do a find in your home directory to find this location with
sudo find . -iname \*amazon\*
. I found the folder in: "~/.config/google-chrome/Profile 1/databases/https_read.amazon.com_0".2) Remove the "Digital Rights Management" (DRM) from the .azw file so you can read the eBook using non-Amazon software.
In short: DRM sucks. If you're an author, don't do that crap! Just sell digital PDFs on Gumroad instead (Update: LeanPub may be a better option instead!).
To remove the DRM from the file we are going to use "DeDRM Tools 6.5.5": https://apprenticealf.wordpress.com/2017/10/20/dedrm-tools-6-5-5-released/.
Download it from GitHub here: https://github.com/apprenticeharper/DeDRM_tools/releases. Notice that the release notes state: "This release does not include any support for the KFX format Kindle ebooks that are often downloaded when using Kindle for PC/Mac 1.19 or later."
Click the GitHub link to download "DeDRM_tools_6.5.5.zip", then extract the zip file so you can find the "DeDRM_calibre_plugin" folder it contains.
Now go install the Calibre ebook reader for Windows 64-bit:
https://calibre-ebook.com/download. I'm using "calibre-64bit-3.18.0.msi".
Clue: I'm actually using this in Windows, but maybe you can get it to work in Linux, since Calibre has a Linux installation page too. DeDRM also contains some good notes you are about to need to help you out if you want to pursue this. See the readme you just extracted above here: "DeDRM_calibre_plugin\DeDRM_plugin_ReadMe.txt". It contains a rather confusing section (for me at least) titled "Linux Systems Only".
Install the DeDRM plugin:
Once Calibre is installed, open it up. Then go to "Preferences" --> "Advanced" section --> Plugins. Choose "Load plugin from file" then find your DeDRM .zip file in the unzipped folder from above. You're looking for "DeDRM_calibre_plugin\DeDRM_plugin.zip". Choose this plugin then click "Open" and "Apply."
Now click "Add books" in Calibre and go find the .azw file we previously downloaded using Kindle for PC 1.16 (1.17 or earlier). It will import it and automatically use DeDRM to remove the DRM crap!
You should now be able to open the eBook in Calibre for reading. Double click the book in Calibre to verify it opens up properly and is readable. It it works, all is well so far.
Clue: If in Windows this works flawlessly. If in Linux you may have to fight it with the readme file above, to get Wine and Python and stuff to all work right--I couldn't figure it out in Linux.
Almost there!
3) Convert the de-DRM'ed eBook to PDF!
Select the book in Calibre and click "Convert books" at the top. Choose "PDF" in the "Output format" drop-down box at the top-right of the window that pops up. You may now click "Ok" to do the conversion, OR (optionally) change a few quick settings first--as described below!
Optional:
Click "Ok" to convert the ebook to PDF! This took ~2 min for me on an eBook ~100 pages in length and 3 MB in size.
Done! Your ebook PDF is now located in your "Calibre Library" folder here: "C:\Users\YOUR_USERNAME\Documents\Calibre Library\EBOOK_AUTHOR\EBOOK_TITLE\EBOOK_TITLE.pdf".
You'll also find a nice (de-DRMed I think) ".azw3" file in the same location as well, in case you want to use Calibre or other generic eBook readers to read the book instead!
Copy the PDF or .azw3 file to your Ubuntu machine, as desired, and voila!--use your favorite ebook reader (ex: Calibre) or PDF viewer (ex: FoxitReader) to view your ebook as a PDF!
Get Foxit Reader for taking notes inside digital PDFs:
Foxit Reader (click here then go to "Free Foxit Reader Download") is great because it has awesome highlighting and comment tools to underline things, highlight, or take notes, and it is cross-platform (Windows, Mac, Linux, & others) and free as in "no-cost" (but not free as in open source!).
AND REMEMBER: DON'T STEAL! Buy the book and give the authors their hard-earned money! Encourage authors to sell PDFs (ex: via Gumroad like I do) (Update: LeanPub may be a better option instead!) instead of DRMed garbage.
But if you steal you are ruining the system. DRM might suck, but you don't have to suck too!
if you don't have Windows or Mac available, but Linux
sudo find . -iname \*amazon\*
If you owned a physical Kindle device (i.e., not just a PC/smartphone app) at one point and it is still listed in your account, then there's a simpler way to download and convert Amazon ebooks:
Calibre has a Linux version, and the standard tool it supports for working with DRM now supports KFX.
You do need to have a version of Kindle for PC running on your computer, which depends on having Wine running. After various problems, there seems to be something about recent versions of kindle for PC, I got an older version running. Some as the original answer, Kindle v 1.16 Built 44025. I am running PlayOnLinux 4.2.12, Wine 3.0.2, in a 64bit virtual drive set to work as Windows 8.1, under Linux Mint 18.3 using Xfce.
So far, at least, I have not had any encounters with KFX files. but it's possible Amazon's use of that format could eventually force me to switch to a more recent Kindle version.
So, August 2018, the answer here works, the KFX encryption has been cracked, but I would like to have some assurance that some more recent version of Kindle for PC will work
@GabrielStaples , your answer provides the full path, but I wanted to add a potential improvement: I just tried to install the exact same Kindle for PC 1.16 to playonlinux and it works like a charm. Ebook file location will depend on how you set it on kindle (Tools/Options/Content/Change Folder), the default being /home/user/Documents/My Kindle Content
So, your answer remains correct, but now you don't need to reboot to your windows partition but can instead do it all from Linux.
If you know how to use adb (that comes in android platform tools) you can write a small script that does -
screengrab
adb exec-out screencap -p > page1.png
swipe
adb shell input swipe 500 200 200 200 200
And repeat until pageN
then use imagemagic's convert tool to create a single pdf from all the image files