【发布时间】:2012-02-08 21:03:18
【问题描述】:
我正在尝试使用带有 WGET 的批处理文件从此处下载公共 FCC 文件
http://wireless.fcc.gov/uls/data/complete/l_micro.zip
当我最初运行带有参数的批处理文件时
wget --server-response -owget.log http://wireless.fcc.gov/uls/data/complete/l_micro.zip
失败并出现 HTTP 401 未经授权的错误。我可以在这一点上重试,但它一直失败。但是我注意到如果我打开 IE,开始下载并在提示保存时取消,我可以重新运行批处理文件并且它完美执行!
这是我从日志中得到的详细服务器响应
--2012-02-06 14:32:24-- http://wireless.fcc.gov/uls/data/complete/l_micro.zip
Resolving wireless.fcc.gov (wireless.fcc.gov)... 192.104.54.158
Connecting to wireless.fcc.gov (wireless.fcc.gov)|192.104.54.158|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 302 Found
Location: REMOVED - appears to have my IP
Cache-Control: no-cache
Pragma: no-cache
Content-Type: text/html; charset=utf-8
Connection: close
Content-Length: 513
Location: REMOVED [following]
--2012-02-06 14:32:24-- REMOVED
Resolving REMOVED... 192.168.2.11
Connecting to REMOVED|192.168.2.11|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 401 Unauthorized
Cache-Control: no-cache
Pragma: no-cache
WWW-Authenticate: NTLM
WWW-Authenticate: BASIC realm="AD_BCAAA"
Content-Type: text/html; charset=utf-8
Proxy-Connection: close
Set-Cookie: BCSI-CS-8ECFB6B4AA642EF0=2; Path=/
Connection: close
Content-Length: 575
Authorization failed.
这是我的 IE 小程序运行后的日志
--2012-02-08 15:52:43-- http://wireless.fcc.gov/uls/data/complete/l_micro.zip
Resolving wireless.fcc.gov (wireless.fcc.gov)... 192.104.54.158
Connecting to wireless.fcc.gov (wireless.fcc.gov)|192.104.54.158|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Server: Sun-Java-System-Web-Server/7.0
Date: Fri, 27 Jan 2012 18:37:51 GMT
Content-type: application/zip
Last-modified: Sun, 22 Jan 2012 11:18:09 GMT
Etag: "46fa95c-4f1bf071"
Accept-ranges: bytes
Content-length: 74426716
Connection: Keep-Alive
Age: 1045014
Length: 74426716 (71M) [application/zip]
Saving to: `l_micro.zip'
感谢任何帮助!
【问题讨论】:
-
你的命令对我来说完美无瑕......
-
我尝试了
wget http://wireless.fcc.gov/uls/data/complete/l_micro.zip并得到了一个74693506字节的文件l_micro.zip,其sha1sum 为1f8393bf6231bfa9689ec91cab6a660244f35605。 -
您的网络上有透明代理吗?你能在你的 IE 会话上运行 wireshark 或 fiddler 看看它有什么不同吗?
标签: http wget http-status-code-401 unauthorized