使用 wget 从 Chrome 生成的 link 下载

Use wget to download from a link generated by Chrome

我正在尝试使用 wgethttps://commonvoice.mozilla.org/en/datasets 下载一些大文件到 Linux 服务器。未直接提供原始 links,必须输入他们的电子邮件地址,然后浏览器才会下载文件。

我的 Chrome 浏览器开始从此 link 下载,表示为 URL:

https://mozilla-common-voice-datasets.s3.dualstack.us-west-2.amazonaws.com/cv-corpus-4-2019-12-10/en.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQ3GQRTO3PILORFHK%2F20210115%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210115T130519Z&X-Amz-Expires=43200&X-Amz-Security-Token=FwoGZXIvY

所以尝试了以下方法:

并用 https://mozilla-common-voice-datasets.s3.dualstack.us-west-2.amazonaws.com/cv-corpus-4-2019-12-10/en.tar.gz 替换 URL 重复上述操作。

None 其中有效。 (443... failed: Network is unreachable.)

你能告诉我如何使用 wget 下载这些文件吗?

非常感谢您的帮助!

更新:

右键单击按钮,复制 link,然后将其用于 wget 对我也不起作用:

wget https://mozilla-common-voice-datasets.s3.dualstack.us-west-2.amazonaws.com/cv-corpus-4-2019-12-10/en.tar.gz?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ASIAQ3GQRTO3IG5C5BSR%2F20210115%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210115T152745Z&X-Amz-Expires=43200&X-Amz-Security-Token=FwoGZXIvYXdzEFAaDDzpL2UNwQHDglPopyKSBIGJHO39vwq2Y2C5st0EfZmCTNtUnPFJojieM6E1aKC16ZcjilXOHZ%2BVkXoYboIarEPZHa7dUFK6d17zEtOFNy0cv7lTDfQ4ZXiOfhEMWf8a5fMdFMtBqcVGZx9GT1rCBI9DPCPeCo7i%2B6qkbEkaYwTKWwilvm69L6rbG7JtWy6gOH%2BGjq4tqSqYdCzCsyYhrCUZVWtH9HW98jvqVxW0dfFF6aTNAMKf9EmT3pMh%2BNvwViTjs5Os1G7UHGIOPq5CUERDjRthIjiAQHMxz68RmXePb5hGawSPHL16T%2BHy4KQkew7SVTQ%2BW6sBqwNWodvEf5sv9ZXOplAUZCzI3uAro2iGDkRfvPqvz7DOuWI88eXuQJCvA4B00szj9hSmDCAVFrr85kZ7H%2BLeeXMHPnLGiO7b%2FP6il0sUWG5M%2BXm%2BLDuf0egPBh5lpThVSscDD05ECqq6Vf5BFbIHs7Yan0MAZRKIqdm9en1crE2Y9%2BlDOz5DAJue7EJFcoKDp2KciDFT8r7BOtuUX7xc18buDXZ226Ypil49kE0MSBfDfQOz54ccj1Dql3UCGn8jycEnJm3Kx7Nk5mrA4WXolRvT%2F5uEEKYPR6i6QbPY8649SErlAoVnzqGdnjynzEq6lJlEcF0ShgcDxLkBGCe%2F6YRobvQOoP0ZU0WNBD7xWIRvc%2FxFvB2YBkaj%2Fuhuk9ycTWPltnyFJqdAKLXOhoAGMiqm5As8rxBOkV3nr5PEcXlv3e%2BLExGw0DpFMgM3Qys8LpSQWRd8IGBIjcE%3D&X-Amz-Signature=ca121bca943ed5c351a93a4d2c81b289335e3bfd447c7597fc4f9749010e7edb&X-Amz-SignedHeaders=host
[1] 61913
[2] 61914
[3] 61915
-bash: X-Amz-Credential=ASIAQ3GQRTO3IG5C5BSR%2F20210115%2Fus-west-2%2Fs3%2Faws4_request: command not found
[4] 61916
-bash: X-Amz-Date=20210115T152745Z: command not found
-bash: X-Amz-Expires=43200: command not found
[5] 61917
[6] 61918
-bash: X-Amz-Security-Token=FwoGZXIvYXdzEFAaDDzpL2UNwQHDglPopyKSBIGJHO39vwq2Y2C5st0EfZmCTNtUnPFJojieM6E1aKC16ZcjilXOHZ%2BVkXoYboIarEPZHa7dUFK6d17zEtOFNy0cv7lTDfQ4ZXiOfhEMWf8a5fMdFMtBqcVGZx9GT1rCBI9DPCPeCo7i%2B6qkbEkaYwTKWwilvm69L6rbG7JtWy6gOH%2BGjq4tqSqYdCzCsyYhrCUZVWtH9HW98jvqVxW0dfFF6aTNAMKf9EmT3pMh%2BNvwViTjs5Os1G7UHGIOPq5CUERDjRthIjiAQHMxz68RmXePb5hGawSPHL16T%2BHy4KQkew7SVTQ%2BW6sBqwNWodvEf5sv9ZXOplAUZCzI3uAro2iGDkRfvPqvz7DOuWI88eXuQJCvA4B00szj9hSmDCAVFrr85kZ7H%2BLeeXMHPnLGiO7b%2FP6il0sUWG5M%2BXm%2BLDuf0egPBh5lpThVSscDD05ECqq6Vf5BFbIHs7Yan0MAZRKIqdm9en1crE2Y9%2BlDOz5DAJue7EJFcoKDp2KciDFT8r7BOtuUX7xc18buDXZ226Ypil49kE0MSBfDfQOz54ccj1Dql3UCGn8jycEnJm3Kx7Nk5mrA4WXolRvT%2F5uEEKYPR6i6QbPY8649SErlAoVnzqGdnjynzEq6lJlEcF0ShgcDxLkBGCe%2F6YRobvQOoP0ZU0WNBD7xWIRvc%2FxFvB2YBkaj%2Fuhuk9ycTWPltnyFJqdAKLXOhoAGMiqm5As8rxBOkV3nr5PEcXlv3e%2BLExGw0DpFMgM3Qys8LpSQWRd8IGBIjcE%3D: command not found
-bash: X-Amz-Signature=ca121bca943ed5c351a93a4d2c81b289335e3bfd447c7597fc4f9749010e7edb: command not found
-bash: X-Amz-SignedHeaders=host: command not found
[2]   Exit 127                X-Amz-Credential=ASIAQ3GQRTO3IG5C5BSR%2F20210115%2Fus-west-2%2Fs3%2Faws4_request
[3]   Exit 127                X-Amz-Date=20210115T152745Z
[4]   Exit 127                X-Amz-Expires=43200
[5]-  Exit 127                X-Amz-Security-Token=FwoGZXIvYXdzEFAaDDzpL2UNwQHDglPopyKSBIGJHO39vwq2Y2C5st0EfZmCTNtUnPFJojieM6E1aKC16ZcjilXOHZ%2BVkXoYboIarEPZHa7dUFK6d17zEtOFNy0cv7lTDfQ4ZXiOfhEMWf8a5fMdFMtBqcVGZx9GT1rCBI9DPCPeCo7i%2B6qkbEkaYwTKWwilvm69L6rbG7JtWy6gOH%2BGjq4tqSqYdCzCsyYhrCUZVWtH9HW98jvqVxW0dfFF6aTNAMKf9EmT3pMh%2BNvwViTjs5Os1G7UHGIOPq5CUERDjRthIjiAQHMxz68RmXePb5hGawSPHL16T%2BHy4KQkew7SVTQ%2BW6sBqwNWodvEf5sv9ZXOplAUZCzI3uAro2iGDkRfvPqvz7DOuWI88eXuQJCvA4B00szj9hSmDCAVFrr85kZ7H%2BLeeXMHPnLGiO7b%2FP6il0sUWG5M%2BXm%2BLDuf0egPBh5lpThVSscDD05ECqq6Vf5BFbIHs7Yan0MAZRKIqdm9en1crE2Y9%2BlDOz5DAJue7EJFcoKDp2KciDFT8r7BOtuUX7xc18buDXZ226Ypil49kE0MSBfDfQOz54ccj1Dql3UCGn8jycEnJm3Kx7Nk5mrA4WXolRvT%2F5uEEKYPR6i6QbPY8649SErlAoVnzqGdnjynzEq6lJlEcF0ShgcDxLkBGCe%2F6YRobvQOoP0ZU0WNBD7xWIRvc%2FxFvB2YBkaj%2Fuhuk9ycTWPltnyFJqdAKLXOhoAGMiqm5As8rxBOkV3nr5PEcXlv3e%2BLExGw0DpFMgM3Qys8LpSQWRd8IGBIjcE%3D
[6]+  Exit 127                X-Amz-Signature=ca121bca943ed5c351a93a4d2c81b289335e3bfd447c7597fc4f9749010e7edb
[username@host: ~]$ 
Redirecting output to ‘wget-log.1’.

我们澄清了一些事情后更新。

问题URL不完整,缺少X-Amz-SignedHeaders参数。

要获得正常工作 URL,请执行以下操作:

  1. 添加有效的电子邮件地址
  2. 使用复选框同意条款
  3. 不要单击下载按钮,而是右键单击 -> 复制 link 地址并在您的 [=11= 中使用该 URL ] 命令(一定要通过在前面添加反斜杠来转义和号 &)。

旧答案

您看到的是 presigned URL from Amazon S3。这本质上是一个 临时 下载-link 用于似乎属于 Mozilla 的 S3-Bucket 中的单个对象(~文件)。

这里的关键字是临时的。如果您在 link 过期之前使用它,您可以使用 wget 下载数据而不会出现问题。

您可以通过将 X-Amz-Expires 的值与 X-Amz-Date 相加来估计到期时间,在您的情况下,URL 的有效期为 43200 / 3600 = 12 小时,从指定日期。不要费心去改变这些值,整个东西都是加密签名的,它不会接受它;-)

所以你可以这样做的方法是:

  1. 登录网站
  2. 复制下载链接
  3. 使用 wget
  4. 在大约 12 小时内下载