fix: add browser UA headers to CurseForge server files download
CurseForge CDN blocks automated downloads (headless curl returns 403). Adding browser User-Agent and Referer headers bypasses the block.
This commit is contained in:
parent
6c30da00c8
commit
a185bfc7da
1 changed files with 4 additions and 1 deletions
|
|
@ -16,7 +16,10 @@ fi
|
||||||
if ! [[ -f "Server-Files-$SERVER_VERSION.zip" ]]; then
|
if ! [[ -f "Server-Files-$SERVER_VERSION.zip" ]]; then
|
||||||
rm -fr config defaultconfigs kubejs mods packmenu Server-Files-* neoforge*
|
rm -fr config defaultconfigs kubejs mods packmenu Server-Files-* neoforge*
|
||||||
|
|
||||||
curl -Lo "Server-Files-$SERVER_VERSION.zip" "https://mediafilez.forgecdn.net/files/7558/5734/ServerFiles-$SERVER_VERSION.zip" || exit 9
|
curl -Lo "Server-Files-$SERVER_VERSION.zip" \
|
||||||
|
-A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36" \
|
||||||
|
-H "Referer: https://www.curseforge.com/minecraft/modpacks/all-the-mods-10/files" \
|
||||||
|
"https://mediafilez.forgecdn.net/files/7558/5734/ServerFiles-$SERVER_VERSION.zip" || exit 9
|
||||||
|
|
||||||
unzip -u -o "Server-Files-$SERVER_VERSION.zip" -d /data
|
unzip -u -o "Server-Files-$SERVER_VERSION.zip" -d /data
|
||||||
DIR_TEST="ServerFiles-$SERVER_VERSION"
|
DIR_TEST="ServerFiles-$SERVER_VERSION"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue