Re: Autible books and Linux?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

disclaimer: No copyright infringement or circumvention is intended by offering the below.

Here's how to convert Audible books losslessly to something more usable.

You will need ffmpeg 2.8.1 or higher for the conversion. You will also need to use git to get Audible tables for RainbowCrack for getting your activation code (this only needs to be done once per Audible account), which I will explain below.

Here's what you need to do:

1. Log into Audible and download your book in .aax format. I've not checked but I expect that you will need to use a graphical browser to do this.

You need to get a book first so that you can get your Audible activation code.

2. The following needs to be done only once per Audible account. Even if you use the same login for different countries (e.g. Audible Australia and Audible UK), the same activation code seems to apply.

If you've already done this, go to step 3.

This bit is a bit fiddly, so if it looks a bit daunting or you can't run the rcrack binary, you may want to get someone you trust to do it for you, particularly since you only need to do it once per account. You will only need to send that person the checksome (see step 2B), not the book file.

A.  Get the Audible tables for RainbowCrack:

git clone https://github.com/inAudible-NG/tables.git

Note that this includes an ELF executable for x86-64. If you're running on some other architecture, you may be out of luck as I don't see any other architectures at project-rainbowcrack.com. Anyway, a bit of digging may well turn up something.

This will likely generate a directory with some files in it. The directory on my system is called audible_rcrack_tables and I'm assuming this was generated automatically (i.e. that I didn't call it this), but I honestly don't remember.

B.  Get the SHA1 checksum from the Audible file:

$ ffprobe book.aax

The end of the output should look something like this:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1dde580] [aax] file checksum == 999a6ab8...
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x1dde580] [aax] activation_bytes option is missing!

This example is taken from the tables documentation. As I recall, the actual SHa1 checksum is a lot longer and obviously doesn't have the dots at the end.

C.  Get your Audible activation code.

Change into the directory that the git clone created in step 2A (on my system it's audible_rcrack_tables), and run the following:

$ ./rcrack . -h <checksum>

Example:

$ ./rcrack . -h 999a6ab8...

The end of the output will look like this:

result
-------------------------------------------------------
999a6ab8...                               xyz   hex:CAFED00D

In this example, the activation code is CAFED00D

3. Now that you have your book and your activation code, you can run the following:

$ ffmpeg -activation_bytes <code> -i book.aax -vn -c:a copy book.m4a

This should result in an M4A file with exactly the same data as the original audible file, so there will be no quality loss.

Of course, if you'd rather some other format, you can use ffmpeg to convert to it.

Notes:

1. This outputs the Audible book to a single file. The chapter information for the book is included in the conversion, ffmpeg and ffprobe will show it. But I've not found anything so far which makes use of it to allow chapter navigation.

2. Searching wil dig up several command line hacks to split the file into chapters, but ffmpeg doesn't appear to have the ability to do this natively, which seems like an oversight to me. I've not tried any of these hacks, but I don't see why they shouldn't work.

3. I recently read about M4B format, which is simlar to M4A but is more suited to books. I believe that ffmpeg can convert to it, but I've not actually tried and I don't know if the chapter info will be more useful there than in an M4A file.

Good luck!

Cheers,
Geoff.

To unsubscribe from this group and stop receiving emails from it, send an email to blinux-list+unsubscribe@xxxxxxxxxx.




[Index of Archives]     [Linux Speakup]     [Fedora]     [Linux Kernel]     [Yosemite News]     [Big List of Linux Books]