I honestly dont know

This commit is contained in:
2024-11-01 17:45:49 +01:00
parent d8032f63de
commit 8381baa269

View File

@ -4,29 +4,28 @@ IGREEN="\033[0;92m" # Intense Green
IYELLOW="\033[0;93m" # Intense Yellow
NO_COLOR="\033[0m" # Text Reset
trap interrupt_function INT
# trap interrupt_function INT
#
# interrupt_function() {
# rm -f to_download_*.txt
# exit 1
# }
interrupt_function() {
rm -f to_download_*.txt
exit 1
}
setup_test() {
if [[ $(hostname) == \s\a\t\a\n ]]; then
[[ -d ./Artists ]] || mkdir ./Artists
rm -rf ./gallery-dl/*.sqlite3 ./gallery-dl/log.txt ./Artists/* || exit 1
}
fi
download() {
input_file="$1.links"
input_file="$1.links"
if [[ ! -f $input_file ]]; then
if [[ ! -f $input_file ]]; then
echo -e "${IYELLOW}$input_file doesn't exist${NO_COLOR}"
exit 1
fi
fi
cp $input_file to_download_$1.txt
cp $input_file to_download_$1.txt
for ((n=0;n<5;n++)); do
for ((n=0;n<5;n++)); do
gallery-dl --config ./gallery-dl/config.json --input-file-delete to_download_$1.txt
if [ ! -s to_download_$1.txt ]; then
@ -41,16 +40,12 @@ download() {
exit 1
fi
echo -e "${IGREEN}has internet${NO_COLOR}"
done
done
[[ $(hostname) != \s\a\t\a\n ]] && cp ./gallery-dl/archive-${$1,,}.sqlite3 /data/backup
# [[ $(hostname) != \s\a\t\a\n ]] && cp ./gallery-dl/archive-${$1,,}.sqlite3 /data/backup
if [ -s to_download_$1.txt ]; then
if [ -s to_download_$1.txt ]; then
exit 1
# exit with some kind of error
# service should then send error and fitting message to ntfy
fi
}
[[ $(hostname) == \s\a\t\a\n ]] && setup_test
download $1
fi