0

目前我正在尝试让我的脚本从网站下载 mysql 文件,但它似乎转到 302 重定向链接。当我在常规(Windows)浏览器中使用完全相同的链接时,它会下载文件。

这是 wget 的输出:

--2013-06-07 09:42:40--  http://6pp.kvdb.net/exports/mysql_sql.txt.gz
Resolving 6pp.kvdb.net... 2a01:7c8:eb:0:95:170:70:116, 212.78.187.48
Connecting to 6pp.kvdb.net|2a01:7c8:eb:0:95:170:70:116|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://www.d-centralize.nl/exports/mysql_sql.txt.gz [following]
--2013-06-07 09:42:40--  http://www.d-centralize.nl/exports/mysql_sql.txt.gz
Resolving www.d-centralize.nl... 2a00:1450:400c:c03::79, 173.194.66.121
Connecting to www.d-centralize.nl|2a00:1450:400c:c03::79|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-06-07 09:42:40 ERROR 404: Not Found.

如您所见, http: //6pp.kvdb.net/exports/mysql_sql.txt.gz此网址下载文件(在 Windows 浏览器中)。

4

1 回答 1

1

看起来 6pp.kvdb.net 重定向到 www.d-centralize.nl 并且 www.d-centralize.nl 同时具有 IPv4 和 IPv6 地址:

$ host www.d-centralize.nl
www.d-centralize.nl is an alias for ghs.google.com.
ghs.google.com is an alias for ghs.l.google.com.
ghs.l.google.com has address 173.194.69.121
ghs.l.google.com has IPv6 address 2a00:1450:4008:c01::79

他们的网络服务器似乎配置错​​误。它正在侦听两个地址,但仅在 IPv4 地址上提供文件。由于您的盒子启用了 IPv6,它会更喜欢 IPv6 地址,这是损坏的地址。

尝试wget -4 ...强制使用服务器的 IPv4 地址。

于 2013-06-07T08:30:57.560 回答