DownloadKit

2.0.7 · active · verified Thu Apr 16

DownloadKit is a simple and easy-to-use multi-threaded file download tool for Python. It supports concurrent downloading of multiple files, automatic large file splitting for multi-threaded downloads, automatic task scheduling, and connection failure retries. The current version is 2.0.7, with frequent updates.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to initialize `DownloadKit`, specify a download directory, and add multiple URLs to the download queue. The library automatically handles multi-threaded downloads and saves files to the specified path.

import os
from DownloadKit import DownloadKit

# Create a directory to save files
download_dir = os.path.join(os.getcwd(), 'downloaded_files')
os.makedirs(download_dir, exist_ok=True)

# Initialize the downloader with the target path
d = DownloadKit(goal_path=download_dir)

# Add multiple download tasks
url1 = 'https://www.python.org/static/img/python-logo.png' # Example URL
url2 = 'https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png' # Example URL

d.add(url1)
d.add(url2)

print(f'Starting downloads to {download_dir}...')
# The downloads start automatically upon adding tasks in a default setup
# You can also manually start/manage tasks with more advanced usage (not shown in quickstart)

# Wait for downloads to complete (this is a simplified example; actual library has more robust completion handling)
# For simple use-cases, the library manages a queue and threads automatically.
# In a real application, you might use d.wait() or monitor progress.
# For demonstration, we'll just print a message.
print('Downloads initiated. Check the "downloaded_files" directory.')

view raw JSON →