简体   繁体   English

Python - 如何从 Amazon S3 下载图像

[英]Python - How to Download Images from Amazon S3

I need to download images that are uploaded by https://webapp.spypoint.com .我需要下载由https://webapp.spypoint.com上传的图像。 These images are saved in Amazon S3.这些图像保存在 Amazon S3 中。 The url for this image is something like this as: https://s3.amazonaws.com/spypoint/1111/2222/3333/img.jpg此图像的 url 类似于: https://s3.amazonaws.com/spypoint/1111/2222/3333/img.jpg

I have id and password to log in https://webapp.spypoint.com .我有登录https://webapp.spypoint.com的 ID 和密码。 My goal is to download images from Amazon S3 directly using boto3.我的目标是直接使用 boto3 从 Amazon S3 下载图像。

I researched about it and all information was about downloading images from Amazon S3 bucket owned by myself.我对此进行了研究,所有信息都是关于从我自己拥有的 Amazon S3 存储桶中下载图像的。 For my case, the Amazon S3 storage/bucket is owned by https://webapp.spypoint.com .就我而言,Amazon S3 存储/存储桶归https://webapp.spypoint.com 所有

Without any knowledge on how the image is served on the website you meintioned It would be hard to answer.如果不知道您提到的网站上如何提供图像,这将很难回答。

However, generally I belive that:但是,我通常认为:

1/ The bucket do not enable public object listing 1/ 桶不启用公共 object 列表

2/ The bucket do not enable public object getting 2/桶不启用公共object获取

3/ The images you see is displayed on your screen with a signed url ( check your network in the browser console ) 3/ 您看到的图像显示在您的屏幕上,带有签名的 url(在浏览器控制台中检查您的网络)

If that is the case, you will only be able to get directly get the S3 URLs ( the download links ) that is explicitly provided (to you ) by the website you are targeting.如果是这种情况,您将只能直接获取您所定位的网站(向您)明确提供的 S3 URL(下载链接)。

You need to look into APIs that website provide or do HTML parsing您需要查看网站提供的 API 或进行 HTML 解析

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

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