--- /dev/null
+#!/usr/bin/env bash
+
+die() {
+ echo $@
+ exit 1
+}
+
+DIR="${1}"
+[ x"${DIR}" == x ] && die "You must supply a directory to albumize"
+
+# Check for invalid files
+find "$DIR" -not -name '*.mp4' | while read $FILE; do
+ die "Found invalid file $FILE"
+done
+
+# Convert files to mp3
+for FILE in "${DIR}"/*.mp4; do
+ mp4-to-mp3.sh "${FILE}" || die "mp4-to-mp3.sh ${FILE} failed"
+ BASE="$(dirname "${FILE}")/$(basename "${FILE}" .mp4)"
+ mv -f "${BASE}.mp4.mp3" "${BASE}.mp3" || \
+ die "failed to rename ${BASE}.mp4.mp3 to ${BASE}.mp3"
+done
+
+NUM_MP3=$(find "$DIR" -type f -name '*.mp3' | wc -l)
+NUM_NON_MP3=$(find "$DIR" -type f -not -name '*.mp3' | wc -l)
+[ $NUM_MP3 -eq $NUM_NON_MP3 ] || die "found $NUM_MP3 mp3s, \
+but $NUM_NON_MP3 non-mp3 files."
+
+# Remove non-mp3 files
+rm "${DIR}/"*.mp4
+
+# Add id3 labels to files
+tagger.py "${DIR}"