All Projects → mkb79 → audible-cli

mkb79 / audible-cli

Licence: AGPL-3.0 license
A command line interface for audible package. With the cli you can download your Audible books, cover, chapter files.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to audible-cli

FeedCrawler
FeedCrawler automatisiert bequem das Hinzufügen von Links für den JDownloader.
Stars: ✭ 63 (-55.63%)
Mutual labels:  download
front-matter
The most featured front matter (yaml, json, neon, toml) parser and dumper for PHP.
Stars: ✭ 23 (-83.8%)
Mutual labels:  toml
acd
ACD helps you download Adobe Connect Sessions Videos and Audios, download files from FTP server, transfer files using Shift I/O
Stars: ✭ 117 (-17.61%)
Mutual labels:  download
htoml
TOML file format parser in Haskell
Stars: ✭ 39 (-72.54%)
Mutual labels:  toml
transfer
Converts from one encoding to another. Supported formats HCL ⇄ JSON ⇄ YAML⇄TOML⇄XML⇄plist⇄pickle⇄properties ...
Stars: ✭ 70 (-50.7%)
Mutual labels:  toml
tomlcpp
No fanfare TOML C++ Library
Stars: ✭ 21 (-85.21%)
Mutual labels:  toml
photo-magician
🎨 provide some common image process apis with canvas
Stars: ✭ 12 (-91.55%)
Mutual labels:  cover
terraform-external-module-artifact
Terraform module to fetch any kind of artifacts using curl (binary and text okay)
Stars: ✭ 13 (-90.85%)
Mutual labels:  download
Tomlet
Zero-Dependency, model-based TOML De/Serializer for .NET
Stars: ✭ 56 (-60.56%)
Mutual labels:  toml
iCloud-Photo-Downloader
iCloud Photo Downloader - Fetch Originals from iCloud Photo Library
Stars: ✭ 17 (-88.03%)
Mutual labels:  download
contentful-export
Extract Contentful to Hugo
Stars: ✭ 22 (-84.51%)
Mutual labels:  toml
pexels downloader
Download images from pexels.com
Stars: ✭ 58 (-59.15%)
Mutual labels:  download
spotify-downloader-music-player
Download youtube songs in mp3 format and plays them
Stars: ✭ 31 (-78.17%)
Mutual labels:  download
Grabber
A wrapper for Youtube-dl for Windows.
Stars: ✭ 22 (-84.51%)
Mutual labels:  download
sharannyobasu
Sharannyo Basu's profile
Stars: ✭ 13 (-90.85%)
Mutual labels:  profiles
ImageDownloader
A program for downloading and filtering images based on their resolution.
Stars: ✭ 60 (-57.75%)
Mutual labels:  download
UCAS-Helper
国科大(UCAS, ucas)校园网登录、课程资源下载、自动评教和分数查询助手
Stars: ✭ 105 (-26.06%)
Mutual labels:  download
DownloadX
Download tool based on kotlin and coroutine.
Stars: ✭ 111 (-21.83%)
Mutual labels:  download
MODIS
Download and processing framework for MODIS imagery. The package provides automated access to the global online data archives LP DAAC, LAADS and NSIDC as well as processing capabilities such as file conversion, mosaicking, subsetting and time series.
Stars: ✭ 48 (-66.2%)
Mutual labels:  download
ee.Yrewind
Can rewind and save YouTube live stream
Stars: ✭ 133 (-6.34%)
Mutual labels:  download

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 .

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.

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.

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

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!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].