How to convert Audible aax files to mp3 in Linux

 

Convert Audible aax-files to mp3 in LinuxSo far I always assumed that when I buy music or audiobooks on Amazon for download, I’ll get mp3 files for download. Far from it – yesterday I once again bought a an audiobook and had to find out that I was forwarded after the purchase to Audible and there was confronted with a “protected” aax file. If I wanted to buy at Audible, I would have gone to Audible. Thanks for nothing, Amazon!

But now the following question arises: “How do I convert the proprietary aax files into mp3’s, which I can play everywhere?” (aax files are only playable with the official Audible apps which aren’t available on all platforms.) After all, when buying on Amazon, there wasn’t the talk about the fact that the purchased audiobook can only be heard on devices for which there is also an Audible player. For Windows users, there are already simple tools like aax2mp3, which take over the conversion. As a Linux user, you have to reach deeply into the trickbox …

Convert aax-files to mp3-files

To convert the proprietary Audible aax files into “open” mp3 files, we need two free scripts, both available on Github. On the one hand we need AAXtoMP3 from KrumpetPirate, which carries out the actual conversion and on the other hand we need the audible-activator from inAudible-NG, which provides the authcode, which is needed for the conversion. Since AAXtoMP3 depends on this authcode, we start with the audible-activator. The following tutorial takes mainly place in the terminal/shell.

Preparation
For the following instructions to work, you should have both the Chrome browser and ffmpeg installed. If this is not the case, you can download the Chrome browser here.
FFMpeg can be installed via the following command:

apt-get install ffmpeg

In the first step, you create a directory where you want to save the tools, download the audible-activator, unpack it and navigate to the audible-activator directory. (Each line is a command and should be entered after the previous command has been executed.)

mkdir aax2mp3tools
cd aax2mp3tools
wget https://github.com/inAudible-NG/audible-activator/archive/master.zip
unzip master.zip
rm master.zip
cd audible-activator-master

The next step is to make the audible-activator still workable. To do this, we have to download the Selenium Chromedriver via the Python package manager and the “selenium” and the “requests” package.

sudo pip install requests
sudo pip install selenium
wget https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip
unzip chromedriver_linux64.zip

If you do not use a 64-bit variant of Linux, you may have to load another Chromedriver. The list of current Chromedrivers can be found here. (If you have not already installed the Google Chrome browser on your computer, you should do so now, because the audible-activator is a Python script that automates the Chrome browser.)

Now that the setup of the audible-activator is complete, it can be executed. The following call is enough:


./audible-activator.py -l de

If you have an US audible account, you should replace the “de” in the call with “us”. The script asks for “Username” and “Password”. Here you have to specify your Audible user name and your password. If you, like me, became an Audible customer because you bought a download on Amazon, you need to enter your Amazon credentials. Then the script opens the Chrome browser, loads a few pages and shows you your Authcode in the terminal.

raffael@nbb-kubuntu:~/Tools/aax2mp3tools/audible-activator-master$ ./audible-activator.py -l de
Username: <secret>@googlemail.com
Password: <secret>
[*] Player ID is 2jmj7lXXXXXXXkK/YBwk=
activation_bytes: d8cfXXXX

I have anonymized my output, but the last line corresponds to the Auth code. This authcode is needed for the conversion of the aax-file or better said for the call of the aax2mp3-script.

Now that we have the authcode, we navigate back to our tools directory, download the aax2mp3 script and unpack it.

cd ..
wget https://github.com/KrumpetPirate/AAXtoMP3/archive/master.zip
unzip master.zip
rm master.zip
cd AAXtoMP3-master

Now we can start converting from aax format to mp3 format. To do so, run the following command:

./AAXtoMP3 <authcode> <aax-file>

The token <authcode> has to be replaced with the authcode (“activation_bytes”), which we have just read via audible-activator. The token <aax-file> must be replaced by the path to the aax file. The rest is done by the tool. After executing the script, you should find the respective mp3 version of the aax-file in the same directory as the aax file.

69 Comments

  1. Hello Rafael,

    I am hoping, since this was originally posted so long ago, that I can still get help. I am using PopOS with python version 3.10.6. The first command is ‘./audible-activator.py -l us’
    When I type that in I get an error ‘/usr/bin/env: ‘python’: No such file or directory’
    My coding skills are like maybe 2 out of 10 (very limited) but I looked in the file and the first line is ‘#!/usr/bin/env python’
    So I changed it to ‘#!/usr/bin/env python3’ and it executed.I entered my username and password per the prompts and was given this error….
    ‘[*] Player ID is 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
    /home/test/ebooks/audible-activator-master/./audible-activator.py:91: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
    driver = webdriver.Chrome(options=opts,
    Traceback (most recent call last):
    File “/home/test/ebooks/audible-activator-master/./audible-activator.py”, line 202, in
    fetch_activation_bytes(username, password, options)
    File “/home/test/ebooks/audible-activator-master/./audible-activator.py”, line 91, in fetch_activation_bytes
    driver = webdriver.Chrome(options=opts,
    File “/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chrome/webdriver.py”, line 81, in __init__
    super().__init__(
    File “/usr/local/lib/python3.10/dist-packages/selenium/webdriver/chromium/webdriver.py”, line 106, in __init__
    super().__init__(
    File “/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py”, line 288, in __init__
    self.start_session(capabilities, browser_profile)
    File “/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py”, line 381, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
    File “/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/webdriver.py”, line 444, in execute
    self.error_handler.check_response(response)
    File “/usr/local/lib/python3.10/dist-packages/selenium/webdriver/remote/errorhandler.py”, line 249, in check_response
    raise exception_class(message, screen, stacktrace)
    selenium.common.exceptions.SessionNotCreatedException: Message: session not created exception: Missing or invalid capabilities
    (Driver info: chromedriver=2.35.528139 (47ead77cb35ad2a9a83248b292151462a66cd881),platform=Linux 6.0.12-76060006-generic x86_64)’

    I have no idea what to do with this. I know that time is valuable and I don’t want to take up a whole bunch of yours but if you could help me real quick or even direct me to where I can find the answers for myself it would be truly appreciated.

    Thank you

    • Peter,

      I just ran into the same issue, Apparently Amazon has changed their API so this code won’t work anymore. I could dig into it using Postman to see if I can fix it, but I am, like you, just wanting to get some MP3 files; so I’ll keep looking for another solution before I try fixing this broken API interface issue.

  2. Franksays:

    Sorry again! Its done! I just forgot the option –authcode. Sorry for the nuisance

  3. Franksays:

    Sorry there is a mistake in my comment. It must be:
    Although everything worked fine after uncommenting opts.add_argument(‘–headless’) , I received the message ‘ERROR Missing authcode, can’t decode activation-bytes ‘ where activation-bytes is the response I got after invoking ./audible-activator.py -l de

  4. Franksays:

    Although everything worked fine after uncommenting opts.add_argument(‘–headless’) , I received the message ‘ERROR Missing authcode, can’t decode ‘ where is the response I got after invoking ./audible-activator.py -l de

  5. Andysays:

    Excellent guide, however because of the need to enter a OTP, I found I had to comment out row 33: opts.add_argument(‘–headless’) which then allowed Chrome to run in the foreground

    Error I was getting prior to this was:
    File “./audible-activator.py”, line 203, in
    fetch_activation_bytes(username, password, options)
    File “./audible-activator.py”, line 138, in fetch_activation_bytes
    + ‘customer_token=’ + data[“playerToken”] + “&action=de-register”
    KeyError: ‘playerToken’

    Hope this helps

  6. Dennis Floressays:

    Excelent. Thank you.

  7. daveclark966says:

    Epubor Audible Converter is a professional AAX to MP3 player which supports to convert any Audible AAX file to any MP3 player supported MP3 format, not only for AudibleSync app supported MP3 players, but also for AudibleSync app non-supported MP3 players.

    • I have used this software, but it is a bit expensive. Now I use TuneSolo Audible Converter, this software converts speed blocks, the price is also cheap, I like it very much.

  8. Frank Felixsays:

    Hi I seem to have a problem with one file with has a “?” in it’s title which is trowing this error and I don’t know what could be the workaround or if there is any options I could use with the script

    Error ” /media/teddy/USBSTORAGE/books/Audiobook/Seth Godin/Linchpin-Are You Indispensable?’: Invalid argument”

    Any help would be much appricated

  9. Zzicklesays:

    thank you for this. I had to dl and install the pip installer due to ‘pip: command not found’ error:
    wget https://bootstrap.pypa.io/get-pip.py
    sudo python get-pip.py
    and add ‘–authcode’ to the final step:
    ./AAXtoMP3 –authcode
    to get it to work, but other than that it worked perfectly.

  10. Mattsays:

    I’ve followed all the steps without problem, but when I run the app in terminal (with ./AAXtoMP3 XXXXXXXX /path/to/file/mindbody.aax, I get the following error:

    ERROR Missing authcode

    Usage: AAXtoMP3 [–flac] [–aac] [–opus ] [–single] [–chaptered]
    [-e:mp3] [-e:m4a] [-e:m4b] [–authcode ] [–no-clobber]
    [–target_dir ] [–complete_dir ] [–validate]
    {FILES}

    • Steffensays:

      use the –authcode option followed by your authcode and it will work:

      ./AAXtoMP3 –authcode XXXXXXX .aax

  11. Hunter Lsays:

    I thought i might throw in a helpful post here..It took me a minute to figure it out, but i successfully got this working on Chrome OS!

    You need to enable Linux(Beta), and open up the Terminal that pops up in the Linux apps folder. You follow all of the steps up to sudo pip install requests. You need to install Python2 to enable the pip command

    apt install python-pip

    Now you can run the pip commands and install requests and selenium. I ended up utilizing the command
    wget https://chromedriver.storage.googleapis.com/2.35/chromedriver_linux64.zip

    The version i SHOULD use for chromedriver only caused me problems, but utilizing the OP’s 2.35 link is the only thing that worked.

    In order to get:
    ./audible-activator.py -l de

    to work, i had to install chromium. We already have chrome installed, but the activator doesn’t recognize chrome in chrome os (You might be able to find a way around this, but installing chromium also seemed to install other dependencies i needed, so i found it easier)

    sudo apt install -y chromium-browser

    After that you should get your activation_bytes code, and be able to follow the rest of the steps.
    In order to get ./AAXtoMP3 to work, i had to use:
    sudo ./AAXtoMP3 –authcode xxxxxxx audiobook.aax
    (xxxx is your code, and audiobook.aax is the file name).

    I found the AAXtoMP3-master folder in the linux files, and copied over the aax file to it. Once it was done converting i found the mp3 file in AAXtoMP3-master/Audiobook/

    I hope i was able to help out a fellow chromebook user! Its my only device at the moment, and it was much easier just utilizing chromeos than utilizing crouton or some other method of linux.

    • Hunter Lsays:

      opps the chromium install was just:
      sudo apt install chromium

      not:
      sudo apt install -y chromium-browser

  12. Unknownsays:

    I have an Australian Audible account and i am stuck retrieving the Authcode. It has to go via the .com.au website because the .com site does not recognise my credentials.

    I tried to change the “./audible-activator.py -l de” to “./audible-activator.py -l au” but that obviously didn’t work.

    Is there a way for me to be able to get to the http://www.audible.com.au website using the “./audible-activator.py” command?

    • Trembelsays:

      Yes, open audible-activator.py and change all links to their correspondents in australia. Since I’ve not tested it, I can’t give you any guarantees

  13. Enkisays:

    Hi All,

    I wonder if there is anything similar for just AA formats …

  14. Patricksays:

    It works like a charm! Took me a while to figure out my mistakes. Many thanks for sharing!

  15. i use Avdshare Audio Converter to Convert aax, aa to MP3, WAV, AAC, FLAC, OGG, MP2, AIFF, WMA, etc to further play aax or aa file on more devices.

  16. pablosays:

    the audible activation is not working for me, specifically the automatic sign in, it seems like audible and amazon have change the way you login so its not letting me logging and then I havent been able to get my code to transform the file, any suggestions?

    • Doctor Gsays:

      Same here. Get the Chrome window, log in with Amazon Credentials and then in the terminal…

      (audible_error=Internal service error has occured while processing the request, please contact service admin.)

      Activation failed! ;(

      • how do you manage to run google chrome once yo type audible-activator -l de
        whenever i put this command i get the chromium taking control of the operation, how do i change browser to chrome?
        thanks

  17. Francisque Sarceysays:

    Thank you very much !

  18. audiboysays:

    Hi,

    thank you very much for your efforts around audible!

    I am running into some problems. Installation of requests seems to stop. I’d be glad, if you check:

    [user@name audible]$ audible-activator-master/audible-activator.py -l de
    Traceback (most recent call last):
    File “audible-activator-master/audible-activator.py”, line 10, in
    import requests
    ImportError: No module named requests

    [user@name audible]$ sudo pip install requests
    Requirement already satisfied: requests in /usr/lib/python3.7/site-packages (2.19.1)
    Requirement already satisfied: chardet>=3.0.2 in /usr/lib/python3.7/site-packages (from requests) (3.0.4)
    Requirement already satisfied: idna>=2.5 in /usr/lib/python3.7/site-packages (from requests) (2.7)
    Requirement already satisfied: urllib3>=1.21.1 in /usr/lib/python3.7/site-packages (from requests) (1.23)
    [user@name audible]$

    Any ideas how to solve this?

    Greetings
    audiboy

    • Ken Adamssays:

      I have the same problem. Did you ever get it resolved? I am using a Debian VM 9.4.0-amd64-cinnamon.iso on Unraid 6.7.0.

    • Oliver Schirmersays:

      Use python 2 instead of 3!

      curl https://bootstrap.pypa.io/get-pip.py –output get-pip.py
      sudo python2 get-pip.py

      pip2 install requests
      pip2 install selenium

      try again:
      ./audible-activator.py -l de

  19. Tim Hartsays:

    HI there – everything works great till I try to convert.
    It says ERROR Missing authcode
    but i have done the login step twice and the same activation_bytes: XXXXXX
    appears so im not sure what im doing wrong

    • I encountered the same just now. Solution is simple. The Usage message that prints after the AAXtoMP3 error says it all – specify –authcode before the , and the conversion will be well underway. i.e. $ ./AAXtoMP3 –authcode

  20. I can’t get this to work because I need a 32-bit Chromedriver download, and 2.35-2.38 don’t offer those downloads. After trying multiple versions of Chromedriver that have a 32-bit download, I haven’t found any that work. The errors are generally of the type: selenium.common.exceptions.WebDriverException

  21. Big Thankssays:

    Works very well, thanks!

  22. Stefansays:

    Hello Rafael, thank you so much for this easy to use introduction – it works just fine!

    The only thing that disturbs me is, that all the output-mp3s have a bitrate of only 64kBit/sec, which is pretty bad…
    I don’t think that this the native bitrate of the aax-file.
    How can I set the bitrate of the output-mp3?

    Thank you in advance!
    Greetings,
    Stefan

  23. Ricksays:

    Raffael, Success! Clear & concise instructions – thank you, much appreciated. I also had to install PIP (https://www.tecmint.com/install-pip-in-linux), was prompted to update, all without issue. And my output was also in the /home//aax2mp3tools/AAXtoMP3-master/Audiobook directory.
    —————
    Lenovo T530
    Chromium 64.0.3282.167 Built on Ubuntu, running on LinuxMint 18.3 Sylvia

  24. Stephen Shapirosays:

    Thanks so much for this. Did it on a mac and this cleared a lot up for me as a command line noob.

  25. Darylsays:

    Thanks so much for this. This worked perfectly on ubuntu 7.10

  26. Thomassays:

    Brilliant job. Works flawlessly. Thanks for a great tutorial.

  27. With help of all your feedback, I updated the article. Special thanks to QUISL (ffmpeg hint), JOE (filename of aax2mp3 changed) and JAAKKO (sudo for pip selenium).

  28. alexsays:

    Hi,

    It fails when launching chrome, I always get a bad Player ID.
    Can someone help ?

    Chrome launches but then the script crashes “missing or invalid ‘entry.level'”, see below :

    ./audible-activator.py -l uk
    Username: xxxx@xxx.com
    Password:
    [*] Player ID is 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
    Traceback (most recent call last):
    File “./audible-activator.py”, line 160, in
    fetch_activation_bytes(username, password, options)
    File “./audible-activator.py”, line 67, in fetch_activation_bytes
    driver.get(base_url + ‘?ipRedirectOverride=true’)
    File “/home/alex/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 324, in get
    self.execute(Command.GET, {‘url’: url})
    File “/home/alex/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 312, in execute
    self.error_handler.check_response(response)
    File “/home/alex/.local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py”, line 237, in check_response
    raise exception_class(message, screen, stacktrace)
    selenium.common.exceptions.WebDriverException: Message: unknown error: missing or invalid ‘entry.level’
    (Session info: chrome=64.0.3282.119)
    (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.4.0-109-generic x86_64)

    thx

  29. Anyone having issues with AAX2MP3 can create a issue at my github page [here](https://github.com/KrumpetPirate/AAXtoMP3/issues), I’ll try to help when I can.

  30. Adamsays:

    Failed following the notes, installing the chrome driver manually (newer version) solved my problem.

    • Hi Adam,

      that’s why I added the link to the chromedriver release and wrote the note, that you should check for the newest release, because chromedriver releases faster, than I’m updating my blog. ;-)

  31. gefstsays:

    Thanks for the excellent program. A small thing but perhaps helpful…
    I found the output files in home/user/Audiobook and not in the same directory as the original aax file

  32. Well it seems to me if we purchase an audio book online and download it we should have the option to choose the file format we want.

  33. Fred Obermannsays:

    Thanks for the comprehensive instructions! As always, I ran into some glitches…

    (BTW: I am using Linux Mint (“uname” renders: 4.4.0-109-generic #132-Ubuntu SMP Tue Jan 9 19:52:39 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux)

    I ran into the following hiccups…
    1) I had to install “python-pip” before I could execute your instructions, and after I installed it, I was prompted to update it using: “pip install –upgrade pip”.
    “pip install requests” worked just fine.
    2) “pip install selenium” failed with a permission-denied error, as it was trying to install to ‘/usr/local/lib/python2.7/dist-packages/selenium’.
    I ran the command again using sudo, and it worked with some warnings.
    3) Running “./audible-activator.py -l us” results in two values, “Player ID”, and “activation_bytes”. “activation_bytes” is what you refer to as in your instructions.
    4) After unzipping master.zip, the resulting command in the ‘master’ directory is ‘AAXtoMP3’, not ‘AAXtoMP3.sh’
    Running AAXtoMP3 appears to working. My computer is slogging through the conversion. I’ll find out later if it utlimately succeeds.

    Thanks again for your thorough description of conversion procedure!!!!

  34. When I run the activator I get this:

    Username: msauers@travelinlibrarian.info
    Password:
    [*] Player ID is 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
    Traceback (most recent call last):
    File “./audible-activator.py”, line 160, in
    fetch_activation_bytes(username, password, options)
    File “./audible-activator.py”, line 63, in fetch_activation_bytes
    executable_path=chromedriver_path)
    File “/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py”, line 68, in __init__
    self.service.start()
    File “/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py”, line 74, in start
    stdout=self.log_file, stderr=self.log_file)
    File “/usr/lib/python2.7/subprocess.py”, line 711, in __init__
    errread, errwrite)
    File “/usr/lib/python2.7/subprocess.py”, line 1343, in _execute_child
    raise child_exception
    OSError: [Errno 8] Exec format error

    I’m stumped.

    • P.S. I did add the chromedriver to $PATH

      $ echo $PATH
      /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/msauers/aax2mp3tools/audible-activator-master

  35. maxsays:

    :~/aax2mp3tools/audible-activator-master$ ./audible-activator.py -l us
    Username: mahmoud.gudarzi@gmail.com
    Password:
    [*] Player ID is 2jmj7l5rtw05Vb/vlWAYkK/YBwk=
    Traceback (most recent call last):
    File “./audible-activator.py”, line 160, in
    fetch_activation_bytes(username, password, options)
    File “./audible-activator.py”, line 67, in fetch_activation_bytes
    driver.get(base_url + ‘?ipRedirectOverride=true’)
    File “/home/maximum/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 323, in get
    self.execute(Command.GET, {‘url’: url})
    File “/home/maximum/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py”, line 311, in execute
    self.error_handler.check_response(response)
    File “/home/maximum/.local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py”, line 237, in check_response
    raise exception_class(message, screen, stacktrace)
    selenium.common.exceptions.WebDriverException: Message: unknown error: missing or invalid ‘entry.level’
    (Session info: chrome=63.0.3239.108)
    (Driver info: chromedriver=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320),platform=Linux 4.10.0-42-generic x86_64)

  36. joesays:

    thx for the tool !
    the ” bash: ./AAXtoMP3.sh: No such file or directory ” is easy to fix by
    tipe in : ./AAXtoMP3 the .sh is not at the curent file version. but at the end I dont se a mp3 file.
    joe@joe:~/aax2mp3tools/AAXtoMP3-master$ ./AAXtoMP3 XXXXXXX /home/joe/Downloads/
    is running without error and printing :
    2017-12-12 21:27:29+0100 Decoding /home/joe/Downloads/ with auth code XXXXX…
    ?

  37. ttbakiatwoamsays:

    I found that I had to rename the file to get it to process the default filename from audible is just too long.

  38. crinklechipssays:

    I found that I had to type in the ‘activation bytes’ code not the ‘authentication code’.

  39. jonnysays:

    found this website through this great workaround. well done across the board.

  40. nathansays:

    I’m new to Linux and such and was trying to follow your guide. When I attempt to run the selenium install line, the text turns red and it appears to fail. This is what my terminal reads.

    ~/aax2mp3tools/audible-activator-master$ pip install selenium
    Collecting selenium
    Using cached selenium-3.5.0-py2.py3-none-any.whl
    Installing collected packages: selenium
    Exception:
    Traceback (most recent call last):
    File “/home/nathan/.local/lib/python2.7/site-packages/pip/basecommand.py”, line 215, in main
    status = self.run(options, args)
    File “/home/nathan/.local/lib/python2.7/site-packages/pip/commands/install.py”, line 342, in run
    prefix=options.prefix_path,
    File “/home/nathan/.local/lib/python2.7/site-packages/pip/req/req_set.py”, line 784, in install
    **kwargs
    File “/home/nathan/.local/lib/python2.7/site-packages/pip/req/req_install.py”, line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
    File “/home/nathan/.local/lib/python2.7/site-packages/pip/req/req_install.py”, line 1064, in move_wheel_files
    isolated=self.isolated,
    File “/home/nathan/.local/lib/python2.7/site-packages/pip/wheel.py”, line 345, in move_wheel_files
    clobber(source, lib_dir, True)
    File “/home/nathan/.local/lib/python2.7/site-packages/pip/wheel.py”, line 316, in clobber
    ensure_dir(destdir)
    File “/home/nathan/.local/lib/python2.7/site-packages/pip/utils/__init__.py”, line 83, in ensure_dir
    os.makedirs(path)
    File “/usr/lib/python2.7/os.py”, line 157, in makedirs
    mkdir(name, mode)
    OSError: [Errno 13] Permission denied: ‘/usr/local/lib/python2.7/dist-packages/selenium-3.5.0.dist-info’

    The PIP requirements install had no problem. Thank you for any assistance.

  41. Jaakkosays:

    Thanks for the clear and simple instructions! A few notes on the process

    -For me and apparently some other user at least, “pip install selenium” required admin rights as it wants to write something to /usr/local. Simple “sudo pip install selenium” was enough

    -I’m currently living in Canada, so I initially typed “-l ca” as the audible-activator.py parameter. This opened audible.ca site, from which the audible-activator script could not parse the authcode. Omitting the language completely (i.e. simply “./audible-activator.py” + credentials when prompted) uses audible.com and worked nicely (after logging in once manually to provide the amazon verification code as I had not used it previously)

    -AAXtoMP3.sh requires ffmpeg, which may or may not be easily accessible. For Ubuntu 16.04 (and maybe later) it was easily installed through repositories (“sudo apt install ffmpeg”) but for some older Ubuntus or Debian-based installations the situation is not that clean, you may have to build up from source or add a ppa repository / similar. YMMV, initially I tried to do the AAX=>non-DRM MP3 conversion with an older Debian-based distro, but adding a custom repository for ffmpeg was not enough as the dependencies were not met / there were version conflicts in libraries. Then, changing to Ubuntu 16.04 the process was a breeze. For some older Ubuntu versions the ffmpeg package is actually a dummy package, redirecting to avconv, so be sure the “ffmpeg” and “ffprobe” commands started from the command-line refer to real one by FFmpeg developers, not the avconv one (check the 1st line of the command output).

  42. Michaelsays:

    I’m having trouble installing Requests and Selenium. Any help much appreciated.

    I get the following messages

    “mike@mike-c2duo:~/aax2mp3tools/audible-activator-master$ pip install requests Requirement already satisfied (use –upgrade to upgrade): requests in /usr/lib/python2.7/dist-packages”

    “mike@mike-c2duo:~/aax2mp3tools/audible-activator-master$ pip install seleniumDownloading/unpacking selenium
    Downloading selenium-3.5.0-py2.py3-none-any.whl (921kB): 921kB downloaded
    Installing collected packages: selenium
    Cleaning up…
    Exception:
    Traceback (most recent call last):
    File “/usr/lib/python2.7/dist-packages/pip/basecommand.py”, line 122, in main
    status = self.run(options, args)
    File “/usr/lib/python2.7/dist-packages/pip/commands/install.py”, line 283, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
    File “/usr/lib/python2.7/dist-packages/pip/req.py”, line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
    File “/usr/lib/python2.7/dist-packages/pip/req.py”, line 672, in install
    self.move_wheel_files(self.source_dir, root=root)
    File “/usr/lib/python2.7/dist-packages/pip/req.py”, line 902, in move_wheel_files
    pycompile=self.pycompile,
    File “/usr/lib/python2.7/dist-packages/pip/wheel.py”, line 206, in move_wheel_files
    clobber(source, lib_dir, True)
    File “/usr/lib/python2.7/dist-packages/pip/wheel.py”, line 193, in clobber
    os.makedirs(destsubdir)
    File “/usr/lib/python2.7/os.py”, line 157, in makedirs
    mkdir(name, mode)
    OSError: [Errno 13] Permission denied: ‘/usr/local/lib/python2.7/dist-packages/selenium’
    Storing debug log for failure in /home/mike/.pip/pip.log”

    I notice the first message refers to usr/lib/python2.7 while the second refers to usr/local/lib/python2.7

    • Jaakkosays:

      I did simply “sudo pip install selenium” and all worked fine

    • colinsays:

      pip is trying to install yout your distribution’s packages.
      You may try:
      pip –user
      install with virtualenv (google for it if you don’t know)
      sudo pip install or pip install with root privileges

  43. flashcraftsays:

    OK, for what it’s worth,
    I bought and downloaded the Audible book ‘God Touched’.
    I installed ffmpeg according to QUISL’s instruction.

    Now, in the Terminal, I’m in the ‘AAXtoMP3-master’ folder but I kept getting, “AAXtoMP3: command not found” until I added “./” in front of ‘AAXtoMP3’ like so, ‘./AAXtoMP3 ******** ./GodTouched (the asterisks are my authcode)

    Then the Terminal wrote, “Created ./Audiobook/John Conroe/God Touched/God Touched.mp3.” and then did a bunch of stuff.
    This got me 23 .mp3 files and a cover .jpg. They work! 8D

    Thank you, Raffael and QUISL.

  44. Montesays:

    Great stuff. Thanks for sharing

  45. Angelesays:

    Hello. I am pretty new to the Linux terminal. I got all the way through the steps in my terminal but I keep getting an error message for the last command:

    bash: ./AAXtoMP3.sh: No such file or directory

    I am sure the authcode is correct. I am less sure about the corrrect path for the directory, though this is the path listed in my file directory ‘/home/ampretus/Desktop/’ The apostrophes are added when I drag and drop the file.

    Do I need to change back to my home directory or move the .aax file into the ./AAXtoMP3.sh directory?

    Thank you for any suggestions.

    • Hi Angele,
      “No such file or directory” means, that the shell couldn’t find the script “AAXtoMP3.sh”. So this says nothing about the “authcode”, etc.

      When writing “./AAXtoMP3.sh” have a look at the beginning. The point “.” means “in this directory”. So “./AAXtoMP3.sh” means “Open the script file ‘AAXtoMP3.sh’ in this/the current directory”.

      Now you got the error that the file couldn’t be found. So either the file isn’t in the directory or you are in the wrong directory.

      Let’s say you saved the AAXtoMP3.sh-file in “/home/ampretus/Desktop” then you have two options.

      1) Navigate to the directory via “cd /home/ampretus/Desktop” (cd means ‘change directory’) and the call “./AAXtoMP3.sh”
      2) Call the script via fullpath “/home/ampretus/Desktop/AAXtoMP3.sh”

      No matter which of the options you use, don’t forget to write the arguments/parameters behind the script’s name.

      • Thanks for the post Raffael

        Been trying to get this to work, having my own problems, but I did see and get past this issue.

        It seeems that in the current version the .sh name extension is not explicit.

        ‘./AAXtoMP3 … …’ from the correct directory should call the script

        It might also be noted that this requires chrome to be installed, having no previous experience with chromedriver I assumed that it would be able to GET, parse whatever it needed on its own. The error the python script throws in absence of chrome is going to be useless to most people… You need chrome to be installed.

        I also spent some time trying to figure out why the scipt would finish instantly and nothing would change. This script will silent fail if ffmpeg is not installed.

        I’m sure if you add that the current .zip unzipped

        After I got through those 3 issues it works 100% and sounds great!

        • Yea, when the program ends after the

          “Decoding ${path} with auth code ${auth_code}…”

          message you need to install ffmpeg first. On Debian and Ubuntu this can be done with:

          # apt-get install ffmpeg

          • Karolinasays:

            Hello, I have the same problem – the program ends after the

            “Decoding ${path} with auth code ${auth_code}…”, I got installed ffmpeg and it didn’t work. What can I be doing wrong?

            • Nicksays:

              I have the same problem. ffmpeg (3.2.10) is installed but the process never gets past decoding.

  46. Saschasays:

    I tried this and it didn’t work for me. Here is what my computer says:

    $ls ~/aax2mp3
    audible-activator-master chromedriver
    $cd ~/aax2mp3/audible-activator-master
    $./audible-activator.py -l de

    … proceed to enter my credentials …

    Username: JohnDoe@googlemail.com
    Password:
    [*] Player ID is 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
    Traceback (most recent call last):
    File “./audible-activator.py”, line 148, in
    fetch_activation_bytes(username, password, options)
    File “./audible-activator.py”, line 57, in fetch_activation_bytes
    executable_path=chromedriver_path)
    File “/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py”, line 62, in __init__
    self.service.start()
    File “/usr/local/lib/python2.7/dist-packages/selenium/webdriver/common/service.py”, line 81, in start
    os.path.basename(self.path), self.start_error_message)
    selenium.common.exceptions.WebDriverException: Message: ‘chromedriver’ executable needs to be in PATH. Please see https://sites.google.com/a/chromium.org/chromedriver/home

    However, I added the folder to $PATH (I think):

    $echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/John/aax2mp3

    What did I miss?

    • You added the aax2mp3 folder to the path variable, but you have to add the path of the chromedriver. The chromedrivers path is the folder where you extracted the chromedriver.zip file.

      Additionally you could have a look at this post: http://stackoverflow.com/a/24364290/251719

      Let me know if this solved your problem or if you need further help.

      Greetings,
      Raffael

Leave a Reply to crinklechips Cancel reply

Please be polite. We appreciate that. Your email address will not be published and required fields are marked