mirror of
https://github.com/dockur/windows.git
synced 2025-10-28 11:45:50 +00:00
feat: Additional download mirrors
This commit is contained in:
parent
216107fac1
commit
6df6fe037f
1 changed files with 162 additions and 133 deletions
37
src/mido.sh
37
src/mido.sh
|
|
@ -441,17 +441,19 @@ getMG() {
|
||||||
local user_agent=""
|
local user_agent=""
|
||||||
|
|
||||||
user_agent=$(get_agent)
|
user_agent=$(get_agent)
|
||||||
language=$(getLanguage "$lang" "name")
|
language=$(getLanguage "$lang" "desc")
|
||||||
culture=$(getLanguage "$lang" "culture")
|
culture=$(getLanguage "$lang" "culture")
|
||||||
|
|
||||||
local msg="Requesting download link from massgrave.dev..."
|
local msg="Requesting download link from massgrave.dev..."
|
||||||
info "$msg" && html "$msg"
|
info "$msg" && html "$msg"
|
||||||
|
|
||||||
local pattern=""
|
local pattern=""
|
||||||
local platform="x64"
|
|
||||||
local locale="${culture,,}"
|
local locale="${culture,,}"
|
||||||
|
local platform="${PLATFORM,,}"
|
||||||
local url="https://massgrave.dev/"
|
local url="https://massgrave.dev/"
|
||||||
|
|
||||||
|
if [[ "${PLATFORM,,}" != "arm64" ]]; then
|
||||||
|
|
||||||
case "${version,,}" in
|
case "${version,,}" in
|
||||||
"win11${PLATFORM,,}" )
|
"win11${PLATFORM,,}" )
|
||||||
url+="windows_11_links"
|
url+="windows_11_links"
|
||||||
|
|
@ -582,6 +584,33 @@ getMG() {
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
case "${version,,}" in
|
||||||
|
"win11${PLATFORM,,}" | "win11${PLATFORM,,}-enterprise" | "win11${PLATFORM,,}-enterprise-eval" )
|
||||||
|
url+="windows_arm_links"
|
||||||
|
pattern="11_business"
|
||||||
|
;;
|
||||||
|
"win11${PLATFORM,,}-ltsc" | "win11${PLATFORM,,}-enterprise-ltsc-eval" )
|
||||||
|
url+="windows_arm_links"
|
||||||
|
pattern="11_iot_enterprise_ltsc"
|
||||||
|
;;
|
||||||
|
"win10${PLATFORM,,}" | "win10${PLATFORM,,}-enterprise" | "win10${PLATFORM,,}-enterprise-eval" )
|
||||||
|
url+="windows_arm_links"
|
||||||
|
pattern="Pro_10"
|
||||||
|
locale="$language"
|
||||||
|
[[ "$locale" == "Chinese" ]] && locale="ChnSimp"
|
||||||
|
[[ "$locale" == "Chinese HK" ]] && locale="ChnTrad"
|
||||||
|
[[ "$locale" == "Chinese TW" ]] && locale="ChnTrad"
|
||||||
|
;;
|
||||||
|
"win10${PLATFORM,,}-ltsc" | "win10${PLATFORM,,}-enterprise-ltsc-eval" )
|
||||||
|
url+="windows_arm_links"
|
||||||
|
pattern="10_iot_enterprise_ltsc"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
local body=""
|
local body=""
|
||||||
|
|
||||||
[[ "$DEBUG" == [Yy1]* ]] && echo "Parsing download page: ${url}"
|
[[ "$DEBUG" == [Yy1]* ]] && echo "Parsing download page: ${url}"
|
||||||
|
|
@ -591,10 +620,10 @@ getMG() {
|
||||||
}
|
}
|
||||||
|
|
||||||
local list=""
|
local list=""
|
||||||
list=$(echo "$body" | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep '\.iso$')
|
list=$(echo "$body" | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | grep -i '\.iso$')
|
||||||
|
|
||||||
local result=""
|
local result=""
|
||||||
result=$(echo "$list" | grep "${platform}" | grep "${pattern}" | grep -m 1 "${locale,,}_")
|
result=$(echo "$list" | grep -i "${platform}" | grep "${pattern}" | grep -i -m 1 "${locale,,}_")
|
||||||
|
|
||||||
if [ -z "$result" ]; then
|
if [ -z "$result" ]; then
|
||||||
if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then
|
if [[ "${lang,,}" != "en" ]] && [[ "${lang,,}" != "en-"* ]]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue