Added 'Adobe Connect' downloader script

This commit is contained in:
Pijus Kamandulis 2020-03-08 12:12:21 +02:00
parent f6cd1a0157
commit 163e1c08a0
2 changed files with 23 additions and 0 deletions

4
misc/README.md Normal file
View File

@ -0,0 +1,4 @@
# /sysadmin/misc
#### Random scripts to automate tasks
## Scripts
* `ac_downloader.sh` - Download stuff from 'Adobe Connect'

19
misc/ac_downloader.sh Executable file
View File

@ -0,0 +1,19 @@
#!/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