tiny progress

This commit is contained in:
2024-11-26 20:43:15 +01:00
parent 09f2c03863
commit befa59c03d
2 changed files with 25 additions and 18 deletions

View File

@ -6,6 +6,7 @@ NO_COLOR="\033[0m" # Text Reset
IN_FILE="$1_generated.txt"
SUCCESS_FILE="$1_success.txt"
FAIL_FILE="$1_failed.txt"
SUCCESS="false"
if [[ $(hostname) == \s\a\t\a\n ]]; then
[[ -d ./Artists ]] || mkdir ./Artists
@ -17,11 +18,11 @@ download() {
# echo "path: $2"
for ((n=0;n<5;n++)); do
#echo "gallery-dl --config ./gallery-dl/config.json --directory $2 $1"
gallery-dl --config ./gallery-dl/config.json --directory "$2" "$1"
if [ $(echo $?) == 0 ]; then
echo "$1" >> "$SUCCESS_FILE"
$SUCCESS="true"
break
fi
echo -e "${IYELLOW}download failed${NO_COLOR}"
@ -35,8 +36,10 @@ download() {
fi
echo -e "${IGREEN}has internet${NO_COLOR}"
done
echo "$1" >> "$FAIL_FILE"
if [ $SUCCESS != \t\r\u\e ]; then
echo "$1" >> "$FAIL_FILE"
fi
}
cargo run -- generate "$1"
@ -53,6 +56,6 @@ while IFS= read -r line; do
download $url $path
done < "$IN_FILE"
[[ -s $FAIL_FILE ]] && curl -d 'bruh' ntfy.hopeless-cloud.xyz/Hentai
# [[ -s $FAIL_FILE ]] && curl -d 'bruh' ntfy.hopeless-cloud.xyz/Hentai
[[ $(hostname) != \s\a\t\a\n ]] && cp ./gallery-dl/archive-${1,,}.sqlite3 /data/backup