Package: downloader-cli
downloader-cliA simple downloader written in Python with an awesome progressbar.Installation|Requirements|Usage|Use It|Other examplesInstallationPyPIArchGentooConda-ForgeManualNOTE: The following packages (except installing manually) will get you the latest release. If you want to try out the latest development stuff, install manually.PyPIThe package is available in PyPIhereInstall it usingpipinstalldownloader-cliArchThe package is available in the AURhereInstall it usingyayyay -S downloader-cliGentooThe package is also available in src_prepare Gentoo overlayhereFirst set up src_prepare-overlaysudoemerge-anv--noreplaceapp-eselect/eselect-repository
sudoeselectrepositoryenablesrc_prepare-overlay
sudoemaintsync-rsrc_prepare-overlayInstall it usingsudoemerge-anv--autounmasknet-misc/downloader-cliConda-ForgeInstallingdownloader-clifrom theconda-forgechannel can be achieved by addingconda-forgeto your channels with:conda config --add channels conda-forge
conda config --set channel_priority strictOnce theconda-forgechannel has been enabled,downloader-clican be installed with:conda install downloader-cliIt is possible to list all of the versions ofdownloader-cliavailable on your platform with:conda search downloader-cli --channel conda-forgeManualIf you want to manuall install, clone the repo and run the following commandsudopythonsetup.pyinstallRequirementsdownloader-clirequires just one external module.urllib3UsageThe script also allows some other values from the commandline.usage: dw [-h] [-f | -c] [-e] [-q] [-b] [-v] [--done DONE] [--left LEFT][--current CURRENT] [--color-done COLOR_DONE][--color-left COLOR_LEFT] [--color-current COLOR_CURRENT][--icon-border ICON_BORDER]SOURCE [TARGET]positional arguments:SOURCE                URL of the fileTARGET                target filepath (existing directories will be treatedas the target location)optional arguments:-h, --help            show this help message and exit-f, -o, --force       overwrite if the file already exists-c, --resume          resume failed or cancelled download (partial sanitycheck)-e, --echo            print the filepath to stdout after downloading (otheroutput will be redirected to stderr)-q, --quiet           suppress filesize and progress info-b, --batch           Download files in batch. If this flag is passed thepassed source will be considered as a file withdownload links seperated by a newline. This flag willbe ignored if source is a valid URL.-v, --version         show the program version number and exitUI Group:--done DONE           Icon indicating the percentage done of the downloader--left LEFT           Icon indicating the percentage remaining to download--current CURRENT     Icon indicating the current percentage in the progressbar--color-done COLOR_DONEColor for the done percentage icon--color-left COLOR_LEFTColor for the remaining percentage icon--color-current COLOR_CURRENTColor for the current indicator icon in the progressbar--icon-border ICON_BORDERIcon for the border of the progress barUse ItWant to use it in your project?Import theDownloadclass using the following.fromdownloader_cli.downloadimportDownloadDownload(url).download()Above is the simplest way to use it in your app. The other arguments are optional.ArgumentsThe module takes various arguments. Onlyoneis required though.NamerequireddefaultURL/fileYesdesNoNone (Current directory is selected and the name is extracted from the URL)overwriteNoFalsecontinue_downloadNoFalseechoNoFalsequietNoFalsebatchNoFalseicon_doneNo▓icon_leftNo░icon_currentNo▓icon_borderNo| (If a single char is passed, it will be used for both the right and left border. If a string of 2 chars are passed, 1st char will be used as left border and the 2nd as the right border)color_doneNobluecolor_leftNobluecolor_currentNoblueNOTEFor details regarding the arguments, checkUsageNOTEIn case the file size is not available, the bar is shown as indefinite, in which case the icon_left
by default space(" ").Other examplesIn case you want to experiment with the progress bar's icons, here's some examples.This is when I passedicon_doneas#andicon_leftas space.In case a file's size is not available from the server, the progressbar is indefinite.