From 428425bab7316f5b8ea59860a4b6b7ef39e642aa Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Wed, 22 May 2024 00:26:55 +0530 Subject: [PATCH] don't download already downloaded images --- extra-packages/scripts/getpaper/getpaper.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extra-packages/scripts/getpaper/getpaper.sh b/extra-packages/scripts/getpaper/getpaper.sh index b5451dc..4809c6d 100755 --- a/extra-packages/scripts/getpaper/getpaper.sh +++ b/extra-packages/scripts/getpaper/getpaper.sh @@ -97,6 +97,8 @@ if [ "${ITEM_PAGE}" -gt 0 ]; then fi IMAGE_URL="$(echo "${RESULT}" | jq -r ".data[${ITEM_NUMBER}].path")" FILENAME="${IMAGE_URL##*/}" -curl --silent -L --output-dir "${DIR}" -o "${FILENAME}" "${IMAGE_URL}" +if [ ! -f "${DIR}/${FILENAME}" ]; then + curl --silent -L --output-dir "${DIR}" -o "${FILENAME}" "${IMAGE_URL}" +fi echo "${DIR}/${FILENAME}"