Skip to content

Instantly share code, notes, and snippets.

@jsuereth
Created June 20, 2013 16:37
Show Gist options
  • Select an option

  • Save jsuereth/5824361 to your computer and use it in GitHub Desktop.

Select an option

Save jsuereth/5824361 to your computer and use it in GitHub Desktop.
scalawags youtube -> wav download script
#!/bin/bash
if test "$#" != "2"; then
echo "Usage: $0 <url> <directory>"
exit 1
fi
url=$1
directory=$2
if test ! -d "$directory"; then
mkdir -p "$directory"
fi
yfile=${directory}/youtube.flv
afile=${directory}/youtube.wav
# DOWNLOAD
youtube-dl -o "$yfile" "$url"
# Translate to WAV
avconv -i "$yfile" "$afile"
# if we're successful, delete the huge youtube file.
# rm "$yfile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment