49 lines
1.2 KiB
Bash
Executable File
49 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/bash
|
|
|
|
IGREEN="\033[0;92m" # Intense Green
|
|
IYELLOW="\033[0;93m" # Intense Yellow
|
|
NO_COLOR="\033[0m" # Text Reset
|
|
|
|
setup_test() {
|
|
[[ ! -d ./Artists ]]
|
|
rm -rf ./gallery-dl/*.sqlite3 ./gallery-dl/log.txt ./Artists/* || exit 1
|
|
}
|
|
|
|
download() {
|
|
while [ 1 ]
|
|
do
|
|
gallery-dl --config ./gallery-dl/config.json --input-file-delete $1
|
|
|
|
if [ ! -s $1 ]; then
|
|
echo -e "${IGREEN}file empty${NO_COLOR}"
|
|
rm $1
|
|
break
|
|
fi
|
|
echo -e "${IYELLOW}file not empty${NO_COLOR}"
|
|
|
|
if [ $(ping -qc 3 matrix.hopeless-cloud.xyz > /dev/null 2>&1) ]; then
|
|
echo -e "${IYELLOW}no internet${NO_COLOR}"
|
|
exit 1
|
|
fi
|
|
echo -e "${IGREEN}has internet${NO_COLOR}"
|
|
done
|
|
}
|
|
|
|
download_r34() {
|
|
[[ -f downloaded_r34.txt ]] || echo -e "${IYELLOW}download_r34: no file to download from${NO_COLOR}" || exit 1
|
|
cp downloaded_r34.txt to_download_r34.txt
|
|
|
|
download to_download_r34.txt
|
|
}
|
|
|
|
download_kemono() {
|
|
[[ -f downloaded_kemono.txt ]] || echo -e "${IYELLOW}download_kemono: no file to download from${NO_COLOR}" || exit 1
|
|
cp downloaded_kemono.txt to_download_kemono.txt
|
|
|
|
download to_download_kemono.txt
|
|
}
|
|
|
|
setup_test
|
|
download_r34
|
|
download_kemono
|