sysadmin/misc/ac_downloader.sh
2020-03-08 12:12:21 +02:00

20 lines
435 B
Bash
Executable File

#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: $0 https://my.adobeconnect.com/video_id";
exit 1
fi
valid='http[s:\/]+[a-zA-Z0-9.]+\/[a-zA-Z0-9]+$';
if [[ $1 =~ $valid ]]; then
readarray -d / -t str_arr <<< "$1"
id="$(echo -e "${str_arr[3]}" | tr -d '[:space:]')";
dl_url="$1/output/$id.zip?download=zip";
echo "Downloading $dl_url";
wget -O "$id.zip" $dl_url;
else
echo "URL is not the correct format";
exit 1;
fi