Git Product home page Git Product logo

audible-cli's Introduction

audible-cli

audible-cli is a command line interface for the Audible package. Both are written with Python.

Requirements

audible-cli needs at least Python 3.6 and Audible v0.6.0.

It depends on the following packages:

  • aiofiles
  • audible
  • click
  • colorama (on Windows machines)
  • httpx
  • Pillow
  • tabulate
  • toml
  • tqdm

Installation

You can install audible-cli from pypi with

pip install audible-cli

or install it directly from GitHub with

git clone https://github.com/mkb79/audible-cli.git
cd audible-cli
pip install .

or as the best solution using pipx

pipx install audible-cli

Standalone executables

If you don't want to install Python and audible-cli on your machine, you can find standalone exe files below or on the releases page (including beta releases). At this moment Windows, Linux and macOS are supported.

Links

  1. Linux

  2. macOS

  3. Windows

On every execution, the binary code must be extracted. On Windows machines this can result in a long start time. If you use audible-cli often, I would prefer the directory package for Windows!

Creating executables on your own

You can create them yourself this way

git clone https://github.com/mkb79/audible-cli.git
cd audible-cli
pip install .[pyi]

# onefile output
pyinstaller --clean -F --hidden-import audible_cli -n audible -c pyi_entrypoint

# onedir output
pyinstaller --clean -D --hidden-import audible_cli -n audible -c pyi_entrypoint

Hints

There are some limitations when using plugins. The binary maybe does not contain all the dependencies from your plugin script.

Tab Completion

Tab completion can be provided for commands, options and choice values. Bash, Zsh and Fish are supported. More information can be found here.

Basic information

App dir

audible-cli use an app dir where it expects all necessary files.

If the AUDIBLE_CONFIG_DIR environment variable is set, it uses the value as config dir. Otherwise, it will use a folder depending on the operating system.

OS Path
Windows C:\Users\<user>\AppData\Local\audible
Unix ~/.audible
Mac OS X ~/.audible

The config file

The config data will be stored in the toml format as config.toml.

It has a main section named APP and sections for each profile created named profile.<profile_name>

profiles

audible-cli make use of profiles. Each profile contains the name of the corresponding auth file and the country code for the audible marketplace. If you have audiobooks on multiple marketplaces, you have to create a profile for each one with the same auth file.

In the main section of the config file, a primary profile is defined. This profile is used, if no other is specified. You can call audible -P PROFILE_NAME, to select another profile.

auth files

Like the config file, auth files are stored in the config dir too. If you protected your auth file with a password call audible -p PASSWORD, to provide the password.

If the auth file is encrypted, and you don’t provide the password, you will be asked for it with a „hidden“ input field.

Config options

An option in the config file is separated by an underline. In the CLI prompt, an option must be entered with a dash.

APP section

The APP section supports the following options:

  • primary_profile: The profile to use, if no other is specified
  • filename_mode: When using the download command, a filename mode can be specified here. If not present, "ascii" will be used as default. To override these option, you can provide a mode with the --filename-mode option of the download command.
  • chapter_type: When using the download command, a chapter type can be specified here. If not present, "tree" will be used as default. To override these option, you can provide a type with the --chapter-type option of the download command.

Profile section

  • auth_file: The auth file for this profile
  • country_code: The marketplace for this profile
  • filename_mode: See APP section above. Will override the option in APP section.
  • chapter_type: See APP section above. Will override the option in APP section.

Getting started

Use the audible-quickstart or audible quickstart command in your shell to create your first config, profile and auth file. audible-quickstart runs on the interactive mode, so you have to answer multiple questions to finish.

If you have used audible quickstart and want to add a second profile, you need to first create a new authfile and then update your config.toml file.

So the correct order is:

  1. add a new auth file using your second account using audible manage auth-file add
  2. add a new profile to your config and use the second auth file using audible manage profile add

Commands

Call audible -h to show the help and a list of all available subcommands. You can show the help for each subcommand like so: audible <subcommand> -h. If a subcommand has another subcommands, you csn do it the same way.

At this time, there the following buildin subcommands:

  • activation-bytes
  • api
  • download
  • library
    • export
    • list
  • manage
    • auth-file
      • add
      • remove
    • config
      • edit
    • profile
      • add
      • list
      • remove
  • quickstart
  • wishlist
    • export
    • list
    • add
    • remove

Example Usage

To download all of your audiobooks in the aaxc format use:

audible download --all --aaxc

To download all of your audiobooks after the Date 2022-07-21 in aax format use:

audible download --start-date "2022-07-21" --aax --all

Verbosity option

There are 6 different verbosity levels:

  • debug
  • info
  • warning
  • error
  • critical

By default, the verbosity level is set to info. You can provide another level like so: audible -v <level> <subcommand> ....

If you use the download subcommand with the --all flag there will be a huge output. Best practise is to set the verbosity level to error with audible -v error download --all ...

Plugins

Plugin Folder

If the AUDIBLE_PLUGIN_DIR environment variable is set, it uses the value as location for the plugin dir. Otherwise, it will use a the plugins subdir of the app dir. Read above how Audible-cli searches the app dir.

Custom Commands

You can provide own subcommands and execute them with audible SUBCOMMAND. All plugin commands must be placed in the plugin folder. Every subcommand must have his own file. Every file have to be named cmd_{SUBCOMMAND}.py. Each subcommand file must have a function called cli as entrypoint. This function has to be decorated with @click.group(name="GROUP_NAME") or
@click.command(name="GROUP_NAME").

Relative imports in the command files doesn't work. So you have to work with absolute imports. Please take care about this. If you have any issues with absolute imports please add your plugin path to the PYTHONPATH variable or add this lines of code to the beginning of your command script:

import sys
import pathlib
sys.path.insert(0, str(pathlib.Path(__file__).parent))

Examples can be found here.

Own Plugin Packages

If you want to develop a complete plugin package for audible-cli you can do this on an easy way. You only need to register your sub-commands or subgroups to an entry-point in your setup.py that is loaded by the core package.

Example for a setup.py

from setuptools import setup

setup(
    name="yourscript",
    version="0.1",
    py_modules=["yourscript"],
    install_requires=[
        "click",
        "audible_cli"
    ],
    entry_points="""
        [audible.cli_plugins]
        cool_subcommand=yourscript.cli:cool_subcommand
        another_subcommand=yourscript.cli:another_subcommand
    """,
)

Command priority order

Commands will be added in the following order:

  1. plugin dir commands
  2. plugin packages commands
  3. build-in commands

If a command is added, all further commands with the same name will be ignored. This enables you to "replace" build-in commands very easy.

List of known add-ons for audible-cli

If you want to add information about your add-on please open a PR or a new issue!

audible-cli's People

Contributors

dependabot[bot] avatar devnoname120 avatar eode avatar iconoclasthero avatar jpretori avatar kai-tub avatar luckylittle avatar mkb79 avatar paulwoitaschek avatar purplebooth avatar snowskeleton avatar tristan avatar vwkd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

audible-cli's Issues

B004FTMV18 fails to decrypt when rebuild chapters set

ffmpeg reports "could not allocate memory", but that's a bit of a red herring as it reports that for lots of things, including misconfiguration. Without the ".new.meta" chapter information the file decrypts fine (I tested this manually using the same command).

Maybe somethng to do with the format of the file?

Podcast support

Thanks for this. Any pointers on how to download a podcast from Audible?

I can extract from the Android app the aaxc file and an $ASIN.companion file which contains a value for "acr", but am unsure how to proceed. The app logs contain a license_id and Key-Pair-Id. Can I cobble together these values to decrypt the file? :-)

Unable to download aaxc files completely

Hello,

It seems that as of yesterday, there's been some problem with downloading aaxc files. Only 919 bytes can be downloaded. This happens to both purchased titles and plus titles.

Could you please look into this problem?

Thank you very much.

P.S. I am using the latest version.

Not able to download

Hi, seems like everytime I try to re-sync my library I run into an issue. :)

I created a new venv environment and updated everything. When I run:
audible -v error download --all --aaxc --cover --cover-size 1215 --chapter --pdf --jobs 3 --bunch-size 500

I get the following output:

debug: Audible-cli version: 0.2.0
debug: App dir: /home/joey/.audible
debug: Plugin dir: /home/joey/.audible/plugins
debug: Using asyncio.run ...
debug: Config loaded from config.toml
debug: Auth file a.json for profile a loaded.
File /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/The_Zombie_Who_Visited_New_Orleans_(1215).jpg already exists. Skip download
No PDF found for The Zombie Who Visited New Orleans
File /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/The_Zombie_Who_Visited_New_Orleans-chapters.json already exists. Skip saving chapters
File /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/Whose_Ears_Are_These_A_Look_at_Animal_EarsShort_Flat_and_Floppy_(Whose_Is_It)_(1215).jpg already exists. Skip download
No PDF found for Whose Ears Are These?: A Look at Animal Ears—Short, Flat, and Floppy (Whose Is It?)
File /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/Whose_Ears_Are_These_A_Look_at_Animal_EarsShort_Flat_and_Floppy_(Whose_Is_It)-chapters.json already exists. Skip saving chapters
File /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/The_Zoo_with_the_Empty_Cage_Field_Trip_Mysteries_(1215).jpg already exists. Skip download
No PDF found for The Zoo with the Empty Cage: Field Trip Mysteries
File /mnt/12tb_1/Audible RIPs/0Audible Plus RAW/The_Zoo_with_the_Empty_Cage_Field_Trip_Mysteries-chapters.json already exists. Skip saving chapters
error: 'content_url'
error: 'content_url'
error: 'content_url'

It freezes there till I press CTRL+C then I get:

No new files downloaded.

Aborted!
sys:1: RuntimeWarning: coroutine 'download_cover' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
sys:1: RuntimeWarning: coroutine 'download_pdf' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
sys:1: RuntimeWarning: coroutine 'download_chapters' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
sys:1: RuntimeWarning: coroutine 'download_aaxc' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback

It was syncing at the start, but then seems like it stopped working. Is there a new limit set by audible or something?

Export fails when a book has no cover (i.e. empty product_images)

When a book doesn't have an image then the product_images field is set to an empty hash. In line 98 of cmd_library.py the cover_url field is set via v["500"] which doesn't exist as a key causing the export to fail.
I fixed this (in my case) by changing those lines to:
elif key == "product_images":
if '500' in v:
data_row["cover_url"] = v["500"]
else:
print('No cover URL for:', item['title'])
You can reproduce this on audible.co.uk via the following URL:
https://www.audible.co.uk/search?keywords=Earth+Unrelenting&ref=a_pd_No-Pla_t1_header_search
which (obviously) is for a book called Earth Unreleting by M. R. Forbes

Traceback is:

audible library export -t 600 -o myexport
Traceback (most recent call last):
File "/usr/local/bin/audible", line 11, in
sys.exit(main())
File "/usr/local/lib/python3.6/site-packages/audible_cli/cli.py", line 54, in main
sys.exit(cli(*args, **kwargs))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/audible_cli/cmds/cmd_library.py", line 129, in export_library
loop.run_until_complete(_export_library(session.auth, **params))
File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "/usr/local/lib/python3.6/site-packages/audible_cli/cmds/cmd_library.py", line 98, in _export_library
data_row["cover_url"] = v["500"]
KeyError: '500'

Detection of invalid downloads

I don't expect this comes up a lot, but I have quite a few (738) audible books in my library which I just downloaded using this tool (which is awesome, btw -- thank you SO MUCH for this. it is fantastic)

I had 343 books which ended up as text files with these contents:

This audio format is not supported for the title. Please download in another audio format.

I also had 15 files at the end with the contents:

No Library Record Found for user.

My guess on the first is that it may have to generate the file if it's the first time you've accessed it asking for an aax file, and the second is probably just a bug on their side which I saw by downloading so many files at once. I deleted all of those files and am trying again and it seems to be getting them -- though we'll see if I still end up with some of them afterwards.

At any rate it'd be nice if the tool could detect that it wasn't an AAX file (or even just that it's too small -- both of these types were both under 100 bytes in size) and either not keep the file or else automatically retry.

v0.2.0 and Tedy

Thanks for the release of v0.2! I'm looking forward to using those new features.
But, I'm not running it now, because VirusTotal.com says:

ALYac: Gen:Variant.Tedy.121470
Arcabit: Trojan.Tedy.D1DA7E
BitDefender: Gen:Variant.Tedy.121470
Cylance: Unsafe
Emsisoft: Gen:Variant.Tedy.121470 (B)
eScan: Gen:Variant.Tedy.121470
GData: Gen:Variant.Tedy.121470
Jiangmin: Trojan.PSW.Multi.w
MAX: Malware (ai Score=84)
Trellix (FireEye): Gen:Variant.Tedy.121470
Zillya: Backdoor.Cobalt.Win32.218

v0.1.1, by contrast, gets no flags or warnings at all.
Please virus-check all the tools you use to compile and zip up the program.

Feature request: Chapter titles

It would be great to be able to see chapter titles of downloaded books. Is there any way to get the chapter information, even as a separate file?

Thank you!

FR: library data download

Nice tool! It would be nice to be able to download a list of all books in my library, along with info about each book, like genre, whether I've completed it, etc ☺️

Testing v0.2.b1

I'm looking for testers for the current beta version. I would be very grateful for feedback for the beta!

Doesn't support accounts where two-factor is implicitly enabled

Hello,

First of all, this software is amazing; thank you so much for making such a robust and easy-to-use Audible interface!

But I wanted to report that I had some trouble logging into my account with audible-quickstart. I do not have two-factor enabled on my account, and as expected, Amazon does not require a second factor when I log in. However, Audible specifically does seem to implicitly require two-factor for every login. It always sends an SMS to my phone number and a notification to my Amazon app and I can't find anywhere to disable it since two-factor is not enabled. This would cause audible-quickstart to fail with the following trace after passing the captcha. I get the notification and SMS, but audible-quickstart fails before I can allow the login. It's a Japanese account by the way; maybe that's a special policy in that region?

Traceback (most recent call last):
  File "~/Library/Python/3.8/bin/audible-quickstart", line 8, in <modu
le>
    sys.exit(quickstart())
  File "~/Library/Python/3.8/lib/python/site-packages/click/core.py",
line 829, in __call__
    return self.main(*args, **kwargs)
  File "~/Library/Python/3.8/lib/python/site-packages/click/core.py",
line 782, in main
    rv = self.invoke(ctx)
  File "~/Library/Python/3.8/lib/python/site-packages/click/core.py",
line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "~/Library/Python/3.8/lib/python/site-packages/click/core.py",
line 610, in invoke
    return callback(*args, **kwargs)
  File "~/Library/Python/3.8/lib/python/site-packages/click/decorators
.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "~/Library/Python/3.8/lib/python/site-packages/audible_cli/cli.
py", line 48, in quickstart
    ctx.forward(cmd_quickstart.cli)
  File "~/Library/Python/3.8/lib/python/site-packages/click/core.py",
line 628, in forward
    return self.invoke(cmd, **kwargs)
  File "~/Library/Python/3.8/lib/python/site-packages/click/core.py",
line 610, in invoke
    return callback(*args, **kwargs)
    return callback(*args, **kwargs)
  File "~/Library/Python/3.8/lib/python/site-packages/click/decorators
.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "~/Library/Python/3.8/lib/python/site-packages/click/decorators
.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "~/Library/Python/3.8/lib/python/site-packages/click/core.py",
line 610, in invoke
    return callback(*args, **kwargs)
  File "~/Library/Python/3.8/lib/python/site-packages/audible_cli/cmd_
quickstart.py", line 145, in cli
    build_auth_file(
  File "~/Library/Python/3.8/lib/python/site-packages/audible_cli/util
s.py", line 62, in build_auth_file
    auth = LoginAuthenticator(
  File "~/Library/Python/3.8/lib/python/site-packages/audible/auth.py"
, line 351, in __init__
    resp = login(
  File "~/Library/Python/3.8/lib/python/site-packages/audible/login.py
", line 230, in login
    raise Exception("Unable to login")
Exception: Unable to login

I saw you do support two-factor login, so I worked around the issue by enabling explicit two-factor, running audible-quickstart and then disabling it again. So I'm fine for now, but I just wanted to report so that you are aware of the issue.

Thank you!

Misplaced parenthesis

Not really worth a pull request, but something I needed to fix locally to be able to proceed.
The closing parenthesis from line 161 should be moved before the comma in line 160, otherwise the kwarg for build_auth_file in line 161 looks like a kwarg to .get:

file_password=d.get("auth_file_password",
external_login=d.get("external_login"))

Quickstart error

Using master:

# audible-quickstart
Traceback (most recent call last):
  File "/home/elahn/.local/bin/audible-quickstart", line 8, in <module>
    sys.exit(quickstart())
  File "/usr/lib/python3/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/elahn/.local/lib/python3.6/site-packages/audible_cli/cli.py", line 47, in quickstart
    sys.exit(ctx.forward(cmd_quickstart.cli))
  File "/usr/lib/python3/dist-packages/click/core.py", line 553, in forward
    return self.invoke(cmd, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args[1:], **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
TypeError: cli() missing 1 required positional argument: 'ctx'

errors after downloading

Watching the output of : audible download --all --aax -q best -y
some files completely download, and then throw an error:
error: Error downloading /media/mike/3TB/Mike/AudioBooks/Spy_School_Goes_South_Spy_School_Series_Book_6-LC_64_22050_stereo.aax. Wrong content type. Expected type(s): ['audio/aax', 'audio/vnd.audible.aax']; Got: audio/audible; Message: Unknown

Problem with downloading covers

Hello, it seems that something prevents the download auf audiobook covers. Regardless, whether I specify the desired cover-size or not, the command faces with the simple statement
Error in job:

To be sure, I tested it with three different audiobooks identified by their asin, one for which I was able to download the cover some weeks ago.
Would it be possible that audible changed their API or might there have been a bug introduced in a recent update of the audible package for python?

Cannot paste the login URL on macOS

I'm trying to login using an external browser. The quickstart output notes:

IMPORTANT:
If you are using MacOS and have trouble insert the login result url, simply import the readline module in your script.

This is indeed the case. I can paste the URL, but it is not accepted after pressing Enter. I tried patching /usr/local/bin/audible with the extra import and the URL got accepted.

-v and --verbosity commands aren't recognized

FYI: You can use audible -v error to reduce the output to errors. This would help next time.

$ audible download -a B0189JVZ1G -aaxc --cover --cover-size 1215 --chapter -v error
Usage: audible download [OPTIONS]
Try 'audible download -h' for help.

Error: No such option: -v

$ audible download -a B0189JVZ1G -aaxc --cover --cover-size 1215 --chapter --pdf --verbosity ERROR
Usage: audible download [OPTIONS]
Try 'audible download -h' for help.

Error: No such option: --verbosity (Possible options: --cover-size, --overwrite)

Where do I get the authfile (needed while adding a profile)?

Maybe I'm being dense, but I can't seem to find the answer anywhere online.

I'm trying to add a second profile to audible-cli. The third question it asks me is Please enter name for the auth file: To this, I do not know how to respond.

I obviously got it right the first time I added a profile, since there in ~/.audible sits my first profile's .json file.

How do I get the authfile for the second profile?

Unable to login

Hello, i found this Repo and find it really great, but can't login.
As you can see in the log i use Python3.7 on Debian10. 64bit PC
please help, i like the programm...

Welcome to the audible 0.5.4 quickstart utility.
================================================

Quickstart will guide you through the process of build a basic 
config, create a first profile and assign an auth file to the profile now.

The profile created by quickstart will set as primary. It will be used, if no 
other profile is chosen.

An auth file can be shared between multiple profiles. Simply enter the name of 
an existing auth file when asked about it. Auth files have to be stored in the 
config dir. If the auth file doesn't exists, it will be created. In this case, 
an authentication to the audible server is necessary to register a new device.

Selected dir to proceed with:
/home/markus/.audible

Please enter values for the following settings (just press Enter to accept a default value, if one is given in brackets).

Please enter a name for your primary profile [audible]: 

Enter a country code for the profile: de

Please enter a name for the auth file [audible.json]: 

Do you want to encrypt the auth file? [y/N]: n

Please enter your amazon username: ********@yahoo.de
Please enter your amazon password: 
Repeat for confirmation: 

+--------------------+----------------------------+
| Option             | Value                      |
+--------------------+----------------------------+
| profile_name       | audible                    |
| auth_file          | audible.json               |
| country_code       | de                         |
| auth_file_password | -                          |
| audible_username   | ********@yahoo.de |
| audible_password   | ***                        |
+--------------------+----------------------------+
Do you want to continue? [y/N]: y

Login with amazon to your audible account now.
Captcha found
Open Captcha with default image viewer [Y/n]: n
Please open the following url with a webbrowser to get the captcha:
https://opfcaptcha-prod.s3.amazonaws.com/799c8982e5134f9c84d65c15aba1ccca.gif?
Answer for CAPTCHA: tTqzCx
Captcha found
Open Captcha with default image viewer [Y/n]: n
Please open the following url with a webbrowser to get the captcha:
https://opfcaptcha-prod.s3.amazonaws.com/e721e3a403a8418b99af415042718dc9.gif?
Answer for CAPTCHA: smzwtD
Traceback (most recent call last):
  File "/usr/local/bin/audible-quickstart", line 11, in <module>
    load_entry_point('audible-cli==0.0.dev15', 'console_scripts', 'audible-quickstart')()
  File "/home/markus/.local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/markus/.local/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/markus/.local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/markus/.local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/markus/.local/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/markus/.local/lib/python3.7/site-packages/audible_cli/cli.py", line 47, in quickstart
    sys.exit(ctx.forward(cmd_quickstart.cli))
  File "/home/markus/.local/lib/python3.7/site-packages/click/core.py", line 628, in forward
    return self.invoke(cmd, **kwargs)
  File "/home/markus/.local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/markus/.local/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/markus/.local/lib/python3.7/site-packages/click/decorators.py", line 73, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/home/markus/.local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/markus/.local/lib/python3.7/site-packages/audible_cli/cmds/cmd_quickstart.py", line 153, in cli
    file_password=d.get("auth_file_password")
  File "/home/markus/.local/lib/python3.7/site-packages/audible_cli/utils.py", line 65, in build_auth_file
    otp_callback=prompt_otp_callback)
  File "/home/markus/.local/lib/python3.7/site-packages/audible/auth.py", line 365, in from_login
    approval_callback=approval_callback)
  File "/home/markus/.local/lib/python3.7/site-packages/audible/auth.py", line 594, in re_login
    approval_callback=approval_callback)
  File "/home/markus/.local/lib/python3.7/site-packages/audible/login.py", line 393, in login
    raise Exception("Unable to login")
Exception: Unable to login

Greetz Markus

Failure to download audiobooks included with Audible subscription

Some books are available for free with an Audible subscription or an Amazon Prime subscription.
These books aren't marked in any special way on the Android app, but say "Included" when viewing your library using the Windows app. They give an error message like this:

$ audible download -a B0189JVZ1G -aaxc --cover --cover-size 1215 --chapter -q normal --pdf
error: Asin axc not found in library.
error: Skip asin axc: Not found in library
Chapter file saved to /home/brek/.audible/Unbound_How_Eight_Technologies_Made_Us_Human_Transformed_Society_and_Brought_Our_World_to_the_Brink-chapters.json.
File /home/brek/.audible/Unbound_How_Eight_Technologies_Made_Us_Human_Transformed_Society_and_Brought_Our_World_to_the_Brink_(1215).jpg downloaded to /home/brek/.audible in 0:00:00.247749.
File /home/brek/.audible/Unbound_How_Eight_Technologies_Made_Us_Human_Transformed_Society_and_Brought_Our_World_to_the_Brink.pdf downloaded to /home/brek/.audible in 0:00:03.707639.
The download ended with the following result:
New chapter files: 1
New cover files: 1
New pdf files: 1

It retrieves the cover, chapter info, and the PDF, but not the aaxc. I get the same results using -aax instead of -aaxc.

Some audiobooks are, for some reason, only available temporarily. On the Android audible app, these have an orange notice under them saying something like "Available until 5/18". If I recall, there's no indication using the Windows app when one of your files is for some reason going to be removed at a future date. These give an error like this:

File /home/brek/.audible/Against_Interpretation_and_Other_Essays_(1215).jpg already exists. Skip download
No PDF found for Against Interpretation and Other Essays
File /home/brek/.audible/Against_Interpretation_and_Other_Essays-chapters.json already exists. Skip saving chapters
AAX_44_64 codec was not found, using AAX_22_64 instead
error: 'content_url'
No new files downloaded.

The Audible server obviously handles these files differently, and it would probably be a lot of work to retrieve them. It isn't hugely important to me for audible-cli to download them. But the documentation should probably mention that it won't, in case someone wants to use it specifically to download such files.

audible library list gives me an error

note i tested this in a fresh kubuntu install vm and it still had the error

Operating System: Kubuntu 21.04
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.80.0
Qt Version: 5.15.2
Kernel Version: 5.11.0-36-generic
OS Type: 64-bit
Graphics Platform: X11
Processors: 2 × Intel® Celeron® G4900 CPU @ 3.10GHz
Memory: 7.6 GiB of RAM
Graphics Processor: Mesa Intel® UHD Graphics 610

Python 3.9.5

pip list:

Package Version


aiofiles 0.7.0
alabaster 0.7.8
anyascii 0.3.0
anyio 3.3.3
apparmor 3.0.0
appdirs 1.4.4
appimage-builder 0.9.2
apt-xapian-index 0.49
audible 0.5.5
audible-cli 0.0.1
audioread 2.1.9
Babel 2.8.0
bashsmash 1.2
bcrypt 3.1.7
beautifulsoup4 4.9.3
blinker 1.4
Brotli 1.0.9
catfish 4.16.0
certifi 2020.6.20
cffi 1.14.6
chardet 4.0.0
Charon 1.0
chrome-gnome-shell 0.0.0
cliapp 1.20180812.1
click 7.1.2
click-plugins 1.1.1
cmdtest 0.32+git
colorama 0.4.4
command-not-found 0.3
commonmark 0.9.1
contextlib2 21.6.0
coqpit 0.0.14
cryptography 3.3.2
cupshelpers 1.0
cwiid 0.6.91
cycler 0.10.0
Cython 0.29.24
daiquiri 3.0.0
dblatex 0.3.12
dbus-python 1.2.16
decorator 4.4.2
defer 1.0.6
Deprecated 1.2.12
devscripts 2.21.1ubuntu1
dill 0.3.4
distro 1.5.0
distro-info 1.0
dnspython 1.16.0
docker 5.0.2
docopt 0.6.2
docutils 0.16
ecdsa 0.16.1
emrichen 0.2.3
feedparser 5.2.1
filelock 3.0.12
Flask 2.0.1
fsspec 2021.8.1
future 0.18.2
galternatives 1.0.8
gattlib 0.20201113
gdown 3.13.1
getdevinfo 1.1.1
git-pull-request 6.0.1
gitsome 0.8.0
gpg 1.14.0-unknown
gruut 1.2.3
gruut-ipa 0.9.3
gruut-lang-cs 1.2
gruut-lang-de 1.2
gruut-lang-es 1.2
gruut-lang-fr 1.2.1
gruut-lang-it 1.2
gruut-lang-nl 1.2
gruut-lang-pt 1.2
gruut-lang-ru 1.2
gruut-lang-sv 1.2
gssapi 1.6.1
gyp 0.1
h11 0.12.0
halo 0.0.31
html5lib 1.1
httpcore 0.13.7
httplib2 0.18.1
httpx 0.18.2
idna 2.10
ifaddr 0.1.7
imagesize 1.2.0
inflect 5.3.0
itsdangerous 2.0.1
jeepney 0.6.0
jieba 0.42.1
Jinja2 3.0.1
joblib 1.0.1
jsonlines 1.2.0
jsonpath-rw 1.4.0
keyring 22.2.0
kiwisolver 1.3.2
language-selector 0.1
launchpadlib 1.10.13
lazr.restfulclient 0.14.2
lazr.uri 1.0.5
LibAppArmor 3.0.0
librosa 0.8.0
libvirt-python 7.0.0
llvmlite 0.36.0
log-symbols 0.0.14
lxml 4.6.3
lz4 3.1.3+dfsg
macaroonbakery 1.3.1
Mako 1.1.3
Markdown 3.3.4
MarkupSafe 2.0.1
matplotlib 3.4.3
mecab-python3 1.0.3
mercurial 5.6.1
mysqlclient 1.4.4
netifaces 0.10.9
networkx 2.4
notify2 0.3
num2words 0.5.10
numba 0.53.0
numpy 1.19.5
numpy-stl 2.8.0
numpydoc 1.1.0
oauthlib 3.1.0
olefile 0.46
packaging 20.9
pandas 1.3.3
paramiko 2.7.2
pbkdf2 1.3
pexpect 4.8.0
Pillow 8.1.2
pip 20.3.4
playitslowly 1.5.0
ply 3.11
pooch 1.5.1
prompt-toolkit 3.0.14
protobuf 3.12.4
psutil 5.8.0
py-cpuinfo 5.0.0
py3dns 3.2.1
pyaes 1.6.1
pyaml 21.8.3
pyasn1 0.4.8
PyBluez 0.23
pycairo 1.16.2
pycparser 2.20
pycryptodome 3.10.1
pycryptodomex 3.9.7
pycups 2.0.1
PyGithub 1.55
Pygments 2.7.1
PyGObject 3.38.0
pyinotify 0.9.6
PyJWT 2.1.0
pykerberos 1.1.14
pymacaroons 0.13.0
PyNaCl 1.4.0
pynndescent 0.5.4
PyOpenGL 3.1.5
pyOpenSSL 20.0.1
pyparsing 2.4.7
PyPDF2 1.26.0
pyperclip 1.8.2
pypinyin 0.42.0
PyQt-Qwt 1.2.2
PyQt5 5.15.4
PyQt5-sip 12.8.1
pyqtgraph 0.12.1
pyRFC3339 1.1
pysbd 0.3.4
pyserial 3.5b0
PySide2 5.15.2
PySocks 1.7.1
python-apt 2.1.7+ubuntu2
python-crfsuite 0.9.7
python-dateutil 2.8.1
python-debian 0.1.39
python-json-logger 2.0.1
python-lzo 1.12
python-magic 0.4.20
python-utils 2.2.0
pytube 11.0.1
pytz 2021.1
pyworld 0.3.0
pyxattr 0.7.2
pyxdg 0.27
PyYAML 5.3.1
pyzmq 22.3.0
qrcode 6.1
questionary 1.10.0
rapidfuzz 1.4.1
rencode 1.0.6
reportlab 3.5.66
requests 2.25.1
requests-cache 0.5.2
resampy 0.2.2
rfc3986 1.5.0
rich 10.2.2
roam 0.3.1
roman 2.0.0
rsa 4.7.2
ruamel.yaml 0.17.16
ruamel.yaml.clib 0.2.6
schema 0.7.4
scikit-learn 0.24.2
scipy 1.7.1
scour 0.38.2
SecretStorage 3.3.1
selenium 3.141.0
setproctitle 1.2.1
setuptools 52.0.0
Shapely 1.7.1
shiboken2 5.15.2
simplejson 3.17.2
six 1.15.0
sniffio 1.2.0
snowballstemmer 2.1.0
soundconverter 4.0.0
SoundFile 0.10.3.post1
soupsieve 2.2
Sphinx 3.5.4
spinners 0.0.24
spotdl 3.8.0
spotipy 2.19.0
style 1.1.0
systemd-python 234
tabulate 0.8.9
tensorboardX 2.4
termcolor 1.1.0
threadpoolctl 2.2.0
thrift 0.13.0
toml 0.10.2
torbrowser-launcher 0.3.3
torchaudio 0.9.0
torchfile 0.1.0
torchvision 0.10.0+cpu
tornado 6.1
tqdm 4.62.2
TTS 0.3.1
ttystatus 0.38
typing-extensions 3.10.0.0
ubuntu-advantage-tools 27.2
ubuntu-drivers-common 0.0.0
ufw 0.36
umap-learn 0.5.1
unattended-upgrades 0.1
Unidecode 1.3.2
unidic-lite 1.0.8
unidiff 0.5.5
update 0.0.1
uritools 3.0.0
urllib3 1.26.2
wadllib 1.3.5
wcwidth 0.1.9
webencodings 0.5.1
websocket-client 1.2.1
websockets 10.0
Werkzeug 2.0.1
wheel 0.34.2
wrapt 1.12.1
wxPython 4.0.7
xdg 5
xkit 0.0.0
xonsh 0.9.25
xpra 3.0.13
youtube-dl 2021.4.7
yt-dlp 2021.9.2
ytmusicapi 0.17.2
zeroconf 0.26.1

Traceback (most recent call last):
File "/home/lnee/.local/lib/python3.9/site-packages/httpx/_transports/default.py", line 61, in map_httpcore_exceptions
yield
File "/home/lnee/.local/lib/python3.9/site-packages/httpx/_transports/default.py", line 283, in handle_async_request
) = await self._pool.handle_async_request(
File "/home/lnee/.local/lib/python3.9/site-packages/httpcore/_async/connection_pool.py", line 234, in handle_async_request
response = await connection.handle_async_request(
File "/home/lnee/.local/lib/python3.9/site-packages/httpcore/_async/connection.py", line 148, in handle_async_request
return await self.connection.handle_async_request(
File "/home/lnee/.local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 128, in handle_async_request
) = await self._receive_response(timeout)
File "/home/lnee/.local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 189, in _receive_response
event = await self._receive_event(timeout)
File "/home/lnee/.local/lib/python3.9/site-packages/httpcore/_async/http11.py", line 225, in _receive_event
data = await self.socket.read(self.READ_NUM_BYTES, timeout)
File "/home/lnee/.local/lib/python3.9/site-packages/httpcore/_backends/anyio.py", line 63, in read
raise ReadTimeout from None
httpcore.ReadTimeout

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/lnee/.local/lib/python3.9/site-packages/audible/client.py", line 251, in _request
resp = await self.session.request(method, url, **kwargs)
File "/home/lnee/.local/lib/python3.9/site-packages/httpx/_client.py", line 1481, in request
response = await self.send(
File "/home/lnee/.local/lib/python3.9/site-packages/httpx/_client.py", line 1568, in send
response = await self._send_handling_auth(
File "/home/lnee/.local/lib/python3.9/site-packages/httpx/_client.py", line 1604, in _send_handling_auth
response = await self._send_handling_redirects(
File "/home/lnee/.local/lib/python3.9/site-packages/httpx/_client.py", line 1640, in _send_handling_redirects
response = await self._send_single_request(request, timeout)
File "/home/lnee/.local/lib/python3.9/site-packages/httpx/_client.py", line 1681, in _send_single_request
) = await transport.handle_async_request(
File "/home/lnee/.local/lib/python3.9/site-packages/httpx/_transports/default.py", line 278, in handle_async_request
(
File "/usr/lib/python3.9/contextlib.py", line 135, in exit
self.gen.throw(type, value, traceback)
File "/home/lnee/.local/lib/python3.9/site-packages/httpx/_transports/default.py", line 78, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ReadTimeout

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/lnee/.local/bin/audible", line 8, in
sys.exit(main())
File "/home/lnee/.local/lib/python3.9/site-packages/audible_cli/cli.py", line 54, in main
sys.exit(cli(*args, **kwargs))
File "/usr/lib/python3/dist-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/decorators.py", line 73, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/lnee/.local/lib/python3.9/site-packages/audible_cli/cmds/cmd_library.py", line 148, in list_library
loop.run_until_complete(_list_library(session.auth, **params))
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/lnee/.local/lib/python3.9/site-packages/audible_cli/cmds/cmd_library.py", line 39, in _list_library
library = await _get_library(auth, **params)
File "/home/lnee/.local/lib/python3.9/site-packages/audible_cli/cmds/cmd_library.py", line 21, in _get_library
library = await Library.aget_from_api(
File "/home/lnee/.local/lib/python3.9/site-packages/audible_cli/models.py", line 377, in aget_from_api
resp = await api_client.get(
File "/home/lnee/.local/lib/python3.9/site-packages/audible/client.py", line 270, in _request
raise NotResponding
audible.exceptions.NotResponding: API request timed out, please be patient.

Max Queries

I think Audible may have just put in a max amount of queries.

In my library that is close to 1500 books, just running a "audible download --all --aaxc --cover --cover-size 1215 --chapter --pdf --jobs 3" eventually turns into the following error "Error in job: Forbidden (403): Customer [XXXXXXXXXXXX] is above threshold for content license grant count". (Even if I already have most of the books its querying it seems like it counts them)

If you wanted to know the max amount of books it can do before starting that I think I would need an option to show what book # you are at in the library.

Following that would it be possible to create an option to "Wait after X amount of books for X minutes"?

Thanks so much for this tool.

pyinstall isn't valid python3

The instructions for compiling audible-cli rely on pyinstall.
pyinstall isn't an executable, so I assume they should say

pyinstall.py audible.spec

But pyinstall doesn't work with python 3.
It gives errors like

$ pyinstall.py audible.spec
  File "/usr/local/bin/pyinstall.py", line 242
    print 'Running in environment %s' % options.venv
          ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Running in environment %s' % options.venv)?

and

$ pyinstall.py audible.spec
  File "/usr/local/bin/pyinstall.py", line 314
    except InstallationError, e:
                            ^
SyntaxError: invalid syntax

The README.md says this requires Python 3.6, so I must be doing something wrong; but all I did was follow the instructions.
I suppose my python somehow has multiple versions of pyinstall installed,
particularly as I see this:

$ pip install pyinstall
Requirement already satisfied: pyinstall in /usr/local/lib/python3.8/site-packages (0.1.4)

$ python --version
Python 3.9.10

I'm very new to python, and don't know how to get my pip working with my python.

UPDATE: The version of pyinstall.py in my python3.8 is in fact v0.1.4, the latest version, and isn't valid python3 code.

UPDATE: I was able to use pyinstaller rather than python. Apparently pyinstaller is a replacement for pyinstall. But in my Cygwin Python3.8, it choked on the python module pywin32, which it couldn't find anywhere to install.
Then I used the Python 3.9 installed by IDLE, which was able to find pywin32 and run pyinstaller.
I am now mysteriously able to use audible-cli from the command line in cygwin, even though I didn't install it in cygwin's Python.

Export Library fails due to httpx timeout

library export fails with large libraries or slow transfers due to use of default httpx request timeout (5 seconds).

A fix is required in the underlying library audible-cli uses and possibly a change to audible-cli as well.

See mkb79/Audible#36 for details

aax files download, somewhere (not in the download directory), but can't be assembled

I can't download aax files at all. audible-cli doesn't recognize them as aax files.
It looks like they're just tagged differently internally, as type 'audio/audible'.

$ audible download --all --aax  --cover --cover-size 1215 -j 1 --pdf
...
The_Problems_of_Philosophy-LC_64_22050_stereo.aax:  98%|█████████▊| 60.6M/62.1M
The_Problems_of_Philosophy-LC_64_22050_stereo.aax:  98%|█████████▊| 61.1M/62.1M
The_Problems_of_Philosophy-LC_64_22050_stereo.aax:  99%|█████████▉| 61.7M/62.1M
The_Problems_of_Philosophy-LC_64_22050_stereo.aax: 100%|██████████| 62.1M/62.1M [00:11<00:00, 5.47MB/s]
error: Error downloading /cygdrive/e/data/audio_/Audible/audible-cli/The_Problems_of_Philosophy-LC_64_22050_stereo.aax. Wrong content type. Expected type(s): ['audio/aax', 'audio/vnd.audible.aax']; Got: audio/audible; Message: Unknown

It looks like all the parts downloaded somewhere, but I don't see where. No .aax files appear in the download directory.

Problem with downloading aaxc files

Hi,

Thank you very much for developing this great tool! I was wondering if you could please advise me on a problem I encountered with downloading Audible Plus aaxc files.

When I used the command below, it always gave me an error message.


Error in job: Unterminated string starting at: line 1 column 386 (char 385)

And If I don't use the aaxc option, I would end up with an aax file less than 1 KB.


100%|█| 33.0/33.0 [00:00<00:00

Did I do something wrong here? :P Would be very grateful if you could please help me with this problem. Thank you. :)

downloads of books with the same title skip/overwrite

Describe the bug:

If your library contains 2 or more titles with the same name (eg the same books with a different ASIN/narrator), downloads of aaxc,json,jpg will skip due to existing files. voucher file will get overwritten.

I believe a potential workaround is already proposed in this PR:

#23

i.e. we would use the following new option to prefix titles with their asin:

--filename-mode asin_ascii

It would be nice to have an option to try and migrate existing downloads between filename modes (eg from "ascii" to "asin_ascii") so you don't have to pull the entire library again, but that is probably asking for too much cream on the cake :). The most important thing is to be able to consistently update your library using something like "audible download --all --filename-mode asin_ascii"

To Reproduce:

Use two books with the same title and different ASIN, eg:

audible download --asin 0008433844 --aaxc --cover --cover-size 1215 --chapter
audible download --asin B0030EJV3U --aaxc --cover --cover-size 1215 --chapter

Paths in cmd_remove-encryption.py need to be str'ed

As the title says, the various file objects need to be str'ed before used in cmd lists. On windows it breaks.

Gives the following error if you don't:

File "c:\python37\lib\subprocess.py", line 395, in check_output
**kwargs).stdout
File "c:\python37\lib\subprocess.py", line 472, in run
with Popen(*popenargs, **kwargs) as process:
File "c:\python37\lib\subprocess.py", line 775, in init
restore_signals, start_new_session)
File "c:\python37\lib\subprocess.py", line 1119, in _execute_child
args = list2cmdline(args)
File "c:\python37\lib\subprocess.py", line 530, in list2cmdline
needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'WindowsPath' is not iterable

Feature request: Option to exclude chapter data

Hello,

Thank you so much for this great program. I've been using it since late 2020 and it just gets better and better!

There is one feature though that I really wish you could consider incorporating into your project. It's the option of excluding chapter data from the voucher file.

Since we can already obtain this information through the chapter command, I would be very grateful if we could possibly choose whether to include it in the voucher or not.

I really miss the old days when the voucher files were tiny in size and the key & iv appeared in the first two lines. It really was a lot easier to locate the values we needed back then.

Thank you.

Max of 1000 library 'results'

Describe the bug
I have a library of 1357 books. It seems to cut off at 1000 books, missing the last 357. It seems to do the 1000 "newest added" books. I am using this mixed with the audible-cli git. I realize I have an abnormally large library, but more the reason I'd like to backup my purchases.

To Reproduce
In terminal, either:
audible download all [...]
OR
audible library export

Expected behavior
Would like to request for support of greater than 1000 books

Desktop (please complete the following information):

  • Linuxmint

Thanks in advanced - really happy with this tool otherwise!

Support for Spain 'es'

Is going to be available for the Spanish region anytime soon?

Enter a country code for the profile: es
Error: 'es' is not one of 'us', 'ca', 'uk', 'au', 'fr', 'de', 'jp', 'it', 'in'.

Add export for goodreads csv

Thank you for implementing the api and cli clients - they were a joy to use, which is impressive given the lack of public-facing documentation!

The main use case that I have is to keep my audible library in sync with goodreads. I threw together a minimal script to get the job done last night (https://github.com/donoftime/audible-goodreads), but I think that could be made generally useful as well. Given there is a dedicated support page for the lack of integration, I imagine it is something others would like to see as well: https://help.goodreads.com/s/article/Can-I-link-my-Goodreads-and-Audible-accounts

If I get a chance, I'll circle back and make it a plugin like the other examples in the readme. But I thought I would bring it up here in case someone else gets to it before me!

External browser option for username?

I can successfully login using the external browser option with email. I did not see an option for how to do this with the old pre-amazon usernames. Is that possible?

‘Error: no such option: -B’ when downloading with -t flag

MacOS 12.3, M1 (ARM)

audible download -y -a <ASIN> --aax Works fine, and downloads at well over 5MB/s with no issue.

Changing to ‘-a Relentless’ yields

The_Relentless_Moon_Lady_Astronaut_Book_3-LC_64_44100_stereo.aax:   0%|▏                                       | 1.83M/490M [00:04<24:46, 344kB/s]Usage: audible [OPTIONS] COMMAND [ARGS]...
Try 'audible -h' for help.

Error: No such option: -B
The_Relentless_Moon_Lady_Astronaut_Book_3-LC_64_44100_stereo.aax:  11%|████▎                                   | 53.5M/490M [02:46<50:03, 152kB/s]```

And then the download fails to complete (after struggling for a bit very very slowly)

[Feature] Make 'Accept' default action

When downloading an audiobook, and -y is not added as a parameter, the user is asked to confirm. I suggest switching from [y/N] to [Y/n]. This removes the necessity to add an additional y, because i assume that the tool finds the proper books more often than it produces errors which need to be aborted. This is a personal preference, but i think it could be better this way.

Getting started instructions are unclear

I'm at a loss. I must be missing something fundamental. Cannot get this to work at all. Steps I took on Windows 10:

installed python 3.9

installed pip and wheel

open cmd window

C:\Dev\New folder>git clone https://github.com/mkb79/audible-cli.git
Cloning into 'audible-cli'...

...

C:\Dev\New folder>cd audible-cli

C:\Dev\New folder\audible-cli>pip install .
Processing c:\dev\new folder\audible-cli
  DEPRECATION: A future pip version will change local packages to be built in-place without first
copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test
your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at
https://github.com/pypa/pip/issues/7555.

...

C:\Dev\New folder\audible-cli>audible-quickstart
'audible-quickstart' is not recognized as an internal or external command,
operable program or batch file.

C:\Dev\New folder\audible-cli>python audible-quickstart
python: can't open file 'C:\Dev\New folder\audible-cli\audible-quickstart': [Errno 2] No such file or directory

C:\Dev\New folder\audible-cli>python -c audible-quickstart
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'audible' is not defined

C:\Dev\New folder\audible-cli>audible -h
'audible' is not recognized as an internal or external command,
operable program or batch file.

C:\Dev\New folder\audible-cli>python
Python 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.

>>> audible-quickstart
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'audible' is not defined

>>> help
Type help() for interactive help, or help(object) for help about object.

>>> audible -h
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'audible' is not defined

>>> audible quickstart
  File "<stdin>", line 1
    audible quickstart
            ^
SyntaxError: invalid syntax

>>> -c audible quickstart
  File "<stdin>", line 1
    -c audible quickstart
       ^
SyntaxError: invalid syntax

>>> audible audible-quickstart
  File "<stdin>", line 1
    audible audible-quickstart
            ^
SyntaxError: invalid syntax

>>>

Plugin Import from Plugin directory

It would be nice to be able to have plugins be able to import things that exist in the plugin directory.

I've been looking at how to modify plugin.py to do this. Looking at importlib I think there is probably a way to do it (seriously why is the api so busy if it doesn't allow for doing this?).

As a stopgap I'm using sys.path.append(str(pdir)) just before the loop.

Titles saved with "empty" filenames when using JP marketplace

Describe the bug
When downloading from the JP marketplace, only ascii characters in the title of the book are used in the filename.
For example, this results in a title named "ぼぎわんが、来る"
to be empty, named only as "-AAX_22_64.aaxc"
This makes it difficult to use the --all option, as all the files are named the same.

audible library list however, displays the book titles properly.

To Reproduce
audible download --all
or
audible download -a ASIN

v1.0 prefixes "C:" to AUDIBLE_CONFIG_DIR

My audible-cli config directory is on drive E, because needs over 100G of space.
But I can't get the new release (from audible_win_dir.xip) to look for its config directory there, because it prepends 'C:' to the path, probably because it's a cygwin path and so doesn't look like a Windows path.
This was not a problem with the previous version.
(Although I don't know which release of audible-cli it's using, a precompiled one or one I compiled, because the config process was complicated, I don't know which Python installation cygwin is using, and I didn't keep good notes.)

$ printenv|grep AUDI
AUDIBLE_CONFIG_DIR=/cygdrive/e/data/audio_/Audible/audible-cli

# This calls the new binary executable file from audible_win_dir
$ audible library list
error: Config file C:\cygdrive\e\data\audio_\Audible\audible-cli\config.toml not found

# This calls the previous executable in /usr/local/bin, which was a script, not a binary
$ audible0 library list
[ correctly outputs a list of audiobooks ]

Creating a .voucher file

Hello. I am having a little trouble finding an example of how to create the voucher file.

I have a voucher.json file with the key and iv params, but it seems to decode I need a properly formatted .voucher file with content_license param etc.

Would you be able to point me in the right direction with this?

For automation purposes, write authentication token to stdout and informational messages to stderr

I would like to automate audible-cli, specifically getting the activation bytes with audible activation-bytes.

Running this in a script after initial quickstart prints the following:

$ audible activation-bytes
Activation bytes not found in auth file. Fetching online.
abcdefgh

I'm interested in the abcdefgh part, but that is not easily assignable to a shell variable because Activation bytes not found in auth file. Fetching online. clutters stdout:

bytes=$(audible activation-bytes)

# bytes contains the token and the extra output!

The preferred way of solving this would be to use stderr for informational messages and stdout for the results, so I can use the CLI call like this:

bytes=$(audible activation-bytes 2>/dev/null)

# bytes contains only the token

It would be great if this could be added!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.