pytubedl/pytubedl/dl_wrapper.sh
kleph 53cfd33f0f
All checks were successful
continuous-integration/drone/push Build is passing
Replace deprecated -t option in youtube-dl command line
2021-05-26 22:29:57 +02:00

29 lines
393 B
Bash
Executable file

#!/bin/bash
# wrapper around youtube-dl
DOWNLOAD_DIR="/mnt/incoming/pytubedl/"
usage(){
echo "$0 <url>"
exit 1
}
# check args
if [ -z "$1" ]; then
usage
fi
url="$1"
# check process
pgrep youtube-dl
ret=$?
if [ ${ret} -eq 0 ]; then
echo "Another youtube-dl process is already running."
exit 2
fi
pushd ${PWD}
cd "${DOWNLOAD_DIR}"
youtube-dl -o "%(title)s-%(id)s.%(ext)s" "$url"
popd