From 4c85cf55964182ccf594384de3aef08e41d7cf28 Mon Sep 17 00:00:00 2001 From: Jai A P <78354625+Jai-JAP@users.noreply.github.com> Date: Thu, 17 Feb 2022 15:36:47 +0530 Subject: [PATCH] Add suport for aria2c for faster downloading if installed (#299) * Add suport for aria2c for faster downloading if installed * Fix newlines in aria2c output --- quickget | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/quickget b/quickget index 4e53549..c7ec2bd 100755 --- a/quickget +++ b/quickget @@ -552,9 +552,18 @@ function web_get() { exit 1 fi - if ! wget --quiet --continue --show-progress --progress=bar:force:noscroll "${URL}" -O "${DIR}/${FILE}"; then - echo "ERROR! Failed to download ${URL}. Try running 'quickget' again." - exit 1 + if command -v aria2c > /dev/null; then + if ! aria2c -x16 --continue=true --summary-interval=0 --download-result=hide --console-log-level=error "${URL}" -o "${DIR}/${FILE}"; then + echo #Necessary as aria2c in suppressed mode doesnot have new lines + echo "ERROR! Failed to download ${URL}. Try running 'quickget' again." + exit 1 + fi + echo #Necessary as aria2c in suppressed mode doesnot have new lines + else + if ! wget --quiet --continue --show-progress --progress=bar:force:noscroll "${URL}" -O "${DIR}/${FILE}"; then + echo "ERROR! Failed to download ${URL}. Try running 'quickget' again." + exit 1 + fi fi }