Commit 61dbe3ec authored by Lozac'h Loic's avatar Lozac'h Loic
Browse files

debug

parent d5b94e68
......@@ -139,9 +139,26 @@ class EodagS1Downloader():
while still2download:
for p in sorted(products_availability, key=lambda k: len(products_availability[k]), reverse=True):
print(f"\nStarting Download {p}...")
with closing(StringIO()) as tqdm_out:
with ProgressCallback(file=tqdm_out) as bar:
products_availability[p][0].download( bar, extract=False, outputs_prefix=downdir)
failed=False
try:
with closing(StringIO()) as tqdm_out:
with ProgressCallback(file=tqdm_out) as bar:
products_availability[p][0].download( bar, extract=False, outputs_prefix=downdir)
except Exception as err:
failed=True
print(err)
if failed and len(products_availability[p]) == 2:
failed=False
print("Download failed. Trying with PEPS")
try:
with closing(StringIO()) as tqdm_out:
with ProgressCallback(file=tqdm_out) as bar:
products_availability[p][1].download( bar, extract=False, outputs_prefix=downdir)
except Exception as err:
failed=True
print(err)
if products_availability[p][0].location[:5] == "file:":
products_downloaded[p] = products_availability[p][0]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment