From 10745f79e212dd70673d21253fcfe2d54ece68e9 Mon Sep 17 00:00:00 2001 From: bronze Date: Tue, 26 Dec 2023 19:13:18 -0500 Subject: [PATCH] fix variable name --- dandl-tag.sh | 6 +++--- gelbdl-tag.sh | 7 ++++--- moedl-tag.sh | 6 +++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dandl-tag.sh b/dandl-tag.sh index 0dc5444..1a77546 100755 --- a/dandl-tag.sh +++ b/dandl-tag.sh @@ -2,7 +2,7 @@ USE_TOR=false DELAY=1 -RESUME=false +RECENT=false function usage { echo "./$(basename "$0") [-t] [-s] [-r]" @@ -36,7 +36,7 @@ while getopts ${optstring} arg; do TAGS+=("$OPTARG") ;; r) - RESUME=true + RECENT=true ;; :) echo "$0: Must supply an argument to -$OPTARG." >&2 @@ -91,7 +91,7 @@ for TAG in "${TAGS[@]}"; do FILE_MD5=$(echo "$JSON" | jq -r '.md5') FILE_EXT=$(echo "$JSON" | jq -r '.file_ext') FILE="$FILE_MD5.$FILE_EXT" - if $RESUME; then + if $RECENT; then if [[ -f "$FILE" ]]; then echo "$FILE exists." exit diff --git a/gelbdl-tag.sh b/gelbdl-tag.sh index db2968e..a8c1b98 100755 --- a/gelbdl-tag.sh +++ b/gelbdl-tag.sh @@ -2,7 +2,7 @@ USE_TOR=false DELAY=1 -RESUME=false +RECENT=false function usage { echo "./$(basename "$0") [-t] [-s] [-r] -a tag -a tag2" @@ -12,6 +12,7 @@ function usage { echo " -t downloads using tor (requires torsocks)" echo " -s sets the delay after each request, defaults to 1" echo " -a tag or artist name" + echo " -r will download until it hits a file that already exists" } # list of arguments expected in the input @@ -35,7 +36,7 @@ while getopts ${optstring} arg; do TAGS+=("$OPTARG") ;; r) - RESUME=true + RECENT=true ;; :) echo "$0: Must supply an argument to -$OPTARG." >&2 @@ -81,7 +82,7 @@ for TAG in "${TAGS[@]}"; do FILE_TAGS=$(echo "$i" | jq -r '."tags"' | sed 's/\ /,/g') FILE=$(echo "$FILE_URL" | sed 's/\// /g' | awk '{print $NF}') - if $RESUME; then + if $RECENT; then if [[ -f "$FILE" ]]; then echo "$FILE exists." exit diff --git a/moedl-tag.sh b/moedl-tag.sh index f1ad4d6..a3cbb65 100755 --- a/moedl-tag.sh +++ b/moedl-tag.sh @@ -2,7 +2,7 @@ USE_TOR=false DELAY=1 -RESUME=false +RECENT=false URL="konachan.com" function usage { @@ -38,7 +38,7 @@ while getopts ${optstring} arg; do TAGS+=("$OPTARG") ;; r) - RESUME=true + RECENT=true ;; c) URL="${OPTARG}" @@ -95,7 +95,7 @@ for TAG in "${TAGS[@]}"; do FILE_TAGS=$(echo "$JSON" | jq -r '.[] | ."tags"' | sed 's/\ /,/g') FILE=$(echo "$JSON" | jq -r '.[] | ."file_url"' | sed 's/\// /g' | awk '{print $5}') FILE_WITHSPACE=$(echo "$JSON" | jq -r '.[] | ."file_url"' | sed 's/\// /g' | awk '{print $5}' | sed 's/\%20/ /g') - if $RESUME; then + if $RECENT; then if [[ -f "$FILE_WITHSPACE" ]]; then echo "$FILE_WITHSPACE exists." exit