Fixed for loop

This commit is contained in:
Anon 2024-04-30 16:00:17 -07:00
parent 106682ac41
commit 0155775ded

View File

@ -69,11 +69,11 @@ LENGTH="$(echo "$RESULT" | jq -r '. | .post | length')"
SELECTION=`seq 0 $LENGTH` SELECTION=`seq 0 $LENGTH`
for i in $SELECTION;do for i in $SELECTION;do
MD5="$(echo "$RESULT" | jq -r '. | .post['"$SELECTION"'].md5')" MD5="$(echo "$RESULT" | jq -r '. | .post['"$i"'].md5')"
[ -z "$MD5" ] && continue [ -z "$MD5" ] && continue
grep -q "$MD5" "$TMP" && continue grep -q "$MD5" "$TMP" && continue
URL_FILE="$(echo "$RESULT" | jq -r '. | .post['"$SELECTION"'].file_url')" URL_FILE="$(echo "$RESULT" | jq -r '. | .post['"$i"'].file_url')"
RATING="$(echo "$RESULT" | jq -r '. | .post['"$SELECTION"'].rating')" RATING="$(echo "$RESULT" | jq -r '. | .post['"$i"'].rating')"
NSFW="--nsfw" NSFW="--nsfw"
TEXT="$MSG_NSFW" TEXT="$MSG_NSFW"