简体   繁体   English

Wget Public S3存储桶

[英]Wget public s3 bucket

I'd like to download all of the files in this public s3 bucket without an AWS access key (since this is part of a tutorial that others have to follow). 我想在没有AWS访问密钥的情况下下载此公共s3存储桶中的所有文件(因为这是其他人必须遵循的教程的一部分)。 Each of the constituent files ( example ) can be downloaded individually. 每个组成文件( 示例 )都可以单独下载。

You're not taking an easy road: 您走的路并不轻松:

  1. you will need to get the key (ie files) in the bucket 您将需要在存储桶中获取密钥(即文件)

you can use rest API and make a request as follow 您可以使用rest API并按以下方式进行请求

    curl -H "GET /?list-type=2 HTTP/1.1" \
    -H "Host: halitereplaybucket.s3.amazonaws.com" \
    -H "Date: 20161025T124500Z" \
    -H "Content-Type: text/plain" https://halitereplaybucket.s3.amazonaws.com/

This will return a response in xml format with the contents and all keys from the bucket. 这将返回xml格式的响应,其中包含存储桶中的内容和所有键。

  1. You will need to parse the response and extract all keys 您将需要解析响应并提取所有密钥

  2. for each of the keys, you can make a request to download the file 对于每个键,您都可以请求下载文件

     wget 'http://halitereplaybucket.s3.amazonaws.com/{file}' 

I understand you mention you do not want to use a AWS key but using the CLI it will be as simple as 我了解您提到您不想使用AWS密钥,但是使用CLI就像这样简单

aws s3 sync s3://halitereplaybucket .

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM