Add a youtube-dl example

This commit is contained in:
Matt McWilliams 2021-05-09 11:07:26 -04:00
parent 2787ae31e6
commit 20604fdc7d
2 changed files with 29 additions and 1 deletions

View File

@ -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>
#
#####################################################

28
stream/download.sh Normal file
View File

@ -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}"