From 163e1c08a07f290fc48b39bae243defd7c3ac1d1 Mon Sep 17 00:00:00 2001 From: Pijus Kamandulis Date: Sun, 8 Mar 2020 12:12:21 +0200 Subject: [PATCH] Added 'Adobe Connect' downloader script --- misc/README.md | 4 ++++ misc/ac_downloader.sh | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 misc/README.md create mode 100755 misc/ac_downloader.sh diff --git a/misc/README.md b/misc/README.md new file mode 100644 index 0000000..b7fbcef --- /dev/null +++ b/misc/README.md @@ -0,0 +1,4 @@ +# /sysadmin/misc +#### Random scripts to automate tasks +## Scripts +* `ac_downloader.sh` - Download stuff from 'Adobe Connect' diff --git a/misc/ac_downloader.sh b/misc/ac_downloader.sh new file mode 100755 index 0000000..2daf154 --- /dev/null +++ b/misc/ac_downloader.sh @@ -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 +