tortious / downloader-cli

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

downloader-cli

A simple downloader written in Python with an awesome progressbar.


Installation   |   Requirements   |   Usage   |   Use It   

forthebadge made-with-python

License PRs Welcome

Installation

Just clone the repo and alias the download.py to something like dw and you're good to go.

git clone https://github.com/deepjyoti30/downloader-cli

Requirements

Make sure that you have the following python modules installed.

Use the requirements.txt file to install them.

pip install -r requirements.txt

Run the command with sudo if you get permission denied.

Usage

The script also allows some other values from the commandline.

usage: download.py [-h] [-o] URL [des]

positional arguments:
  URL         URL of the file
  des         The name of the file to be saved with.

optional arguments:
  -h, --help  show this help message and exit
  -o          Overwrite if the file already exists else, try to resume
              download.

Use It

Want to use it in your project?

Just include the file in your project directory and import it. It's simple to use it.

from download import Download
Download(url).download()

Above is the simplest way to use it in your app. The other arguments are optional.

Arguments

The module takes 5 arguments.

Name required default
URL Yes
des No None (Current directory is selected and the name is extracted from the URL)
overwrite No False
icon_done No
icon_left No

In case you want to experiment with the progress bar's icons, here's an example.

This is when I passed icon_done as # and icon_left as space.

About

License:MIT License


Languages

Language:Python 100.0%