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
python kindle.py --cookie-file cookie.txt --uk --list --device_sn [Your Kindle serial no.]
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'])
wget --wait=3 --random-wait --input-file=covers.txt
``` 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.
reply
- 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:
session-id=152-5779672-8150522; session-id-time=2072187201l; i18n-prefs=USD; ubid-acbuk=259-0623959-6435953; lc-acbuk=en_US; x-acbuk="@fcSz1?ZoidPtV8iWFAT7S17q2buySBbi4OwMLzIatTX959dMWVcBs49BIYMKXwJ"; at-acbuk=Atza|IwEBILEDqYWReiVGyOpmljozmQfD84EYR493RQmb81gnR8CQajM2fpFmD7Ctc_db6aZ4e_ERI-VUHdji6-7tbYD6CGd10XzLG0hkvc2o5fl_OoT-SeDq_RvSygSUBzSd490Rg9gcUgDnEdUail7DvN0azO8a-aCtP1OZLk3YybpWL8rvCmlUGZeOWdF38FqGK61ne-HIUbXyU2Iy76995hLRebGrWRC3itESiiqYK0_fROUAUQ; sess-at-acbuk="6TNr+KYPYOzhQzHqyVoy91Xuq46dx4JxZmhWLgMTazs="; sst-acbuk=Sst1|PQGAuJ4uN8jtkdj4izQcBXmJCedA0A6Ct4AQkODweU5nYxW7f4kcYZAcoMF4TdDLcPeJc8OG1G1Q8dfCXZS8vjdWJmKElymBmqbaLKs1QVUbPFZheZefgl2REzTcqQIhaZX9aVy8kDwmWnkroAWDGv49gWadknkKUbHFq_gxyM8TKVEy8PGF2gmkDXkg2pvl598uZUXDL5svz9XDdQ90RRZVadMT8wlp2j5gO5Plftf5Zvzg-j4sT_3XIyuxKh8jwmeICxoaXvvkLO274UMcLCNZXEkrPQ-CmjUkACQ5M5rOcAI; session-token="CXpMUQVXX+bcPXMLqA7T9caleUA9JO5VWkX834DDQPUumoVZWL4vyjpKFMyjQVoVOlyAYTG0hT3E9QmhWG18kPxfPQq3vquApm1HzDUTuOwb8XSdG0Avkrp2I+lwgpjYMdOX1xiMMtgFLcxxKsIA9cPDPEinm1p4SVTHYdQ6S83TzcuK5Jr+C5oE4ZNoDeuY7p7aTitCEHxuHwMRqHzwEtKj7TB8N6S1x1KLjnd8X8u5ToZGudN5UYmKtp7tuIObvC4Z064GtK1I9OZvTF32KLW5XkY0v9FWUuZqEze5xkoukN+7o3KSnCYMfFteNPY1Nk+IislDOVbGwRuEaYbxPHYCuVj1RyamIA2LbLx1dRqe3ODi8B/b9oCP1VHuDFdqmqMYbxNy66Q="; sp-cdn="L5Z9:DE"
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?
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):
You can also download a JSON list containing details of all your Kindle books: 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'):
And then I used wget to download them all too: 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!