From c0729bbb6425d888423e68055bdbce8ec2095a3b Mon Sep 17 00:00:00 2001 From: Kroese Date: Fri, 20 Dec 2024 05:36:46 +0100 Subject: [PATCH] fix: Update download links --- src/mido.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mido.sh b/src/mido.sh index 1b628a6..e03c9f5 100644 --- a/src/mido.sh +++ b/src/mido.sh @@ -608,7 +608,7 @@ getMG() { pattern="10_iot_enterprise_ltsc" ;; esac - + fi local body="" @@ -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