public
Last active

Convert multiple media files to MP3 and add them to iTunes in one line

  • Download Gist
2mp3
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.