* yet another urlencoding fix
This commit is contained in:
parent
a422e84b6f
commit
49482466ac
|
@ -25,9 +25,9 @@ if [[ ! -d mods ]]; then
|
||||||
|
|
||||||
url="$(curl -s -H "x-api-key: $(cat $token)" \
|
url="$(curl -s -H "x-api-key: $(cat $token)" \
|
||||||
"https://api.curseforge.com/v1/mods/$proj/files/$file" \
|
"https://api.curseforge.com/v1/mods/$proj/files/$file" \
|
||||||
| jq -r '.data.downloadUrl' \
|
| jq -r '.data.downloadUrl')"
|
||||||
| sed 's/\[/%5b/g;s/\]/%5d/g;'"s/'/%27/g;s/ /%20/g")" #' handling for bad URLs
|
url_fix="$(sed 's/\[/%5b/g;s/\]/%5d/g;'"s/'/%27/g;s/ /%20/g" <<< "$url")" #' handling for bad URLs
|
||||||
curl -s -o $(basename "$url") -L "$url" || echo "Failed to download $url" &
|
curl -s -o "$(basename "$url")" -L "$url_fix" || echo "Failed to download $url" &
|
||||||
printf "."
|
printf "."
|
||||||
done <<< "$mods"
|
done <<< "$mods"
|
||||||
wait
|
wait
|
||||||
|
|
Loading…
Reference in a new issue