Files
HDB/gallery-dl/rule34.sh
2024-07-09 00:21:49 +02:00

31 lines
844 B
Bash
Executable File

#!/usr/bin/bash
IGREEN="\033[0;92m" # Intense Green
IYELLOW="\033[0;93m" # Intense Yellow
NO_COLOR="\033[0m" # Text Reset
# for testing only
rm -f ./archive.sqlite3 ./archive-rule34.sqlite3 ./log.txt
rm -rf ./Download/*
[[ -f downloaded_r34.txt ]] || echo -e "${IYELLOW}no file to download from${NO_COLOR}" || exit 1
cp downloaded_r34.txt to_download_r34.txt
while [ 1 ]
do
gallery-dl --config ./config.json --input-file-delete to_download_r34.txt
if [ ! -s to_download_r34.txt ]; then
echo -e "${IGREEN}file empty${NO_COLOR}"
rm to_download_r34.txt
exit 0
fi
echo -e "${IYELLOW}file not empty${NO_COLOR}"
if [ $(ping -qc 3 rule34.xxx > /dev/null 2>&1) ]; then
echo -e "${IYELLOW}no internet${NO_COLOR}"
exit 1
fi
echo -e "${IGREEN}has internet${NO_COLOR}"
done