Skip to main content

A user-friendly download library

Project description

Chunky DL

Chunky DL is a user-friendly, ready to roll library for downloading files. It incorporates many common setups and patterns for downloading files all with little setup or configuration required.

Chunky DL supports multipart download out of the box. Simply set your size threshold and any file over that size will be downloaded multiple parts of that size simultaneously then joined together at the end of download. No further work is on your end is required.

Chunky DL also supports multithreaded download for downloading multiple files at a time. Simply supply a list of urls, and the number of downloads you wish to run simultaneously, and the output path and no further configuration is required.

Build Status GitHub License


Installation

ChunkyDL is available on PyPi:

$ python -m pip install chunkydl

Usage

Downloading a single file is easy. The only requirements are a url and an output directory:

import chunkydl

chunkydl.download('http://example.com/path/to/file.mp4', 'C:/Users/User/Downloads')

To download multiple files simultaneously:

import chunkydl

urls = [
    'http://example.com/path/to/file_one.mp4',
    'http://example.com/path/to/file_two.mp4',
    'http://example_site_two.com/path/to/file_three.mp4',
]

chunkydl.download_list(urls, 'C:/Users/User/Downloads')

By default, ChunkyDL is configured to download up to 4 files simultaneously and to split files with a size of over 100MB into parts and download up to 4 parts simultaneously. Of course, this can be configured by supplying these values to either function above:

import chunkydl

chunkydl.download(
    url='http://example.com/path/to/file.mp4', 
    output_path='C:/Users/User/Downloads',
    size_threshold=1024 * 1024 * 50,  # 50MB
    multipart_threads=6
)

The download configuration object can be accessed directly, allowing you to set up individual download configurations for each url in a list. To do this, define a DownloadConfig object with your desired settings and supply the url, output path, and configuration for each url that you wish to download:

import chunkydl
from chunkydl import DownloadConfig, DLGroup

dl_list = [
    DLGroup(
        url='http://example.com/path/to/file_one.mp4', 
        output_path='C:/Users/User/Downloads/new_file_one.mp4',
        config=DownloadConfig(size_threshold=1024 * 1024 * 200, multipart_threads=3)
    ),
    DLGroup(
        url='http://example.com/path/to/file_two.mp4',
        output_path='C:/Users/User/Downloads/new_file_two.mp4',
        config=DownloadConfig(size_threshold=1024 * 1024 * 20, headers={'Referer': 'http://example.com/'})
    ),
    DLGroup(
        url='http://example_site_two.com/path/to/file_three.mp4',
        output_path='C:/Users/User/Documents/SuperSpecialFolder/',
        config=DownloadConfig()  # use default configuration
    ),
]

chunkydl.download_list(dl_list)

Features

  • Multipart downloads: Large files are downloaded in multiple parts simultaneously to increase download speed.
  • Multiple concurrent downloads: Download multiple files simultaneously without having to set up a custom framework.
  • Perpetual download queue: Queue downloader can be run perpetually in its own thread. The download queue stays running until you are ready for it to stop. Simply keep adding urls to the queue to keep downloading.
  • Highly configurable: Downloads can be configured exactly how you need them. You control the thread counts, size thresholds, headers, retries, and more all with simple configuration parameters.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chunkydl-0.1.0.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chunkydl-0.1.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file chunkydl-0.1.0.tar.gz.

File metadata

  • Download URL: chunkydl-0.1.0.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.2 Windows/10

File hashes

Hashes for chunkydl-0.1.0.tar.gz
Algorithm Hash digest
SHA256 256f73c001d2ad180d9b61bd674fe8fef429dff1e36d9b0971d9beaf671bc2bf
MD5 632fea2b252bf2b1311f4bafd7b2d29e
BLAKE2b-256 45459edb656c4d1d3c1e0b7f99b071782d665e859e135ca65af71a674efbe117

See more details on using hashes here.

File details

Details for the file chunkydl-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chunkydl-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.2 Windows/10

File hashes

Hashes for chunkydl-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 90d0da25d2c5526d9a28290e599fa091c77e78ac21597cc44b1d15c748ac142d
MD5 23c574f44d2433cc890cf4696b965c34
BLAKE2b-256 bb93341255f44bd8d363e4e88368fd9fccee682d88d7acae9b7ddb11b6bc39e3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page