Goodmoning,
I wrote a code in python that query for an uuid of a product and then download it creating an url like:
https://scihub.copernicus.eu/dhus/odata/v1/Products(‘16d71ee3-0a56-4f94-b53d-d6cf89de95b7’)//$value
then i manage the download of the zip in this way:
response = requests.request("GET", url=url_to_download, auth=HTTPBasicAuth(user_service, pass_service), stream=True)
s = speedtest.Speedtest()
handle = open(downloaded_data_path + file_name, "wb")
downloaded = 0
pct_done = 0
for chunk in response.iter_content(chunk_size=8192*4096):
if chunk:
downloaded += handle.write(chunk)
print(int(s.download()/(1024 * 1024)), 'MB Connection Download speed ---',int(s.upload()/(1024 * 1024)), 'MB Connection Upload speed')
now = time.time()
if now - last_print >= 1:
pct_done = round(downloaded / int(total_length) * 100)
speed = round(downloaded / (now - start) / 1024)
print(f"Download {pct_done} % done, avg speed {speed} kbps")
last_print = time.time()
handle.close()
print('Download ended at status',pct_done)
It download really slowly because it print:
186 MB Connection Download speed — 43 MB Connection Upload speed
Download 9 % done, avg speed 116 kbps
And during the download it stops even if the zipfile is not completely downloaded.
I asked to the eosupport@copernicus.esa.int but no one answered me. Is it my problem or a Copernicus service problem?
I have this problem also for other Sentinel products.
Thanks,
Shaila