Skip to content

Instantly share code, notes, and snippets.

@ironicbadger
Last active September 3, 2018 15:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ironicbadger/289751a955388d0143a755073628f452 to your computer and use it in GitHub Desktop.
Save ironicbadger/289751a955388d0143a755073628f452 to your computer and use it in GitHub Desktop.
automated audiobook DRM stripping
#!/bin/bash
# ./convert -a asdfghjk
# Obtain an activation_bytes string and plug it into this script with -a.
FILES=aax/*
OUTPUT=mp3
while getopts a: option
do
case "${option}"
in
a) ACTIVATION=${OPTARG};;
esac
done
for f in $FILES
do
echo "Processing Audiobook $f ..."
fileshort=$( echo "$f" | cut -c 5- )
ffmpeg -y -activation_bytes $ACTIVATION -i $f -ab 320k $OUTPUT/${fileshort%????}.mp3
echo "Processing of Audiobook $f complete..."
echo "#########"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment