fix variable name
This commit is contained in:
parent
b23b438e68
commit
10745f79e2
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
USE_TOR=false
|
USE_TOR=false
|
||||||
DELAY=1
|
DELAY=1
|
||||||
RESUME=false
|
RECENT=false
|
||||||
|
|
||||||
function usage {
|
function usage {
|
||||||
echo "./$(basename "$0") [-t] [-s] [-r]"
|
echo "./$(basename "$0") [-t] [-s] [-r]"
|
||||||
@ -36,7 +36,7 @@ while getopts ${optstring} arg; do
|
|||||||
TAGS+=("$OPTARG")
|
TAGS+=("$OPTARG")
|
||||||
;;
|
;;
|
||||||
r)
|
r)
|
||||||
RESUME=true
|
RECENT=true
|
||||||
;;
|
;;
|
||||||
:)
|
:)
|
||||||
echo "$0: Must supply an argument to -$OPTARG." >&2
|
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_MD5=$(echo "$JSON" | jq -r '.md5')
|
||||||
FILE_EXT=$(echo "$JSON" | jq -r '.file_ext')
|
FILE_EXT=$(echo "$JSON" | jq -r '.file_ext')
|
||||||
FILE="$FILE_MD5.$FILE_EXT"
|
FILE="$FILE_MD5.$FILE_EXT"
|
||||||
if $RESUME; then
|
if $RECENT; then
|
||||||
if [[ -f "$FILE" ]]; then
|
if [[ -f "$FILE" ]]; then
|
||||||
echo "$FILE exists."
|
echo "$FILE exists."
|
||||||
exit
|
exit
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
USE_TOR=false
|
USE_TOR=false
|
||||||
DELAY=1
|
DELAY=1
|
||||||
RESUME=false
|
RECENT=false
|
||||||
|
|
||||||
function usage {
|
function usage {
|
||||||
echo "./$(basename "$0") [-t] [-s] [-r] -a tag -a tag2"
|
echo "./$(basename "$0") [-t] [-s] [-r] -a tag -a tag2"
|
||||||
@ -12,6 +12,7 @@ function usage {
|
|||||||
echo " -t downloads using tor (requires torsocks)"
|
echo " -t downloads using tor (requires torsocks)"
|
||||||
echo " -s sets the delay after each request, defaults to 1"
|
echo " -s sets the delay after each request, defaults to 1"
|
||||||
echo " -a tag or artist name"
|
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
|
# list of arguments expected in the input
|
||||||
@ -35,7 +36,7 @@ while getopts ${optstring} arg; do
|
|||||||
TAGS+=("$OPTARG")
|
TAGS+=("$OPTARG")
|
||||||
;;
|
;;
|
||||||
r)
|
r)
|
||||||
RESUME=true
|
RECENT=true
|
||||||
;;
|
;;
|
||||||
:)
|
:)
|
||||||
echo "$0: Must supply an argument to -$OPTARG." >&2
|
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_TAGS=$(echo "$i" | jq -r '."tags"' | sed 's/\ /,/g')
|
||||||
FILE=$(echo "$FILE_URL" | sed 's/\// /g' | awk '{print $NF}')
|
FILE=$(echo "$FILE_URL" | sed 's/\// /g' | awk '{print $NF}')
|
||||||
|
|
||||||
if $RESUME; then
|
if $RECENT; then
|
||||||
if [[ -f "$FILE" ]]; then
|
if [[ -f "$FILE" ]]; then
|
||||||
echo "$FILE exists."
|
echo "$FILE exists."
|
||||||
exit
|
exit
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
USE_TOR=false
|
USE_TOR=false
|
||||||
DELAY=1
|
DELAY=1
|
||||||
RESUME=false
|
RECENT=false
|
||||||
URL="konachan.com"
|
URL="konachan.com"
|
||||||
|
|
||||||
function usage {
|
function usage {
|
||||||
@ -38,7 +38,7 @@ while getopts ${optstring} arg; do
|
|||||||
TAGS+=("$OPTARG")
|
TAGS+=("$OPTARG")
|
||||||
;;
|
;;
|
||||||
r)
|
r)
|
||||||
RESUME=true
|
RECENT=true
|
||||||
;;
|
;;
|
||||||
c)
|
c)
|
||||||
URL="${OPTARG}"
|
URL="${OPTARG}"
|
||||||
@ -95,7 +95,7 @@ for TAG in "${TAGS[@]}"; do
|
|||||||
FILE_TAGS=$(echo "$JSON" | jq -r '.[] | ."tags"' | sed 's/\ /,/g')
|
FILE_TAGS=$(echo "$JSON" | jq -r '.[] | ."tags"' | sed 's/\ /,/g')
|
||||||
FILE=$(echo "$JSON" | jq -r '.[] | ."file_url"' | sed 's/\// /g' | awk '{print $5}')
|
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')
|
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
|
if [[ -f "$FILE_WITHSPACE" ]]; then
|
||||||
echo "$FILE_WITHSPACE exists."
|
echo "$FILE_WITHSPACE exists."
|
||||||
exit
|
exit
|
||||||
|
Loading…
Reference in New Issue
Block a user