mkb79 / audible-cli

A command line interface for audible package. With the cli you can download your Audible books, cover, chapter files.
GNU Affero General Public License v3.0
422 stars 45 forks source link

Hangs on download error #135

Open snowskeleton opened 1 year ago

snowskeleton commented 1 year ago

I recently had an account error where a book was in my library but not downloadable (for unrelated reasons).

audible-cli didn't seem to handle this well. With the --all flag, it would download all legal targets, issuing errors and skipping existing files as appropriate, but then just hang indefinitely until interrupted.

Here's an abbreviated stack trace

$ audible download --all --aaxc
...
<other successful downloads>
...
error: The Wealth of Nations is not downloadable.
error: City of Light: The Traveler's Gate Trilogy, Volume 3 is not downloadable.                          
error: The Crimson Vault: The Traveler's Gate Trilogy, Volume 2 is not downloadable.
<hangs here>
^C
Aborted!
sys:1: RuntimeWarning: coroutine 'download_aaxc' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

Not a high priority issue, but I figured you'd like to have the info.

mkb79 commented 1 year ago

Hi. Thank you for this information. The code should not hang here, just skip the item. I will look on this.

FYI: You don’t have the right to consume these titles offline. Maybe these are streamable only? These is the reason for the issue but not why it’s hang.

snowskeleton commented 1 year ago

The reason for the error is that Audible removed the titles from their Plus catalog, so I no longer had rights to them. I was able to sort it out with amazon support thankfully.

philgoetz commented 3 months ago

Is this related to the fact that audible-cli can't resume after a ctrl-z ? I'm running audible-cli thru cygwin on a Windows 10 base, like this:

audible download -o downloads/aaxc/ --all --aax-fallback

I paused it with ctrl-z, but when I later tried to 'fg' it, it took over the foreground but never downloaded another file, nor terminated, nor printed anything to the terminal.

mkb79 commented 3 months ago

Do you have the same issue if you download an book with --aaxc instead of --aax-fallback

philgoetz commented 3 months ago

No, it resumes just fine from that.

mkb79 commented 3 months ago

@philgoetz I'm think this issue have to do with #193.

mkb79 commented 3 months ago

@philgoetz Can you try out the same with option --timeout 0? The new downloader class of audible-cli makes now a HEAD request to collect some information from the server. The response for this HEAD request will take 1 - 2 minutes for aax files. For aaxc files this take only some ms. Therefore the client will timeout without an exception. Why ever?!

philgoetz commented 3 months ago

@philgoetz Can you try out the same with option --timeout 0?

I did, and it resumed correctly!

philgoetz commented 3 months ago

I have another problem more-similar to that of the original poster: a crash on a file which is not downloadable

File /cygdrive/d/data/audio_/Audible/downloads/aaxc/How_to_See_Looking_Talking_and_Thinking_About_Art-AAX_22_64.aaxc already exists. Skip download. error: Fundamental Principles of the Metaphysics of Morals is not downloadable.

Fundamental Principles etc. is listed on audible.com as a title available for purchase, but when viewed within my library, it says it is "Unavailable". After I click on 'Unavailable' for more info, a popup appears saying "Check that your Audible membership isn’t cancelled or paused. If it isn't, this title may not be available anymore."

I think this is a title which I added to my library when it was temporarily free, and which isn't free anymore. There will be many such files in my library.

mkb79 commented 3 months ago

You can try to provide the --ignore-errors option.

snowskeleton commented 3 months ago

Also @philgoetz you might have some luck reaching out to Audible support to have those titles permanently added to your library. I had "purchased" a couple free titles that stopped being free, and they added them to my account when I asked. YMMV.

philgoetz commented 3 months ago

You can try to provide the --ignore-errors option.

I removed all those titles, and provided --ignore-errors, and successfully downloaded everything.

philgoetz commented 3 months ago

On Fri, Mar 22, 2024 at 3:36 PM Isaac Lyons @.***> wrote:

Also @philgoetz https://github.com/philgoetz you might have some luck reaching out to Audible support to have those titles permanently added to your library. I had "purchased" a couple free titles that stopped being free, and they added them to my account when I asked. YMMV.Message ID: @.***>

Aw, too late. I just removed them all. But thanks.