Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Logging output #174

Open
exharrison opened this issue Feb 20, 2025 · 4 comments
Open

Feature request: Logging output #174

exharrison opened this issue Feb 20, 2025 · 4 comments
Labels
enhancement New feature or request

Comments

@exharrison
Copy link

This project worked great once I got my lesser used dependencies updated (node, etc). One thing I have run across because I have a large collection of comics is that I have a ton of 404 not found in my run of downloads. This makes it hard to evaluate whether there were any non-comics that did not download correctly. I do not see on your readme anything about an output log. I'm going to work around this by just running script to capture the output, but this could be a useful feature.

Thanks for your very useful application.

@inlikealion inlikealion added the enhancement New feature or request label Feb 20, 2025
@treetrum
Copy link
Owner

Whilst I can't know for certain for your library. In my testing 404 errors indicate that the item you're trying to download is simply not downloadable.

If you would like to try the tool and simply exclude comics to ensure that non-comics are being downloaded as expected, you can try editing these lines to remove anything referencing comics. I.e. Comixoloy, ComicsUnlimited

https://github.com/treetrum/amazon-kindle-bulk-downloader/blob/main/src/index.ts#L161-L168

@whitesided
Copy link

whitesided commented Feb 21, 2025

I have a library of about 2500 items and when I ran the download I had 10 fail.

I actually came to report that I'd suggest a log for failed downloads. It's not impossible to scroll back and figure it out manually but it's a drag.

The underlying issue for me on the download is they're apparently enhanced files of some sort that won't display on a standard kindle. They're not comics; I've got tons of them downloaded correctly. Here's one that failed - Developing Graphics Frameworks with Python and OpenGL 1st Edition, Kindle Edition. It's whatever enhancements the file has that prevent it from downloading. Or rather, that Amazon won't let you download it for sideloading unless they know you have such a device.

Image

Here's the explanatory information on the info page for the OpenGL book:

Image

I'm going to see if I can find an older kindle fire around and add it to my account. I'm not sure there's much for you to do with regards to this sort of issue other than log it so users can go try other solutions.

Update: I found a Kindle FIre 10 and registered it and now most of those files can be downloaded. I did find one that is a purchase from 2013 that no longer has a landing page and three that were Kindle Vella. Of the six that I could download four were azw3 files and two were azw4 files.

@rsholmes
Copy link

Whilst I can't know for certain for your library. In my testing 404 errors indicate that the item you're trying to download is simply not downloadable.

If you would like to try the tool and simply exclude comics to ensure that non-comics are being downloaded as expected, you can try editing these lines to remove anything referencing comics. I.e. Comixoloy, ComicsUnlimited

https://github.com/treetrum/amazon-kindle-bulk-downloader/blob/main/src/index.ts#L161-L168

For what it's worth, a large fraction of my Kindle books are comics, and they downloaded fine. (Choosing my 8-ish year old Kindle paperwhite).

@WEricBr
Copy link

WEricBr commented Feb 22, 2025

I found a way to log the output to a file as well as the console.
It has a couple of caveats:

  1. It completely hoses the progress bar display both on screen and in the output file
  2. It throughs an error message at the beginning of run, but the "bun run start..." still works
  3. You have to do quite a bit of cleanup in the output file to handle the progress bar output and the "Esc" outputs

Here is a powershell script that outputs the data to a file as well as the console:

bun run start bun run start --totalDownloads 1000 --startFromOffset 7001 --duplicateHandling skip --baseUrl "https://www.amazon.com" -Width 150 *>&1 | 
    Format-Table -autosize |
    Tee-Output -file "\DownloadOperation.log" -append
-append is only necessary is you don't want to overwrite the file

A RegEx that cleans up most of the "process bar" stuff in the log using the VS Code "Replace" function is:
Find: ΓûêΓûê.*?\s (with the Use Regular Expression selected)
Replace: empty string

A RegEx that cleans up most of the "Escape Sequence" stuff in the log using the VS Code "Replace" function is:
Find: �[2K�[1A.*?\s| (with the Use Regular Expression selected)
Replace: empty string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants