fix: Update download links (#980)

This commit is contained in:
Kroese 2024-12-20 15:43:37 +01:00 committed by GitHub
parent c82725ec61
commit 6825b6a45a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 5 deletions

View file

@ -502,7 +502,10 @@ fromFile() {
local file="${1,,}"
local arch="${PLATFORM,,}"
case "${file// /_}" in
file="${file//-/_}"
file="${file// /_}"
case "$file" in
*"_x64_"* | *"_x64."*)
arch="x64"
;;
@ -517,7 +520,7 @@ fromFile() {
local add=""
[[ "$arch" != "x64" ]] && add="$arch"
case "${file// /_}" in
case "$file" in
"win7"* | "win_7"* | *"windows7"* | *"windows_7"* )
id="win7${arch}"
;;

View file

@ -620,10 +620,11 @@ getMG() {
}
local list=""
list=$(echo "$body" | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep -i '\.iso$')
list=$(echo "$body" | xmllint --html --nonet --xpath "//a[contains(text(), '.iso')]" - 2>/dev/null)
local result=""
result=$(echo "$list" | grep -i "${platform}" | grep "${pattern}" | grep -i -m 1 "${locale,,}_")
result=$(echo "$result" | sed -r 's/.*href="([^"]+).*/\1/g')
if [ -z "$result" ]; then
if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then