Skip to content

Instantly share code, notes, and snippets.

@willrayeo
Last active April 13, 2024 14:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willrayeo/39596e5756e018e1c0f52d65680fd5ff to your computer and use it in GitHub Desktop.
Save willrayeo/39596e5756e018e1c0f52d65680fd5ff to your computer and use it in GitHub Desktop.
url = f"https://zipper.dataspace.copernicus.eu/odata/v1/Products(acdd7b9a-a5d4-5d10-9ac8-554623b8a0c9)/$value"
headers = {"Authorization": f"Bearer {access_token}"}
session = requests.Session()
session.headers.update(headers)
response = session.get(url, headers=headers, stream=True)
with open("product.zip", "wb") as file:
for chunk in response.iter_content(chunk_size=8192):
if chunk:
file.write(chunk)
@krishnaglodha
Copy link

Hi, I'm having trouble in making it workable for a loop of multiple Ids . any hint how can I work on it /

@willrayeo
Copy link
Author

willrayeo commented Nov 13, 2023

I'd recommend directing your question to the community forum.

@makr-a
Copy link

makr-a commented Dec 17, 2023

I also face the same problem. Is there already a solution for this? There is no answer in the community forum on this?

@iliasmachairas
Copy link

I face the same problem too. Only the first zip file is right. The rest zip files are corrupted.

@kzar20
Copy link

kzar20 commented Apr 13, 2024

Hello William, I have the same problem. I would appreciate knowing if the problem was solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment