Designed for downloading your Kindle eBooks in a more automated fashion than is typically permitted, this tool allows you to create backup copies of the books you've already purchased.
The most important pre-requisite is that you have a physical e-ink Kindle or an Amazon Fire Tablet linked to your Amazon account. This is a requirement from Amazon's side and this tool does not offer a way to bypass this.
An important distinction is that the physical Kindle you have linked cannot be one of the latest 2024 models. For whatever reason, Amazon has decided to block the ability to download books from these devices. This tool will not work with these devices.
The easiest way to check if this tool will work for you is to log into your Amazon account manually and navigate to Manage Your Content and Devices
. From there when clicking on More Actions > Download & Transfer via USB
on a book, you should see your Kindle or Fire Tablet device listed. If you see the message You do not have any compatible devices registered for this content
then it means you:
- either don't have a Kindle or Fire Tablet device linked to your account, OR
- have a Kindle or Fire Tablet device that is not compatible with this tool
If you are able to proceed to the next screen and download the book, then this tool should work for you.
Clone this repository onto your machine, then install dependencies with bun. You can install bun using the instructions found here
bun install
Note that amazon credentials will need to be provided. Currently this script expects them to be in the following ENV variables:
Variable | Description | Required |
---|---|---|
AMAZON_USER |
Account username | Yes |
PASSWORD |
Account password | Yes |
OTP |
6 digit one-time password | If 2 factor auth is enabled |
I recommend using the env template found in the root of the repo to create and .env file containing your specific vars.
The following CLI arguments are made available to customise the downloader to your needs
Argument | Default Value | Description |
---|---|---|
--baseUrl |
N/A (Will be prompted if not provided) | Which Amazon base URL to use. Note, this MUST include www. in order to work properly |
--totalDownloads |
9999 | Total number of downloads to do |
--maxConcurrency |
10 | Maximum number of concurrent downloads |
--startFromOffset |
0 | Index offset to begin downloading from. Allows resuming of previous failed attempts. Note this argument has known issues and should probably be avoided for now. |
--manualAuth |
false | Allows user to manually login using the pupeteer UI instead of automatically using ENV vars. Use when auto login is not working. |
You can run this tool using the following command
bun run start
Command line arguments can be provided as follows
bun run start --baseUrl "https://www.amazon.com.au"
If you're having any issues with the tool, please first ensure that you have the latest version of the code by running git pull
or redownloading the repository and then running bun install
from the root of the repository.
In addition, please ensure that you have followed the pre-requisites section carefully and can download a book manually through the website.
This error may indicate that you are authenticated to the wrong Amazon account for your locale.
You need to ensure that you provide the base URL for the Amazon region where your purchases were made. For example, if you are in Australia, you should use https://www.amazon.com.au
, if you are in the USA, you should use https://www.amazon.com
, etc.
This base URL should be provided as a CLI argument when running the tool. For example:
# For USA based accounts
bun run start --baseUrl "https://www.amazon.com"
# For Australia based accounts
bun run start --baseUrl "https://www.amazon.com.au"
# ... etc.
From my testing, 404 errors on book downloads largely occur when the tool is attempting to download an item that is simply not downloadable. From what I can tell, this includes certain comic book purchases. Users with comic book libraries and knowledge of javascript are encouraged to contribute to the project to help test and fix this issue.
There has also been an indication that 404s can ocurr when a book is present on too many devices. If that's the case, you can try deleting the book of some of your devices and try the tool again.
This indicates that your login did not fully succeed. There are a multitude of reasons why this could happen however the simplest fix is often to login using the --manualAuth CLI flag instead of using the automated process.