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 in multiple parts and 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, 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='50mb',  # 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='200mb', 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='20mb', 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.2.0.tar.gz (16.3 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.2.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chunkydl-0.2.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.5.0-1025-azure

File hashes

Hashes for chunkydl-0.2.0.tar.gz
Algorithm Hash digest
SHA256 aebcd94e7afa3689d03e54a721ea182d546c3a3516d5000374a25c247d889959
MD5 cc46cc1c995ca37c4428b21f8b5b176f
BLAKE2b-256 abfcc929ae48f0e0c501a853c8083f7d8eb1fc8914a6c0e641b6ab57eb5811d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chunkydl-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.5 Linux/6.5.0-1025-azure

File hashes

Hashes for chunkydl-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 083d488f3e163eb33f5ed75cbd431ef96663cdec24095ba1e30b1c8e01a8a93a
MD5 b7945d6ac076330a664a6f7dc6223e87
BLAKE2b-256 decf0d959df5e47abe5db1c04596077466a523ff4db228cd5091d38b8a306020

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