当 url 带有参数时如何使用 wget 下载文件?

当 url 带有参数时如何使用 wget 下载文件?

URL 如下:

https://software-download.microsoft.com/db/Win10_21H1_English_x64.iso?t=52dbec9b-63f5-47e9-b4b2-ccbcbb6beb7a&e=1627124449&h=42e9a2a8e1f843e5a4573960dc07feaa

错误是:

获得https://software-download.microsoft.com/db/Win10_21H1_English_x64.iso?t=5e79c7f7-ad0d-4431-ad01-7139b298f3bc&e=1627210844&h=94f2c2f458187bd78dc6eca220b4d504

--2021-07-24 00:07:57--  https://software-download.microsoft.com/db/Win10_21H1_English_x64.iso?t=52dbec9b-63f5-47e9-b4b2-ccbcbb6beb7a
Resolving software-download.microsoft.com (software-download.microsoft.com)... 117.18.232.200
Connecting to software-download.microsoft.com (software-download.microsoft.com)|117.18.232.200|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2021-07-24 00:07:59 ERROR 403: Forbidden.

'e' is not recognized as an internal or external command,
operable program or batch file.
'h' is not recognized as an internal or external command,
operable program or batch file.

答案1

wget将您的命令包含在帖子中会很有用。以下是一些评论:

  • “与”字符 ( &) 是特殊字符。您应将 URL 括在撇号或双引号中以避免 shell 获取它 ( wget "https..."),或者应转义所有特殊字符 ( \&)。

  • 当您获取 HTTPS 时,为了避免检查证书的有效性,请将参数添加--no-check-certificate到命令中。

相关内容