38 lines
1023 B
Bash
Executable File
38 lines
1023 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
|
|
|
|
setup_test() {
|
|
[[ -d ./Artists ]] || mkdir ./Artists
|
|
rm -rf ./gallery-dl/*.sqlite3 ./gallery-dl/log.txt ./Artists/* || exit 1
|
|
}
|
|
|
|
download() {
|
|
[[ -f downloaded_$1.txt ]] || echo -e "${IYELLOW}download_$1.txt doesn't exist${NO_COLOR}" || exit 1
|
|
cp downloaded_$1.txt to_download_$1.txt
|
|
|
|
while [ 1 ]
|
|
do
|
|
gallery-dl --config ./gallery-dl/config.json --input-file-delete to_download_$1.txt
|
|
|
|
if [ ! -s to_download_$1.txt ]; then
|
|
echo -e "${IGREEN}file empty${NO_COLOR}"
|
|
rm to_download_$1.txt
|
|
break
|
|
fi
|
|
echo -e "${IYELLOW}file not empty${NO_COLOR}"
|
|
|
|
if [ $(ping -qc 3 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
|
|
}
|
|
|
|
setup_test
|
|
download r34
|
|
download kemono
|