Copying download link to curl does not work

0

0

I'm downloading an ISO image with Opera browser on Linux:

Opera download

I get the download link by right click:

Right click to get download link

Then I want to use curl on Linux console, but I cannot:

curl -O https://software-download.microsoft.com/db/Win10_1903_V2_English_x64.iso?t=3bbd00d6-f352-44fe-8d54-39823648e16f&e=1570698933&h=9209eec4d6644bf387d305a0fcc20fd3

The curl command just returns almost immediately without any useful download. I wonder why this is happening?

user3405291

Posted 2019-10-09T09:35:52.483

Reputation: 199

Does Opera provide some Network tab in its Developer Tools, which may provide some "Copy as cURL" command? You're probably missing some cookies. See https://developers.google.com/web/updates/2015/05/replay-a-network-request-in-curl to see what I mean for Chrome. Please edit your title to summarize the question.

– Arjan – 2019-10-09T09:46:16.133

Depending on your console it will try to interpret the &. Check what happens if you wrap the link in quotes. – Seth – 2019-10-09T09:48:41.227

Answers

4

Your URL contains ?, = and & which may be special characters for your shell. They will be interpreted and, for example, put the command into a background job. Run jobs to see if there is a curl command still running.

Two solutions:

  • Wrap the https://… URL in double quotes
  • Escape the special characters with a \

So, both should work:

curl -O "https://software-download.microsoft.com/db/Win10_1903_V2_English_x64.iso?t=3bbd00d6-f352-44fe-8d54-39823648e16f&e=1570698933&h=9209eec4d6644bf387d305a0fcc20fd3"

curl -O https://software-download.microsoft.com/db/Win10_1903_V2_English_x64.iso\?t\=3bbd00d6-f352-44fe-8d54-39823648e16f\&e\=1570698933\&h\=9209eec4d6644bf387d305a0fcc20fd3

slhck

Posted 2019-10-09T09:35:52.483

Reputation: 182 472