Remove uneeded duplicated code.

Signed-off-by: Edu4rdSHL <edu4rdshl@protonmail.com>
This commit is contained in:
Edu4rdSHL 2022-02-02 19:43:37 -05:00
parent 4ff4cc5454
commit cc8b2827ee
No known key found for this signature in database
GPG key ID: 3A574A4009F553E5

View file

@ -19,11 +19,10 @@ for URL in ${GIVEAWAY_URLS[@]}; do
echo "Downloading books now, do not interrupt the process..."
COUNTER=0;
while read -r LINK; do
if curl -sSfLo "$(basename "$(curl -sSfw '%{redirect_url}' "$LINK")")" "$LINK"; then
COUNTER=$((COUNTER + 1));
if curl -sSfLo "$(basename "$(curl -sSfw '%{redirect_url}' "$LINK")")" "$LINK"; then
echo "Sucessfully downloaded book: $COUNTER/$TOTAL_BOOKS"
else
COUNTER=$((COUNTER + 1));
echo "A error as ocurred while downloading the book: $COUNTER from link: $LINK"
fi
done < links.txt