Skip to main content

Multiplexed chunked file downloader

Project description

StreamShatter

Originally a very basic script for reliably downloading files from servers with inconsistent connections, this project has been revisited and modernised to use https://github.com/jawah/niquests to greatly improve multiplexing performance, for those who still have use for such a tool.

StreamShatter takes advantage of the Range HTTP header to dynamically allocate multiple chunks, by starting with one streaming request and gradually bisecting it while bandwidth permits, all without restarting the download. This allows for single, large file downloads from hosts that, whether intentionally or unintentionally, have degraded throughputs. The individual chunks also serve as checkpoints for if/when connections are broken.

StreamShatter Demo Demo using a normally slow (<1Mbps) server, with simulated network failures at 50%, 90% and 99.5% download progress. No data is lost and the resulting file is intact. StreamShatter Demo 2 Demo of downloading a 1GB video from a YouTube link, reaching a high bandwidth despite the usual throttling.

Installation

  • Install python and pip
  • Install StreamShatter as a package: pip install streamshatter

Usage

usage: streamshatter [-h] [-V] [-H HEADERS] [-c CACHE_FOLDER] [-l LIMIT] [-t TIMEOUT] [-s | --ssl | --no-ssl]
                     [-d | --debug | --no-debug] [-lp | --log-progress | --no-log-progress]
                     url [filename]

Multiplexed chunked file downloader

positional arguments:
  url                   Target URL
  filename              Output filename

options:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -H, --headers HEADERS
                        HTTP headers, interpreted as JSON
  -c, --cache-folder CACHE_FOLDER
                        Folder to store temporary files
  -l, --limit LIMIT     Limits the amount of chunks to download; defaults to 1024
  -t, --timeout TIMEOUT
                        Limits the amount of time allowed for the initial request to succeed
  -s, --ssl, --no-ssl   Enforces SSL verification; defaults to TRUE
  -d, --debug, --no-debug
                        Terminates immediately upon non-timeout errors, and writes the response data for errored
                        chunks; defaults to FALSE
  -lp, --log-progress, --no-log-progress
                        Continually updates a progress bar in the standard output; defaults to TRU

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

streamshatter-1.1.5.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

streamshatter-1.1.5-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file streamshatter-1.1.5.tar.gz.

File metadata

  • Download URL: streamshatter-1.1.5.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.8

File hashes

Hashes for streamshatter-1.1.5.tar.gz
Algorithm Hash digest
SHA256 868d63fbecb921f49ad284fc2adf6898625817c58c402cf174fd9427d6753769
MD5 c47193c1313872919ba6eaf2076f9989
BLAKE2b-256 782ff39f56bc00f53d355ef5ea573f2414e435578efafa6f828946a91aa0d9b2

See more details on using hashes here.

File details

Details for the file streamshatter-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: streamshatter-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.8

File hashes

Hashes for streamshatter-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5b469b6be5ee2a1245bddd571acee757b670e6fce750521a7e7a57bc5b9d5832
MD5 15a98e5c61ac9923a6f3aedd82c1065f
BLAKE2b-256 b89702a4eb1ee142c42c339195718276b71c7622b546b148273fbdd970c31139

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