為什麼 wget 無法從此伺服器下載?

為什麼 wget 無法從此伺服器下載?
  • 使用win10
  • 可以用 IDM 和 chrome 下載鏈接

我收到這個錯誤。有什麼不對的嗎

C:\Users\alihani>cd C:\wget-1.19.1-win64

C:\wget-1.19.1-win64>wget http://rgwha1.elcld.com/Public/1996747932?AWSAccessKeyId=ZTCEWB8UCH1HR47ZQJYT&Expires=1510149040&response-cache-control=public%2C%20max-age%3D2592000&response-content-disposition=attachment%3B%20filename%3D%22%27Til%20Death%20Season%201.rar%22&response-content-encoding=System.Text.UTF8Encoding&response-content-type=application%2Foctet-stream&Signature=FYX3YEWDXD%2Bfd5X98fzrQEjZ1vw%3D

--2017-10-09 16:52:07--  http://rgwha1.elcld.com/Public/1996747932?AWSAccessKeyId=ZTCEWB8UCH1HR47ZQJYT
Resolving rgwha1.elcld.com (rgwha1.elcld.com)... 192.168.222.216
Connecting to rgwha1.elcld.com (rgwha1.elcld.com)|192.168.222.216|:80... connected.

HTTP request sent, awaiting response... 400 Bad Request
2017-10-09 16:52:08 ERROR 400: Bad Request.

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

'response-cache-control' is not recognized as an internal or external command,
operable program or batch file.

'response-content-disposition' is not recognized as an internal or external command,
operable program or batch file.

'response-content-encoding' is not recognized as an internal or external command,
operable program or batch file.

'response-content-type' is not recognized as an internal or external command,
operable program or batch file.

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

答案1

&用於分隔 Windows shell 中的命令。透過您的命令,您正在執行以下操作:

C:\wget-1.19.1-win64> wget http://rgwha1.elcld.com/Public/1996747932?AWSAccessKeyId=ZTCEWB8UCH1HR47ZQJYT
C:\wget-1.19.1-win64> Expires=1510149040
C:\wget-1.19.1-win64> response-cache-control=public%2C%20max-age%3D2592000
[...]
  • 您的連結被截斷,導致請求無效(因此出現錯誤代碼 400 - 錯誤請求)
  • 你的 shell 不知道Expiresresponse-cache-control等的意思。

嘗試轉義 URL,以便 shell 將 識別為&URL 的一部分而不是分隔符號。

相關內容