我正在尝试下载最新版本的来自 GitHub 的 Web 应用程序在 shell 上使用wget
。据我所知,我从未遇到过 wget 问题。我发出以下命令:
wget 'https://github.com/kitodo/kitodo-production/releases/download/goobi-ce-1.11.2/goobi-ce-
1.11.2.war'
我期望这会将文件保存goobi-ce-1.11.2.war
在当前目录中。相反,没有写入任何文件,并且我得到了很多 shell 输出:
--2016-11-10 09:14:51-- https://github.com/kitodo/kitodo-production/releases/download/goob
i-ce-1.11.2/goobi-ce-1.11.2.war
Resolving github.com... 192.30.253.112, 192.30.253.113
Connecting to github.com|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-cloud.s3.amazonaws.com/releases/4506938/1c6c2686-ec1f-11e5-9767-4f
19a4d8f219.war?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F201
61110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20161110T081451Z&X-Amz-Expires=300&X-Amz-S
ignature=8dddd783418dcaada6338d3c645d4208a2215239272d7998259af9fcac6f109e&X-Amz-SignedHeade
rs=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dgoobi-ce-1.11.2.
war&response-content-type=application%2Foctet-stream [following]
--2016-11-10 09:14:51-- https://github-cloud.s3.amazonaws.com/releases/4506938/1c6c2686-ec
1f-11e5-9767-4f19a4d8f219.war?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFO
VBIJMK3TQ%2F20161110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20161110T081451Z&X-Amz-Expi
res=300&X-Amz-Signature=8dddd783418dcaada6338d3c645d4208a2215239272d7998259af9fcac6f109e&X-
Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Dg
oobi-ce-1.11.2.war&response-content-type=application%2Foctet-stream
Resolving github-cloud.s3.amazonaws.com... 52.216.2.0
Connecting to github-cloud.s3.amazonaws.com|52.216.2.0|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 64309224 (61M) [application/octet-stream]
1c6c2686-ec1f-11e5-9767-4f19a4d8f219.war?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=
AKIAISTNZFOVBIJMK3TQ%2F20161110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20161110T081451Z
&X-Amz-Expires=300&X-Amz-Signature=8dddd783418dcaada6338d3c645d4208a2215239272d7998259af9fc
ac6f109e&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment; filen
ame=goobi-ce-1.11.2.war&response-content-type=application%2Foctet-stream: File name too lon
g
Cannot write to `1c6c2686-ec1f-11e5-9767-4f19a4d8f219.war?X-Amz-Algorithm=AWS4-HMAC-SHA256&
X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20161110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date
=20161110T081451Z&X-Amz-Expires=300&X-Amz-Signature=8dddd783418dcaada6338d3c645d4208a221523
9272d7998259af9fcac6f109e&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=
attachment; filename=goobi-ce-1.11.2.war&response-content-type=application%2Foctet-stream'
(Success).
这似乎是重定向的一个问题,并且wget
尝试写入一个名为的文件1c6c2686-ec1f-11e5-9767-4f19a4d8f219.war?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAISTNZFOVBIJMK3TQ%2F20161110%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20161110T081451Z&X-Amz-Expires=300&X-Amz-Signature=8dddd783418dcaada6338d3c645d4208a2215239272d7998259af9fcac6f109e&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment; filename=goobi-ce-1.11.2.war&response-content-type=application%2Foctet-stream
显然是一个问题。
我尝试过这个:
wget 'https://github.com/kitodo/kitodo-production/releases/download/goobi-ce-1.11.2/goobi-ce-
1.11.2.war' > goobi-ce-1.11.2.war
它创建了文件,但文件为 0 字节(屏幕输出相同)。这个也不起作用:
wget -O goobi-ce-1.11.2.war 'https://github.com/kitodo/kitodo-production/releases/download/go
obi-ce-1.11.2/goobi-ce-1.11.2.war'
它将屏幕消息输出到文件(大约 2k,二进制文件为 61M)。
是否可以使用 wget 下载文件?