From 0287fe274ef3e913f7aa929627bb6c04a7a16c7b Mon Sep 17 00:00:00 2001 From: William Bulin Date: Sat, 13 Aug 2022 15:05:52 +0200 Subject: [PATCH] Fixed Windows 10/11 ISO downloads * Closes #41 * Closes #42 --- Fido.ps1 | 79 +++++++++++++++++++++----------------------------------- 1 file changed, 30 insertions(+), 49 deletions(-) diff --git a/Fido.ps1 b/Fido.ps1 index 425fcba..3d311f7 100644 --- a/Fido.ps1 +++ b/Fido.ps1 @@ -1,5 +1,5 @@ # -# Fido v1.30 - Feature ISO Downloader, for retail Windows images and UEFI Shell +# Fido v1.31 - Feature ISO Downloader, for retail Windows images and UEFI Shell # Copyright © 2019-2022 Pete Batard # Command line support: Copyright © 2021 flx5 # ConvertTo-ImageSource: Copyright © 2016 Chris Carter @@ -49,14 +49,6 @@ param( ) #endregion -# 2022-08-12: This script is currently not operational for Windows ISOs since Microsoft -# altered their website in a manner that is hostile to our queries. -# Please see https://github.com/pbatard/Fido/issues/41 for details. -# If you think you can help, set the following variable to $False and try your best! ;) -$Disable_Windows_ISOs = $True -$Disable_Windows_Msg = "Download of Windows ISOs is no longer available due to Microsoft having altered their website to prevent it. :(`r`n`r`n" ` - + "If you think you can help, please see:`r`nhttps://github.com/pbatard/Fido/issues/41" - try { [Console]::OutputEncoding = [System.Text.Encoding]::UTF8 } catch {} @@ -801,8 +793,9 @@ function Get-Windows-Download-Links([int]$SelectedVersion, [int]$SelectedRelease try { $Is64 = [Environment]::Is64BitOperatingSystem - $r = Invoke-WebRequest -Method Post -UseBasicParsing -UserAgent $UserAgent -WebSession $Session $url -# Write-Host $r + # Must add a referer for POST requests, else Microsoft's servers will deny them + $ref = "https://www.microsoft.com/software-download/windows11" + $r = Invoke-WebRequest -Method Post -Headers @{"Referer" = $ref} -UseBasicParsing -UserAgent $UserAgent -WebSession $Session $url if ($r -match "errorModalMessage") { Throw-Error -Req $r -Alt "Could not retrieve architectures from server" } @@ -896,11 +889,6 @@ if ($Cmd) { exit 1 } - if ($Disable_Windows_ISOs -and $winVersionId -lt 3) { - Write-Host $Disable_Windows_Msg - exit 1 - } - # Windows Version selection $releases = Get-Windows-Releases $winVersionId if ($Rel -eq "List") { @@ -1066,14 +1054,7 @@ $Continue.add_click({ $XMLForm.Title = Get-Translation($English[12]) Refresh-Control($XMLForm) if ($WindowsVersion.SelectedValue.Version.StartsWith("Windows") -and $WindowsVersion.SelectedValue.Version -ne "Windows 7") { - if ($Disable_Windows_ISOs) { - Error($Disable_Windows_Msg) - $script:ExitCode = 1 - $XMLForm.Close() - break; - } else { - Check-Locale - } + Check-Locale } $releases = Get-Windows-Releases $WindowsVersion.SelectedValue.Index $script:WindowsRelease = Add-Entry $Stage "Release" $releases @@ -1177,8 +1158,8 @@ exit $ExitCode # SIG # Begin signature block # MIIkWAYJKoZIhvcNAQcCoIIkSTCCJEUCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG -# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBIbXdlyM4YkMuO -# 1TiheNA9UI6/439UbwfpoVydyjKG6qCCElkwggVvMIIEV6ADAgECAhBI/JO0YFWU +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAiZT+pEprxewVE +# +Vpi/MqR7ClFwopa4p2nE7rw5/vvS6CCElkwggVvMIIEV6ADAgECAhBI/JO0YFWU # jTanyYqJ1pQWMA0GCSqGSIb3DQEBDAUAMHsxCzAJBgNVBAYTAkdCMRswGQYDVQQI # DBJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoM # EUNvbW9kbyBDQSBMaW1pdGVkMSEwHwYDVQQDDBhBQUEgQ2VydGlmaWNhdGUgU2Vy @@ -1281,22 +1262,22 @@ exit $ExitCode # aWMgQ29kZSBTaWduaW5nIENBIEVWIFIz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