The permissions for Sentinel2 L1C changed today
How can I send a 'requester pays' header when using boto3?
My previous code (below) which worked previously is now hitting a 403
s3 = boto3.resource('s3')
bucket = s3.Bucket(bucket_name)
bucket.download_file(key, fpath)
Best Answer
Here is a sample code that should work (given that your config and credentials are saved in
~/.aws
)I extracted this code from what we have implemented in
sentinelhub
Python package. The full code is available here and is basically also handling multithreaded download and certain errors which can occur during download.By the way,
sentinelhub
supports download of Sentinel-2 L1C and L2A data from AWS: examples.