mattieb / download-windows-esd

download Windows 11 ESDs directly from Microsoft
MIT License
49 stars 2 forks source link

Change curl to wget #3

Open elijahgagne opened 1 week ago

elijahgagne commented 1 week ago

I ran into an issue where the download-windows-esd script uses curl to download the file. I'd get to 100%, but it would then error with

curl: (18) transfer closed with 26485 bytes remaining to read

I changed the script to use wget and that issue was resolved. Here's my full notes on what worked for me.

brew install wimlib

cd ~/Downloads
git clone https://github.com/mattieb/download-windows-esd.git
git clone https://github.com/mattieb/windows-esd-to-iso.git

sed -i '' 's@curl -#OR -C - "${url}"@wget "${url}"@g' ./download-windows-esd/download-windows-esd

./download-windows-esd/download-windows-esd download en-us Enterprise ARM64

./windows-esd-to-iso/windows-esd-to-iso $(ls *.esd)

Maybe just an issue on my end so you can close this, but I figured I'd post it in case it helps someone else.

Thanks! -EWG

mattieb commented 5 days ago

Even if it is just on your end, I was curious about it. 🙂

I have not done a full download in awhile since the images haven't updated, though every so often I do run the script in my directory with already-downloaded files; the resume will hit 100% immediately if they already exist, then checksum.

So I tried a brand-new download of one of the en-us images, and still didn't have the problem.

Curious what your download parameters are—i.e. language, edition, architecture?

elijahgagne commented 4 days ago

Hmm, I'm not immediately sure how I would tell what HTTP headers curl is using. I guess I could do a tcpdump. Let me know if you happen to know an easy way to figure that out.

Here's me reproducing it outside of your code:

[d92495j:Downloads] % curl -#OR -C - "http://dl.delivery.mp.microsoft.com/filestreamingservice/files/3586ef88-7144-42e3-ba81-bfa35cd48762/22631.2861.231204-0538.23H2_NI_RELEASE_SVC_REFRESH_CLIENTBUSINESS_VOL_A64FRE_en-us.esd"
#########################################################################################################################################################  100.0%curl: (18) transfer closed with 3317 bytes remaining to read
[d92495j:Downloads] 4m1s 18 %
mattieb commented 3 days ago

Ah, no, I was asking about the parameters supplied to the script. But I can tell from the URL. Mostly I was curious if you were downloading an image that I had not, which isn't the case.

I can run that same command line without issue; I'm inclined to think it's environmental, but also, I think a nice thing to do would be to add another couple subcommands:

  1. "url", which, instead of downloading, will output a download URL, and
  2. "shasum", which would output the checksum in a "shasum -c"-compatible-manner (very important especially since the downloads run over plain HTTP!)

I don't know if I'll do these anytime soon, but I'd like to.

elijahgagne commented 2 days ago

Yeah those would be nice to haves. In regards to #1, I don't have strong feelings here, but I will say that I do like how wget shows the URL in case you need it. I was trying to make the argument for you to switch from curl to wget and I came across https://stackoverflow.com/questions/636339/what-is-better-curl-or-wget where one of the commenters posted about how curl will sometimes result in error 18 - transfer closed, whereas wget does not.

For #2, I can't believe that Microsoft is hosted that over HTTP in 2024! Wow