-
-
Save spf13/1fee1eb88d65aca34272c99e4d68689d to your computer and use it in GitHub Desktop.
Download all your Kindle books before Feb 26, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1. Log in to your Amazon account | |
| // 2. Go to your Content Library > Books - https://www.amazon.com/hz/mycd/digital-console/contentlist/booksAll/dateDsc/ | |
| // 3. Open your browser's Javascript console | |
| // 4. For each page of books, paste this script into the console | |
| function closeNotification() { | |
| document.querySelector('span#notification-close').click(); | |
| } | |
| function pause(duration = 1000) { | |
| return new Promise((resolve) => { | |
| setTimeout(resolve, duration); | |
| }); | |
| } | |
| menus = Array.from( | |
| document.querySelectorAll('div[id*="DOWNLOAD_AND_TRANSFER_ACTION_"]') | |
| ).filter((el) => !el.id.endsWith('CONFIRM') && !el.id.endsWith('CANCEL')); | |
| inputs = Array.from( | |
| document.querySelectorAll( | |
| "ul[id^='download_and_transfer_list_'] > li[class^='ActionList-module_action_list_item__'] > div > label" | |
| ) | |
| ); | |
| buttons = Array.from( | |
| document.querySelectorAll( | |
| "div[id^='DOWNLOAD_AND_TRANSFER_DIALOG_'] div[class^='DeviceDialogBox-module_button_container__'] > div[id$='_CONFIRM']" | |
| ) | |
| ); | |
| (async function () { | |
| for (let i = 0; i < 25; i++) { | |
| if (menus[i]) { | |
| menus[i].click(); | |
| inputs[i].click(); | |
| buttons[i].click(); | |
| await pause(); | |
| closeNotification(); | |
| } | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
DOWNLOAD_AND_TRANSFER_ACTION_ is now DOWNLOAD_AND_TRANSFER_DIALOG_