From e80d49fee98d7daf7f8296c64833e301edfb8c12 Mon Sep 17 00:00:00 2001 From: hxyt88 <124854210+hxyt88@users.noreply.github.com> Date: Thu, 12 Feb 2026 10:14:33 +0800 Subject: [PATCH] Update reinstall.sh --- reinstall.sh | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/reinstall.sh b/reinstall.sh index a0d5518..98f05f6 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -1662,16 +1662,22 @@ Continue with DD? fi fi else - iso=$(curl -L https://fnnas.com/ | grep -o -m1 'https://[^"]*\.iso') + # 手动指定从浏览器抓包获得的原始 ISO 链接 + raw_iso="https://iso.liveupdate.fnnas.com/x86_64/trim/fnos-1.1.19-1566.iso" - # curl 7.82.0+ - # curl -L --json '{"url":"'$iso'"}' https://www.fnnas.com/api/download-sign + # 调用签名接口,添加完整请求头(关键!) + iso=$(curl -sL \ + -H "Content-Type: application/json" \ + -H "Referer: https://fnnas.com/download" \ + -H "User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0 Safari/537.36" \ + -d "{\"url\":\"$raw_iso\"}" \ + https://fnnas.com/api/download-sign | \ + grep -o 'https://[^"]*\.iso' | head -n1) - iso=$(curl -L \ - -d '{"url":"'$iso'"}' \ - -H 'Content-Type: application/json' \ - https://www.fnnas.com/api/download-sign | - grep -o 'https://[^"]*') + # 如果 API 返回空,报错退出 + if [ -z "$iso" ]; then + error_and_exit "Failed to get signed download URL from fnnas.com API" + fi fi test_url "$iso" iso