I am able to use Azure Rest API in Python (https://github.com/microsoft/azure-devops-python-api) to get a download URL for an Artifact e.g.
artifacts = build_client.get_artifacts(project_name, build_id)
I then want to download them all with something like
for artifact in artifacts:
urllib.request.urlretrieve(artifact.resource.download_url, artifactDownloadPath + artifact.name)
However rather than downloading the artifact it downloads the HTML page. The same link does work in a web browser.
How can I download the artifacts like I would in YAML?