|
10 months ago | |
---|---|---|
.gitignore | 2 years ago | |
AAXtoMP3 | 10 months ago | |
LICENSE | 7 years ago | |
README.md | 1 year ago | |
_config.yml | 5 years ago | |
interactiveAAXtoMP3 | 2 years ago |
The purpose of this software is to convert AAX (or AAXC) files to common MP3, M4A, M4B, flac and ogg formats through a basic bash script frontend to FFMPEG.
Audible uses the AAX file format to maintain DRM restrictions on their audio books and if you download your book through your library it will be stored in this format.
The purpose of this software is not to circumvent the DRM restrictions for audio books that you do not own in that you do not have them on your personal Audible account. The purpose of this software is to create a method for you to download and store your books just in case Audible fails for some reason.
.aaxc
)--use-audible-cli-data
is set or if converting an .aaxc filebash AAXtoMP3 [-f|--flac] [-o|--opus] [-a|--aac] [-s|--single] [--level <COMPRESSIONLEVEL>] [-c|--chaptered] [-e:mp3] [-e:m4a] [-e:m4b] [-A|--authcode <AUTHCODE>] [-n|--no-clobber] [-t|--target_dir <PATH>] [-C|--complete_dir <PATH>] [-V|--validate] [--use-audible-cli-data]] [-d|--debug] [-h|--help] [--continue <CHAPTERNUMBER>] <AAX/AAXC INPUT_FILES>...
or if you want to get guided through the options
bash interactiveAAXtoMP3 [-a|--advanced] [-h|--help]
--chaptered
will only work if it follows the --aac -e:m4a -e:m4b --flac
options.--keep-author
.aaxc
format.audible library export -o ./library.tsv
). Only available if --use-audible-cli-data
is set. This file is required to parse additional metadata such as $series
or $series_sequence
.Your Audible auth code (it won't correctly decode otherwise) (not required to decode the aaxc
format).
You will need your authentication code that comes from Audible's servers. This will be used by ffmpeg to perform the initial audio convert. You can obtain this string from a tool like audible-activator or like audible-cli.
In order of precidence.
aax
files. The code must also match the encoding for the user that owns the AAX file(s). If the authcode does not match the AAX file no transcoding will occur.The following flags can modify the default naming scheme:
Each flag takes a string as argument. If the string contains a variable defined in the script (eg. artist, title, chapter, narrator...), the corresponding value is used. The default options correspond to the following flags:
--dir-naming-scheme '$genre/$artist/$title'
--file-naming-scheme '$title'
--chapter-naming-scheme '$title-$(printf %0${#chaptercount}d $chapternum) $chapter'
Additional notes:
$(printf %0${#chaptercount}d $chapternum)
, used to pad with zeros the chapter number), the commands are executed.
So you can use --dir-naming-scheme '$(date +%Y)/$artist'
, but using --file-naming-scheme '$(rm -rf /)'
is a really bad idea. Be careful.--dir-naming-scheme 'Converted/$title'
CustomGenre=Horror ./AAXtoMP3 --dir-naming-scheme "$CustomGenre/\$artist/\$title" *.aax
--chapter-naming-scheme '$(printf %0${#chaptercount}d $chapternum) $chapter'
: only chapter number and chapter name--dir-naming-scheme '$genre/$artist/$title-$narrator' --file-naming-scheme '$title-$narrator'
--dir-naming-scheme '$genre/$title'
$series
or $series_sequence
in the schemes the following is required:
--use-audible-cli-data
is setaudible library export -o ./library.tsv
--audible-cli-library-file ./library.tsv
In general, take a look at command-not-found.com
Ubuntu, Linux Mint, Debian
sudo apt-get update
sudo apt-get install ffmpeg libav-tools x264 x265 bc
In Debian-based system's repositories the ffmpeg version is often outdated. If you want
to convert .aaxc files, you need at least ffmpeg 4.4. So if your installed version
needs to be updated, you can either install a custom repository that has the newer version,
compile ffmpeg from source or download pre-compiled binaries.
You can then tell AAXtoMP3 to use the compiled binaries with the --ffmpeg-path
flag.
You need to specify the folder where the ffmpeg and ffprobe binaries are. Make sure
they are both executable.
If you have snapd installed, you can also install a recent version of 4.4 from the edge channel:
snap install ffmpeg --edge
In this case you will need to confiure a custom path and binary name for ffprobe, --ffmpeg-path /snap/bin/ --ffprobe-name ffmpeg.ffprobe
.
Fedora
Fedora users need to enable the rpm fusion repository to install ffmpeg. Version 22 and upwards are currently supported. The following command works independent of your current version:
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
Afterwards use the package manager to install ffmpeg:
sudo dnf install ffmpeg
RHEL or compatible like CentOS
RHEL version 6 and 7 are currently able to use rpm fusion. In order to use rpm fusion you have to enable EPEL, see http://fedoraproject.org/wiki/EPEL
Add the rpm fusion repositories in version 6
sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-6.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-6.noarch.rpm
or version 7:
sudo yum localinstall --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-7.noarch.rpm https://download1.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-7.noarch.rpm
then install ffmpeg:
sudo yum install ffmpeg
MacOS
brew install ffmpeg
brew install gnu-sed
brew install grep
brew install findutils
Note: This is an optional dependency, required for adding cover art to m4a and b4b files only.
Ubuntu, Linux Mint, Debian
sudo apt-get update
sudo apt-get install mp4v2-utils
On Debian and Ubuntu the mp4v2-utils package has been deprecated and removed, as the upsteam project is no longer maintained. The package was removed in Debian Buster, and Ubuntu Focal [ 20.04 ].
CentOS, RHEL & Fedora
# CentOS/RHEL and Fedora users make sure that you have enabled atrpms repository in system. Let’s begin installing FFmpeg as per your operating system.
yum install mp4v2-utils
MacOS
brew install mp4v2
Note: This is an optional dependency.
Ubuntu, Linux Mint, Debian
sudo apt-get update
sudo apt-get install mediainfo
CentOS, RHEL & Fedora
yum install mediainfo
MacOS
brew install mediainfo
The AAXC format is a new Audible encryption format, meant to replace the old AAX. The encryption has been updated, and now to decrypt the file the authcode is not sufficient, we need two "keys" which are unique for each audiobook. Since getting those keys is not simple, for now the method used to get them is handled by the package audible-cli, that stores them in a file when downloading the aaxc file. This means that in order to decrypt the aaxc files, they must be downloaded with audible-cli. Note that you need at least ffmpeg 4.4.
Some information are not present in the AAX file. For example the chapters's title, additional chapters division (Opening and End credits, Copyright and more). Those information are avaiable via a non-public audible API. This repo provides a python API wrapper, and the audible-cli packege makes easy to get more info. In particular the flags --cover --cover-size 1215 --chapter downloads a better-quality cover (.jpg) and detailed chapter infos (.json). More info are avaiable on the package page.
Some books might not be avaiable in the old aax
format, but only in the newer
aaxc
format. In that case, you can use audible-cli
to download them. For example, to download all the books in your library in the newer aaxc
format, as well as
chapters's title and an HQ cover: audible download --all --aaxc --cover --cover-size 1215 --chapter
.
To make AAXtoMP3 use the additional data, specify the --use-audible-cli-data flag: it expects the cover and the chapter files (and the voucher, if converting an aaxc file) to be in the same location of the AAX file. The naming of these files must be the one set by audible-cli. When converting aaxc files, the variable is automatically set, so be sure to follow the instructions in this paragraph.
For more information on how to use the audible-cli
package, check out the git page audible-cli.
Please note that right now audible-cli is in dev stage, so keep in mind that the naming scheme of the additional files, the flags syntax and other things can change without warning.
Note that this project does NOT ‘crack’ the DRM. It simply allows the user to use their own encryption key (fetched from Audible servers) to decrypt the audiobook in the same manner that the official audiobook playing software does.
Please only use this application for gaining full access to your own audiobooks for archiving/conversion/convenience. DeDRMed audiobooks should not be uploaded to open servers, torrents, or other methods of mass distribution. No help will be given to people doing such things. Authors, retailers, and publishers all need to make a living, so that they can continue to produce audiobooks for us to hear, and enjoy. Don’t be a parasite.
This blurb is borrowed from the https://apprenticealf.wordpress.com/ page.
Changed the license to the WTFPL, do whatever you like with this script. Ultimately it's just a front-end for ffmpeg after all.
I'll help out if you are having issues, just submit and issue and I'll get back to you when I can.