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

Function download_file

python3_cron_scripts/get_data_by_cidr_unified.py:56–68  ·  view source on GitHub ↗

Download the provided file and place it in data_dir

(s, url, data_dir)

Source from the content-addressed store, hash-verified

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

Callers 1

download_remote_filesFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected