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 is an extremely smart and efficient download manager for various cases.

  • Support for the modern HTTP/2 protocol for faster downloads.
  • Built-in download acceleration.
  • Uses your connection speed to download even more efficiently.
  • Retries failed requests.
  • Automatically detects the file type, name, extension, and size.
  • Automatically handles redirects.
  • Automatically validates the hash of the downloaded file.
  • Shows a fancy and precise 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_optimization_progress_bar=True,
    show_progress_bar=True,
    custom_headers=None,
    timeout=None
)

turbodl.download(
    url='https://example.com/file.txt',
    output_path='path/to/file',
    expected_hash='********',  # Or None if you don't want to check the hash
    hash_type='sha256'
)
# >>> 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
# >>> ╭─ 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-optimization-progress-bar  -sop  --hide-optimization-progress-bar  -hop           Show or hide the initial optimization progress bar. [default: show-optimization-progress-bar]                                       │
# >>> │ --show-progress                   -sp   --hide-progress                   -hp            Show or hide the download progress bar. [default: show-progress]                                                                    │
# >>> │ --timeout                         -t                                            INTEGER  Timeout in seconds for the download process. Or None for no timeout. [default: None]                                                │
# >>> │ --install-completion                                                                     Install completion for the current shell.                                                                                           │
# >>> │ --show-completion                                                                        Show completion for the current shell, to copy it or customize the installation.                                                    │
# >>> │ --help                                                                                   Show this message and exit.                                                                                                         │
# >>> ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

turbodl https://example.com/file.txt [...] path/to/file  # Tip: use -cs argument to set your connection speed 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.1.tar.gz (11.0 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.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: turbodl-0.1.1.tar.gz
  • Upload date:
  • Size: 11.0 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.1.tar.gz
Algorithm Hash digest
SHA256 cac442e18c80223e72856bb6365681f7d677dc2684c64b254fc72e12a870a8a8
MD5 53b945a77676ae60dd25ee6640ab82a6
BLAKE2b-256 85e07f30ff36b74e641baf836f2ea4f8add10b6bd0159daa591598db51f80795

See more details on using hashes here.

File details

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

File metadata

  • Download URL: turbodl-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 11.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6bd8369e71e4f338b4728a2ba7abad111b869106c2941714cc551e22f4ee3489
MD5 9f32eb31be54ed879750eaa5f7d88a57
BLAKE2b-256 2955d437f8e0c4a415f88413707410a8fa1a52fa7307ad983e7276812c2ffc14

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