Skip to content

Instantly share code, notes, and snippets.

@benpickles
Created February 11, 2011 13:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save benpickles/822353 to your computer and use it in GitHub Desktop.
Save benpickles/822353 to your computer and use it in GitHub Desktop.
Convert multiple media files to MP3 and add them to iTunes in one line
#!/usr/bin/env sh
if [ $# -eq 0 ]; then
cat <<USAGE
Convert multiple media files to MP3 and add them to iTunes in one line.
Usage:
$ 2mp3 list of files to convert
USAGE
else
for path in "$@"; do
name=$(basename $path)
name=${name%.*}
mp3="$name.mp3"
ffmpeg -i "$path" -f mp3 "$mp3"
mv "$path" ~/.Trash
mv "$mp3" ~/Music/iTunes/iTunes\ Music/Automatically\ Add\ to\ iTunes/
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment