diff --git a/stream/audio.sh b/stream/audio.sh index 3cbb246..85ab883 100644 --- a/stream/audio.sh +++ b/stream/audio.sh @@ -5,7 +5,7 @@ # This script will download a video and extract the # audio as an .mp3. # -# Usage: bash stream/rtmp.sh +# Usage: bash stream/audio.sh # ##################################################### diff --git a/stream/download.sh b/stream/download.sh new file mode 100644 index 0000000..47e2d08 --- /dev/null +++ b/stream/download.sh @@ -0,0 +1,28 @@ +#!/bin/bash -e + +##################################################### +# +# This script will download a video at its highest +# quality available. +# +# Usage: bash stream/download.sh +# +##################################################### + +URL="${1}" + +if [ "${1}" == "" ]; then + echo "Please provide a URL to download" + exit 1 +fi + +if [ -d "${2}" ]; then + DIR="${2}" +else + echo "Please provide an output directory for your video file" + exit 2 +fi + +youtube-dl -f best \ + -o "${DIR}/%(title)s-%(id)s.%(ext)s" \ + "${URL}" \ No newline at end of file