Add opt-in insecure TLS mode to dop20 downloader

This commit is contained in:
2025-12-15 23:13:31 +01:00
parent fd6b9d7a10
commit 0c91691306

View File

@@ -16,6 +16,12 @@ fi
mkdir -p "$OUT_JP2" "$OUT_J2W" "$OUT_META"
DOP20_CURL_OPTS=()
if [[ "${DOP20_INSECURE:-}" == "1" ]]; then
DOP20_CURL_OPTS+=("-k")
echo "Warning: DOP20_INSECURE=1 set — skipping TLS verification." >&2
fi
while IFS= read -r url; do
[[ -z "$url" || "$url" =~ ^# ]] && continue
fname="${url##*/}"
@@ -30,7 +36,7 @@ while IFS= read -r url; do
continue
fi
echo "Downloading $fname"
curl -fL "$url" -o "$dest"
curl -fL "${DOP20_CURL_OPTS[@]}" "$url" -o "$dest"
done < "$LIST"
echo "Done. Files in $OUT_JP2, $OUT_J2W, $OUT_META"