Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More of a comment: 429 Errors #7

Open
crh3675 opened this issue Jul 23, 2020 · 1 comment
Open

More of a comment: 429 Errors #7

crh3675 opened this issue Jul 23, 2020 · 1 comment

Comments

@crh3675
Copy link

crh3675 commented Jul 23, 2020

For downloading, if you try to download more than one scene at a time, you get a 429 Error code and a 162 byte download. How does this library handle retry for that situation?

@loicdtx
Copy link
Owner

loicdtx commented Jul 24, 2020

@crh3675 see the check_complete= argument in download_all_complete method which defaults to True. So you should be able to retry without having to manually delete incomplete downloads beforehands.
I remember downloading up to 3 scenes simultaneously, but that was a long time ago and espa may have tightened the limits since then.

I usually use this kind of snippet for batch download.

from lsru import Espa
import os

# Instantiate Espa class
espa = Espa()
dl_dir = os.path.expanduser('~/sandbox/lsru')

os.makedirs(dl_dir, exist_ok=True)

for order in espa.orders:
    if order.status == 'complete':
        order.download_all_complete(dl_dir, unpack=True)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants