I spent yesterday morning downloading ALL my (~2400) Kindle books using the command line utility from https://github.com/yihong0618/Kindle_download_helper
In case anyone else needs to do something similar: Log in to your Amazon account > Manage Your Content and Devices
Copy the cookie and save it to a file ('cookie.txt'): https://github.com/yihong0618/Kindle_download_helper?tab=rea...
Execute the Python utility (this example accesses amazon.co.uk):
python kindle.py --cookie-file cookie.txt --uk -o DOWNLOADS --device_sn [Your Kindle serial no.] --mode all
You can also download a JSON list containing details of all your Kindle books:
python kindle.py --cookie-file cookie.txt --uk --list --device_sn [Your Kindle serial no.]
There are other methods outlined in the README, but this worked best for me.
I also extracted a list of cover URLs from the JSON file using a basic Python script (with output redirected to a file 'covers.txt'):
import json
with open('book-list.json') as f:
json_data = json.load(f)
for i in range(len(json_data)):
print(json_data[i]['productImage'])
And then I used wget to download them all too:
wget --wait=3 --random-wait --input-file=covers.txt
Of course, the books are still DRM'd, but it's trivial to DeDRM them later. The crucial thing was to get the files before it's too late!
I have error in each book. Asin: B0CNNDLFC5 download failed. I follow the steps you mentioned. I have json file and I downloaded the image files. But I have an issue with the books themselves. each download line gives error "Asin: .... download failed"
All I get is:
``` Exception: Can't get the csrf token, please refresh the page at https://www.amazon.co.uk/hz/mycd/myx#/home/content/booksAll and retry ```
Can someone give explicit instructions about the content of the cookie.txt?
The README instructions are unclear.
Firefox Web Developer Tools:
- Go to the 'Network' tab, refresh the page, and select a POST request.
- In the 'Headers' tab, scroll down and look for 'Cookie'. Right-click on this, and 'Copy Value'.
- Paste the value into a new text file, called 'cookie.txt'.
For reference, here's an example value of my cookie:
Well, this is delightful; the links that this tool finds now 403, and looking at the network inspector, it seems that the URLs are now signed in some way.
Last time I tried to DeDRM my Kindle book collection, there were many books with "newer" DRM that wasn't possible to strip. Did that improve recently?
My collection is mainly .azw3 and .azw, with a handful of .tpz and azw4.
The former were trivial to strip; the latter, I'm not so sure yet. However, I have no .kfx books, so perhaps I haven't been exposed to the newer DRM?
If you download them using the serial # of an older kindle it should get the older file type and work
Thank you! This was a great help in getting everything saved.