download-frank-large-halogen: resume against the resolved CDN URL
curl drops the Range header across the HF /resolve/ 302, so '-C -' against the resolve URL pulls the 1 KB redirect body and exits 0 with the file still 14 MiB short (measured 2026-10-05). Resolve the effective URL first; the Xet CDN honors Range.
This commit is contained in:
1 parent
0900551317
commit
87695c5126
1 file changed
+8
-2
@@ -30,8 +30,14 @@ for i in "${!FILES[@]}"; do
|
|||||||
path="$DEST/$f"
|
path="$DEST/$f"
|
||||||
if [ "$VERIFY_ONLY" -eq 0 ]; then
|
if [ "$VERIFY_ONLY" -eq 0 ]; then
|
||||||
echo "FETCH $f -> $path"
|
echo "FETCH $f -> $path"
|
||||||
# -C - resumes a partial file; -f keeps HTTP errors fatal.
|
# HF answers /resolve/ with a 302 to the Xet CDN and curl DROPS the
|
||||||
curl -fL --retry 5 -C - -o "$path" "$BASE/$f"
|
# Range header across redirects — a naive -C - then "resumes" by
|
||||||
|
# pulling the ~1 KB redirect body (measured 2026-10-05: file frozen
|
||||||
|
# 14 MiB short, curl exit 0). Resolve the effective URL first, then
|
||||||
|
# resume against the CDN, which honors Range.
|
||||||
|
url=$(curl -sfIL -o /dev/null -w '%{url_effective}' "$BASE/$f") \
|
||||||
|
|| { echo "cannot resolve $BASE/$f" >&2; exit 1; }
|
||||||
|
curl -fL --retry 5 -C - -o "$path" "$url"
|
||||||
fi
|
fi
|
||||||
[ -f "$path" ] || { echo "MISSING $path (run without --verify-only)" >&2; exit 1; }
|
[ -f "$path" ] || { echo "MISSING $path (run without --verify-only)" >&2; exit 1; }
|
||||||
got="$(stat -c %s "$path")"
|
got="$(stat -c %s "$path")"
|
||||||
|
|||||||
Reference in new issue
Block a user