File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -88,15 +88,24 @@ if echo "$1" | grep -e '^\(https\?\|ftp\)://.*$' > /dev/null; then
8888
8989 # Download to the 'input/' directory
9090 cd " $PROJECT_DIR " /input || exit
91- echo " ${URL} "
92- { type -p aria2c > /dev/null 2>&1 && printf " Downloading File...\n" && aria2c -x16 -j" $( nproc) " " ${URL} " ; } || { printf " Downloading File...\n" && wget -q --content-disposition --show-progress --progress=bar:force " ${URL} " || exit 1; }
91+
92+ # Download with 'aria2c' and, if failed, via 'wget'
93+ LOGI " Downloading file through 'aria2c'... ($( date +%R:%S) )"
94+ aria2c -x16 -j" $( nproc) " " ${URL} " || {
95+ LOGI " 'aria2c' failed. Using 'wget' to download file... ($( date +%R:%S) )"
96+ wget -q --no-check-certificate " ${URL} " || \
97+ LOGF " Failed to download from link." ;
98+ }
99+
100+ # Check for 'Content-Disposition'
93101 if [[ ! -f " $( echo " ${URL##*/ } " | inline-detox) " ]]; then
94102 URL=$( wget --server-response --spider " ${URL} " 2>&1 | awk -F" filename=" ' {print $2}' )
95103 fi
96104 detox " ${URL##*/ } "
97105else
98106 URL=$( printf " %s\n" " $1 " )
99- [[ -e " $URL " ]] || { echo " Invalid Input" && exit 1; }
107+ [[ -e " $URL " ]] || \
108+ LOGF " Invalid Input"
100109fi
101110
102111ORG=AndroidDumps # your GitHub org name
You can’t perform that action at this time.
0 commit comments