mirror of
https://github.com/KrumpetPirate/AAXtoMP3.git
synced 2024-11-17 18:58:58 +01:00
Fix typos
This commit is contained in:
parent
71f54b35e5
commit
624ca434e0
22
AAXtoMP3
22
AAXtoMP3
@ -7,7 +7,7 @@
|
||||
# Usage Synopsis.
|
||||
usage=$'\nUsage: AAXtoMP3 [--flac] [--aac] [--opus ] [--single] [--chaptered]\n[-e:mp3] [-e:m4a] [-e:m4b] [--authcode <AUTHCODE>] [--no-clobber]\n[--target_dir <PATH>] [--complete_dir <PATH>] [--validate]\n{FILES}\n'
|
||||
codec=libmp3lame # Default encoder.
|
||||
extension=mp3 # Default encoder extention.
|
||||
extension=mp3 # Default encoder extension.
|
||||
mode=chaptered # Multi file output
|
||||
auth_code= # Required to be set via file or option.
|
||||
targetdir= # Optional output location. Note default is basedir of AAX file.
|
||||
@ -38,7 +38,7 @@ while true; do
|
||||
-e:mp3 ) codec=libmp3lame; extension=mp3; mode=single; container=mp3; shift ;;
|
||||
# Identical to --acc option.
|
||||
-e:m4a ) codec=copy; extension=m4a; mode=single; container=mp4; shift ;;
|
||||
# Similiar to --aac but specific to audio books
|
||||
# Similar to --aac but specific to audio books
|
||||
-e:m4b ) codec=copy; extension=m4b; mode=single; container=mp4; shift ;;
|
||||
# Change the working dir from AAX directory to what you choose.
|
||||
-t | --target_dir ) targetdir="$2"; shift 2 ;;
|
||||
@ -140,7 +140,7 @@ debug_vars "Command line options as set" codec extension mode container targetdi
|
||||
# Variable validation
|
||||
|
||||
# -----
|
||||
# Detect which annoying version fo grep we have
|
||||
# Detect which annoying version of grep we have
|
||||
GREP=$(grep --version | grep -q GNU && echo "grep" || echo "ggrep")
|
||||
if ! [[ $(type -P "$GREP") ]]; then
|
||||
echo "$GREP (GNU grep) is not in your PATH"
|
||||
@ -210,7 +210,7 @@ fi
|
||||
|
||||
# -----
|
||||
# Obtain the authcode from either the command line, local directory or home directory.
|
||||
# See Readme.md for details on how to aquire your personal authcode for your personal
|
||||
# See Readme.md for details on how to acquire your personal authcode for your personal
|
||||
# audible AAX files.
|
||||
if [ -z $auth_code ]; then
|
||||
if [ -r .authcode ]; then
|
||||
@ -261,7 +261,7 @@ validate_aax() {
|
||||
local media_file
|
||||
media_file="$1"
|
||||
|
||||
# Test for existance
|
||||
# Test for existence
|
||||
if [[ ! -r "${media_file}" ]] ; then
|
||||
log "ERROR File NOT Found: ${media_file}"
|
||||
return
|
||||
@ -316,7 +316,7 @@ save_metadata() {
|
||||
# -----
|
||||
# Reach into the meta data and extract a specific value.
|
||||
# This is a long pipe of transforms.
|
||||
# This finds the first occurance of the key : value pair.
|
||||
# This finds the first occurrence of the key : value pair.
|
||||
get_metadata_value() {
|
||||
local key
|
||||
key="$1"
|
||||
@ -325,7 +325,7 @@ get_metadata_value() {
|
||||
}
|
||||
|
||||
# -----
|
||||
# specific varient of get_metadata_value bitrate is important for transcoding.
|
||||
# specific variant of get_metadata_value bitrate is important for transcoding.
|
||||
get_bitrate() {
|
||||
get_metadata_value bitrate | $GREP --only-matching '[0-9]\+'
|
||||
}
|
||||
@ -337,7 +337,7 @@ do
|
||||
|
||||
# Validate the input aax file. Note this happens no matter what.
|
||||
# It's just that if the validate option is set then we skip to next file.
|
||||
# If however vlaidate is not set and we proceed with the script any errors will
|
||||
# If however validate is not set and we proceed with the script any errors will
|
||||
# case the script to stop.
|
||||
validate_aax "${aax_file}"
|
||||
if [[ ${VALIDATE} == "1" ]] ; then
|
||||
@ -416,7 +416,7 @@ do
|
||||
read -r -u9 _
|
||||
read -r -u9 _ _ chapter
|
||||
|
||||
# The formating of the chapters names and the file names.
|
||||
# The formatting of the chapters names and the file names.
|
||||
# Chapter names are used in a few place.
|
||||
chapter_title="${title}-$(printf %0${#chaptercount}d $chapternum) ${chapter}"
|
||||
chapter_file="${output_directory}/${chapter_title}.${extension}"
|
||||
@ -434,7 +434,7 @@ do
|
||||
|
||||
# Extract chapter by time stamps start and finish of chapter.
|
||||
# This extracts based on time stamps start and end.
|
||||
log "Spliting chapter ${chapternum} start:${chapter_start%?}(s) end:${chapter_end}(s)"
|
||||
log "Splitting chapter ${chapternum} start:${chapter_start%?}(s) end:${chapter_end}(s)"
|
||||
</dev/null ffmpeg -loglevel quiet -nostats -i "${output_file}" -i "${cover_file}" -ss "${chapter_start%?}" -to "${chapter_end}" -map 0:0 -map 1:0 -acodec "${codec}" ${id3_version_param} \
|
||||
-metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" -metadata track="${chapternum}" -metadata title="${chapter_title}" \
|
||||
-metadata:s:a title="${chapter_title}" -metadata:s:a track="${chapternum}" \
|
||||
@ -458,7 +458,7 @@ do
|
||||
fi
|
||||
done 9< "$metadata_file"
|
||||
|
||||
# Clean up of working directoy stuff.
|
||||
# Clean up of working directory stuff.
|
||||
rm "${output_file}"
|
||||
log "Done creating chapters for ${output_directory}."
|
||||
else
|
||||
|
10
README.md
10
README.md
@ -36,7 +36,7 @@ bash AAXtoMP3 [-f|--flac] [-o|--opus] [-a|-aac] [-s|--single] [-c|--chaptered] [
|
||||
|
||||
## Options
|
||||
* **-f** or **--flac** Flac Encoding and Produces a single file.
|
||||
* **-o** or **--opus** Ogg/Opus Encoding defaults to multiple file output by chapter. The extention is .ogg
|
||||
* **-o** or **--opus** Ogg/Opus Encoding defaults to multiple file output by chapter. The extension is .ogg
|
||||
* **-a** or **--aac** AAC Encoding and produce a m4a single files output.
|
||||
* **-A** or **--authcode <AUTHCODE>** for this execution of the command use the provided <AUTHCODE> to decode the AAX file.
|
||||
* **-n** or **--no-clobber** If set and the target directory already exists, AAXtoMP3 will exit without overwriting anything.
|
||||
@ -61,7 +61,7 @@ this string from a tool like
|
||||
|
||||
#### Specifying the AUTHCODE.
|
||||
In order of __precidence__.
|
||||
1. __--authcode [AUTHCODE]__ The command line option. With the highest precidence.
|
||||
1. __--authcode [AUTHCODE]__ The command line option. With the highest precedence.
|
||||
2. __.authcode__ If this file is placed in the current working directory and contains only the authcode it is used if the above is not.
|
||||
3. __~/.authcode__ a global config file for all the tools. And is used as the default if none of the above are specified.
|
||||
__Note:__ At least one of the above must be exist. 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.
|
||||
@ -71,7 +71,7 @@ __Note:__ At least one of the above must be exist. The code must also match the
|
||||
* Produces 1 or more mp3 files for the AAX title.
|
||||
* The default mode is **chaptered**
|
||||
* If you want a mp3 file per chapter do not use the -single option.
|
||||
* A m3u playlist file will also be created in this instance in the case of **default** chaptered ouput.
|
||||
* A m3u playlist file will also be created in this instance in the case of **default** chaptered output.
|
||||
|
||||
### Ogg/Opus Encoding
|
||||
* Can be done by using the **-o** or **--opus** command line switches
|
||||
@ -96,7 +96,7 @@ __Note:__ At least one of the above must be exist. The code must also match the
|
||||
* M4A is a container that is meant to hold music and is typically of a higher bitrate.
|
||||
* M4B is a container that is meant to hold audiobooks and is typically has bitrates of 64k and 32k.
|
||||
* Both formats are chaptered
|
||||
* Both support coverart internall
|
||||
* Both support coverart internal
|
||||
* The default mode is **single**
|
||||
|
||||
### Validating AAX files
|
||||
@ -109,7 +109,7 @@ __Note:__ At least one of the above must be exist. The code must also match the
|
||||
1. entire file is valid and complete. _only executed with the **--validate** option._
|
||||
|
||||
### Defaults
|
||||
* Default out put directory is the base directoy of each file listed. Plus the genre, Artist and Title of the Audio Book.
|
||||
* Default out put directory is the base directory of each file listed. Plus the genre, Artist and Title of the Audio Book.
|
||||
* The default codec is mp3
|
||||
* The default output is by chapter.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user