Add a youtube-dl example

main
Matt McWilliams 1 year ago
parent 2787ae31e6
commit 20604fdc7d
  1. 2
      stream/audio.sh
  2. 28
      stream/download.sh

@ -5,7 +5,7 @@
# This script will download a video and extract the
# audio as an .mp3.
#
# Usage: bash stream/rtmp.sh <input video> <rtmp url>
# Usage: bash stream/audio.sh <url> <output dir>
#
#####################################################

@ -0,0 +1,28 @@
#!/bin/bash -e
#####################################################
#
# This script will download a video at its highest
# quality available.
#
# Usage: bash stream/download.sh <url> <output dir>
#
#####################################################
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}"
Loading…
Cancel
Save