MCPcopy Create free account
hub / github.com/adobe/Marinus / download_file

Function download_file

python3_cron_scripts/get_sonar_data_unified.py:55–66  ·  view source on GitHub ↗

Download the file from the provided URL and put it in data_dir

(s, url, data_dir)

Source from the content-addressed store, hash-verified

53
54
55def download_file(s, url, data_dir):
56 """
57 Download the file from the provided URL and put it in data_dir
58 """
59 local_filename = data_dir + url.split("/")[-1]
60 # NOTE the stream=True parameter
61 req = s.get(url, stream=True)
62 with open(local_filename, "wb") as out_f:
63 for chunk in req.iter_content(chunk_size=128 * 1024):
64 if chunk: # filter out keep-alive new chunks
65 out_f.write(chunk)
66 return local_filename
67
68
69def find_zone(domain, zones):

Callers 1

download_remote_filesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected