MCPcopy
hub / github.com/Textualize/rich / download

Function download

examples/downloader.py:63–72  ·  examples/downloader.py::download

Download multiple files to the given directory.

(urls: Iterable[str], dest_dir: str)

Source from the content-addressed store, hash-verified

61
62
63def download(urls: Iterable[str], dest_dir: str):
64 class="st">""class="st">"Download multiple files to the given directory."class="st">""
65
66 with progress:
67 with ThreadPoolExecutor(max_workers=4) as pool:
68 for url in urls:
69 filename = url.split(class="st">"/")[-1]
70 dest_path = os.path.join(dest_dir, filename)
71 task_id = progress.add_task(class="st">"download", filename=filename, start=False)
72 pool.submit(copy_url, task_id, url, dest_path)
73
74
75if __name__ == class="st">"__main__":

Callers 1

downloader.pyFile · 0.85

Calls 3

joinMethod · 0.80
add_taskMethod · 0.80
splitMethod · 0.45

Tested by

no test coverage detected