Compare commits

...

3 Commits

Author SHA1 Message Date
Kroese
e8cf9651c2
fix: Ignore case when selecting platform 2025-09-14 10:59:10 +02:00
Kroese
e2c0a40e13
feat: Allow to disable download methods 2025-09-14 09:09:45 +02:00
Kroese
0bee329b7b
feat: Print URL In debug mode 2025-09-14 09:02:30 +02:00
2 changed files with 41 additions and 17 deletions

View File

@ -1313,6 +1313,8 @@ isMido() {
local lang="$2"
local sum
[[ "${MIDO:-}" != [Yy1]* ]] && return 1
sum=$(getMido "$id" "en" "sum")
[ -n "$sum" ] && return 0
@ -1324,6 +1326,8 @@ isESD() {
local id="$1"
local lang="$2"
[[ "${ESD:-}" != [Yy1]* ]] && return 1
case "${id,,}" in
"win11${PLATFORM,,}" | "win10${PLATFORM,,}" )
return 0

View File

@ -264,10 +264,9 @@ download_windows_eval() {
}
case "$enterprise_type" in
"enterprise" )
iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1)
;;
"iot" )
"ltsc" )
"enterprise" )
if [[ "${PLATFORM,,}" == "x64" ]]; then
iso_download_link=$(echo "$iso_download_links" | head -n 1)
fi
@ -275,9 +274,6 @@ download_windows_eval() {
iso_download_link=$(echo "$iso_download_links" | head -n 2 | tail -n 1)
fi
;;
"ltsc" )
iso_download_link=$(echo "$iso_download_links" | head -n 4 | tail -n 1)
;;
"server" )
iso_download_link=$(echo "$iso_download_links" | head -n 1)
;;
@ -323,8 +319,7 @@ getWindows() {
case "${version,,}" in
"win11${PLATFORM,,}" ) ;;
"win11${PLATFORM,,}-enterprise-iot"* ) ;;
"win11${PLATFORM,,}-enterprise-ltsc"* ) ;;
"win11${PLATFORM,,}-enterprise"* ) ;;
* )
if [[ "${PLATFORM,,}" != "x64" ]]; then
error "No download for the ${PLATFORM^^} platform available for $edition!"
@ -399,7 +394,7 @@ getESD() {
local culture
local language
local editionName
local winCatalog size
local winCatalog
culture=$(getLanguage "$lang" "culture")
winCatalog=$(getCatalog "$version" "url")
@ -441,32 +436,57 @@ getESD() {
error "Failed to find $xFile in $wFile!" && return 1
fi
local edQuery='//File[Architecture="'${PLATFORM}'"][Edition="'${editionName}'"]'
local edQuery='//File[Architecture="'${PLATFORM,,}'"][Edition="'${editionName}'"]'
local result=$(xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" 2>/dev/null)
if [ -z "$result" ]; then
edQuery='//File[Architecture="'${PLATFORM^^}'"][Edition="'${editionName}'"]'
result=$(xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" 2>/dev/null)
if [ -z "$result" ]; then
desc=$(printEdition "$version" "$desc")
language=$(getLanguage "$lang" "desc")
error "No download link available for $desc!" && return 1
fi
fi
echo -e '<Catalog>' > "$dir/$fFile"
xmllint --nonet --xpath "${edQuery}" "$dir/$xFile" >> "$dir/$fFile" 2>/dev/null
echo "$result" >> "$dir/$fFile"
echo -e '</Catalog>'>> "$dir/$fFile"
xmllint --nonet --xpath "//File[LanguageCode=\"${culture,,}\"]" "$dir/$fFile" >"$dir/$eFile"
result=$(xmllint --nonet --xpath "//File[LanguageCode=\"${culture,,}\"]" "$dir/$fFile" 2>/dev/null)
size=$(stat -c%s "$dir/$eFile")
if ((size<20)); then
if [ -z "$result" ]; then
desc=$(printEdition "$version" "$desc")
language=$(getLanguage "$lang" "desc")
error "No download in the $language language available for $desc!" && return 1
fi
echo "$result" > "$dir/$eFile"
local tag="FilePath"
ESD=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g")
ESD=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g" 2>/dev/null)
if [ -z "$ESD" ]; then
error "Failed to find ESD URL in $eFile!" && return 1
fi
tag="Sha1"
ESD_SUM=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g")
ESD_SUM=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g" 2>/dev/null)
if [ -z "$ESD_SUM" ]; then
error "Failed to find ESD checksum in $eFile!" && return 1
fi
tag="Size"
ESD_SIZE=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g")
ESD_SIZE=$(xmllint --nonet --xpath "//$tag" "$dir/$eFile" | sed -E -e "s/<[\/]?$tag>//g" 2>/dev/null)
if [ -z "$ESD_SIZE" ]; then
error "Failed to find ESD filesize in $eFile!" && return 1
fi
rm -rf "$dir"
return 0