MCPcopy
hub / github.com/Blizzard/s2client-proto / download_file

Function download_file

samples/replay-api/download_replays.py:66–78  ·  view source on GitHub ↗
(url, output_dir)

Source from the content-addressed store, hash-verified

64
65
66def download_file(url, output_dir):
67 # Create output_dir if not exists.
68 if not os.path.exists(output_dir):
69 os.makedirs(output_dir)
70
71 file_name = url.split('/')[-1]
72 file_path = os.path.join(output_dir, file_name)
73
74 response = requests.get(url, stream=True)
75 with open(file_path, 'wb') as f:
76 shutil.copyfileobj(response.raw, f)
77
78 return file_path
79
80
81def get_replay_pack(client_version, client_key, client_secret, replays_dir, extract=False):

Callers 1

get_replay_packFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected