diff --git a/downloadBash.sh b/downloadBash.sh index 2a69ea8..ee2d4eb 100755 --- a/downloadBash.sh +++ b/downloadBash.sh @@ -49,11 +49,12 @@ mkdir -p "${OUTDIR}" || { # https://www.ietf.org/rfc/rfc2396.txt # 2.4.3. Excluded US-ASCII Characters m3u8_manifest_urls_and_metadata=$( + # shellcheck disable=SC2312 wget --no-verbose --quiet -O- --header="authorization: Bearer ${BASE64_BEARER_TOKEN}" "${API_URL}" | jq -r '.value[] | .name + ">" + .media.duration[2:] + ">" + (.playbackUrls | map(select(.mimeType == "application/vnd.apple.mpegurl")) | .[].playbackUrl)' ) -[ -z "${m3u8_manifest_urls_and_metadata}" ] && { +[[ -z "${m3u8_manifest_urls_and_metadata}" ]] && { printf '\033[31m%s\033[m\n' 'Error GETting manifest urls (response empty) or Bearer token invalid/expired. Exiting.' exit 3 } @@ -71,6 +72,7 @@ for m3u8_manifest_url_and_metadata in ${m3u8_manifest_urls_and_metadata}; do printf '\033[32m%s\033[m\n' "Download '${filepath}' (${idx}/${total})" + # shellcheck disable=SC2312 ffmpeg -hide_banner \ -loglevel error \ -headers "authorization: Bearer ${BASE64_BEARER_TOKEN}" \ diff --git a/downloadPOSIX.sh b/downloadPOSIX.sh index 06adb24..49406b0 100755 --- a/downloadPOSIX.sh +++ b/downloadPOSIX.sh @@ -19,7 +19,9 @@ IFS=" " POSIXLY_CORRECT='1' COMMANDS_='builtin unalias unset read printf command exit type . tr mkdir wc sed grep xargs ffmpeg jq wget' +# shellcheck disable=SC2086 \unset -f -- ${COMMANDS_} 2>/dev/null +# shellcheck disable=SC2086 \unalias -- ${COMMANDS_} 2>/dev/null || true command -v -- wget >/dev/null 2>&1 || { @@ -47,7 +49,7 @@ OUTDIR='./videos' read -r API_URL <<- EOM https://euwe-1.api.microsoftstream.com/api/videos?\ -\$top=3\ +\$top=4\ &\ \$skip=0\ &\