The Wayback Machine - https://web.archive.org/web/20220817230117/https://github.com/pbatard/Fido/pull/42
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Windows ISO downloads #42

Closed
wants to merge 1 commit into from

Conversation

williambulin
Copy link
Contributor

@williambulin williambulin commented Aug 13, 2022

Fix for issue #41, the request now requires the Referer to be set properly.

@williambulin williambulin changed the title Fixed Windows 11 downloads Fixed Windows ISO downloads Aug 13, 2022
@williambulin williambulin marked this pull request as ready for review Aug 13, 2022
@williambulin
Copy link
Contributor Author

williambulin commented Aug 13, 2022

Just specifying: while the referer contains 'windows11', it does indeed work for Windows 10 and 8.1 as well.

@@ -801,7 +801,7 @@ function Get-Windows-Download-Links([int]$SelectedVersion, [int]$SelectedRelease

try {
$Is64 = [Environment]::Is64BitOperatingSystem
$r = Invoke-WebRequest -Method Post -UseBasicParsing -UserAgent $UserAgent -WebSession $Session $url
$r = Invoke-WebRequest -Method Post -Headers @{'Referer' = 'https://www.microsoft.com/software-download/windows11'} -UseBasicParsing -UserAgent $UserAgent -WebSession $Session $url

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using the windows version variable: $WindowsVersions[$SelectedVersion][0][1]

Copy link
Owner

@pbatard pbatard Aug 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want to do that for now, because https://www.microsoft.com/software-download/windows8.1 is not a valid page, and that's the URL we'd get for 8.1...
As long as Microsoft's server don't seem to care about the version, using window11 should be good enough.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with that KISS approach even though this edge case with 8.1 / windows8ISO would be easily handlebar.

@pbatard pbatard closed this in 0287fe2 Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants