Skip to main content

An extremely smart and efficient download manager for various cases.

Project description

TurboDL

PyPI - Version PyPI - Downloads PyPI - Code Style PyPI - Format PyPI - Python Compatible Versions

TurboDL ia an extremely smart, fast and efficient download manager with several automations.

  • Uses HTTP/2 protocol to download files.
  • Built-in sophisticated download acceleration technique.
  • Retry failed requests efficiently.
  • Automatically detects file information before download.
  • Automatically handles redirects.
  • Supports post-download hash verification.
  • Automatically uses RAM buffer to speed up downloads and reduce disk I/O.
  • Accurately displays a beautiful progress bar.

Installation (from PyPI)

pip install -U turbodl  # Install the latest version of TurboDL

Example Usage

Inside a Python script

from turbodl import TurboDL


turbodl = TurboDL(
    max_connections='auto',
    connection_speed=80,
    show_progress_bars=True,
    custom_headers=None,
    timeout=None
)

turbodl.download(
    url='https://example.com/file.txt',
    output_path='path/to/file',
    expected_hash='0a1b2c3d4e5f6g7h8i9j',  # Or None if you don't want to check the hash
    hash_type='md5'
    pre_allocate_space=False,
    use_ram_buffer=True,
)
# >>> file.txt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 35.6/35.6 kB 36.2 MB/s 0:00:00 100%

# All functions are documented and have detailed typings, use your development IDE to learn more.

From the command line

turbodl --help
# >>>  Usage: turbodl [OPTIONS] URL [OUTPUT_PATH]
# >>>
# >>> ╭─ Arguments ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
# >>> │ *    url              TEXT           The download URL to download the file from. [default: None] [required]                                                                                                                  │
# >>> │      output_path      [OUTPUT_PATH]  The path to save the downloaded file to. If the path is a directory, the file name will be generated from the server response. If the path is a file, the file will be saved with the   │
# >>> │                                      provided name. If not provided, the file will be saved to the current working directory. (default: Path.cwd())                                                                          │
# >>> │                                      [default: None]                                                                                                                                                                         │
# >>> ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
# >>> ╭─ Options ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
# >>> │ --max-connections     -mc                               INTEGER  The maximum number of connections to use for downloading the file (default: 'auto'). [default: None]                                                        │
# >>> │ --connection-speed    -cs                               FLOAT    Your connection speed in Mbps (default: 80). [default: None]                                                                                                │
# >>> │ --overwrite           -o    --no-overwrite        -no            Overwrite the file if it already exists. Otherwise, a "_1", "_2", etc. suffix will be added. [default: overwrite]                                           │
# >>> │ --show-progress-bars  -spb  --hide-progress-bars  -hpb           Show or hide all progress bars. [default: show-progress-bars]                                                                                               │
# >>> │ --timeout             -t                                INTEGER  Timeout in seconds for the download process. Or None for no timeout. [default: None]                                                                        │
# >>> │ --expected-hash       -eh                               TEXT     The expected hash of the downloaded file. If not provided, the hash will not be checked. [default: None]                                                    │
# >>> │ --hash-type           -ht                               TEXT     The hash type to use for the hash verification. Must be one of 'md5', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', 'blake2b', 'blake2s', 'sha3_224',     │
# >>> │                                                                  'sha3_256', 'sha3_384', 'sha3_512', 'shake_128' or 'shake_256'.                                                                                             │
# >>> │                                                                  [default: md5]                                                                                                                                              │
# >>> │ --pre-allocate-space  -pas                                       Whether to pre-allocate space for the file, useful to avoid disk fragmentation.                                                                             │
# >>> │ --use-ram-buffer      -urb                                       Whether to use a RAM buffer to download the file. [default: True]                                                                                           │
# >>> │ --help                                                           Show this message and exit.                                                                                                                                 │
# >>> ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

turbodl https://example.com/file.txt [...] path/to/file  # Tip: use -cs argument to set your connection speed in Mbps and accelerate the download
# >>> file.txt ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 35.6/35.6 kB 36.2 MB/s 0:00:00 100%

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, fork the repository and create a pull request. You can also simply open an issue and describe your ideas or report bugs. Don't forget to give the project a star if you like it!

  1. Fork the project;
  2. Create your feature branch ・ git checkout -b feature/{feature_name};
  3. Commit your changes ・ git commit -m "{commit_message}";
  4. Push to the branch ・ git push origin feature/{feature_name};
  5. Open a pull request, describing the changes you made and wait for a review.

Disclaimer

Please note that downloading copyrighted content from some services may be illegal in your country. This tool is designed for educational purposes only. Use at your own risk.

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

turbodl-0.1.5.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

turbodl-0.1.5-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file turbodl-0.1.5.tar.gz.

File metadata

  • Download URL: turbodl-0.1.5.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for turbodl-0.1.5.tar.gz
Algorithm Hash digest
SHA256 a0627dd10bb18d71c9b3f8504bc1a9878d72a66a12e8fbc6005af754fefa49f6
MD5 caa1f87ac4d983e25998c9161e75a4c1
BLAKE2b-256 993de5ff6088e06c980e884d7027b4d4b7e8cd01b6a57907153d17520291b0cc

See more details on using hashes here.

File details

Details for the file turbodl-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: turbodl-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.8

File hashes

Hashes for turbodl-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f07ab70885772445f6312df4d5b1273fb93cd4657776630e3ea57bebec1bc979
MD5 09dedad1bfa9a0b816c6c789952cbc49
BLAKE2b-256 61f1207c1cb8fee24708b6a1d3bfd11317e75cc412bf1bd4eb0e48716971dc9d

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