add ATFBooru support

This commit is contained in:
2024-09-27 16:33:15 +02:00
parent 969877cdb0
commit 1e5b09db38
2 changed files with 22 additions and 4 deletions

View File

@ -17,8 +17,14 @@ setup_test() {
} }
download() { download() {
[[ -f downloaded_$1.txt ]] || echo -e "${IYELLOW}download_$1.txt doesn't exist${NO_COLOR}" || exit 1 input_file="$1.links"
cp downloaded_$1.txt to_download_$1.txt
if [[ ! -f $input_file ]]; then
echo -e "${IYELLOW}$input_file doesn't exist${NO_COLOR}"
exit 1
fi
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 gallery-dl --config ./gallery-dl/config.json --input-file-delete to_download_$1.txt
@ -37,7 +43,7 @@ download() {
echo -e "${IGREEN}has internet${NO_COLOR}" 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 1
@ -47,4 +53,4 @@ download() {
} }
[[ $(hostname) == \s\a\t\a\n ]] && setup_test [[ $(hostname) == \s\a\t\a\n ]] && setup_test
download $1 download $1

View File

@ -11,6 +11,7 @@
"filename": "{md5}.{extension}", "filename": "{md5}.{extension}",
"directory": ["{search_tags}", "Rule34"] "directory": ["{search_tags}", "Rule34"]
}, },
"kemonoparty": "kemonoparty":
{ {
"archive": "./gallery-dl/archive-kemono.sqlite3", "archive": "./gallery-dl/archive-kemono.sqlite3",
@ -18,6 +19,7 @@
"filename": "{hash}.{extension}", "filename": "{hash}.{extension}",
"directory": ["{user}", "Kemono"] "directory": ["{user}", "Kemono"]
}, },
"coomerparty": "coomerparty":
{ {
"archive": "./gallery-dl/archive-coomer.sqlite3", "archive": "./gallery-dl/archive-coomer.sqlite3",
@ -25,12 +27,20 @@
"filename": "{hash}.{extension}", "filename": "{hash}.{extension}",
"directory": ["{user}", "Coomer"] "directory": ["{user}", "Coomer"]
}, },
"gofile": "gofile":
{ {
"archive": "./gallery-dl/archive-gofile.sqlite3", "archive": "./gallery-dl/archive-gofile.sqlite3",
"filename": "{id}.{extension}", "filename": "{id}.{extension}",
"directory": ["{id}", "Gofile"] "directory": ["{id}", "Gofile"]
},
"atfbooru": {
"archive": "./gallery-dl/archive-atfbooru.sqlite3",
"filename": "{md5}.{extension}",
"directory": ["{search_tags}", "ATFBooru"]
} }
}, },
@ -45,6 +55,7 @@
"output": "output":
{ {
"ansi": true, "ansi": true,
"log": { "log": {
"level": "info", "level": "info",
"format": { "format": {
@ -54,6 +65,7 @@
"error" : "\u001b[1;31m{name}: {message}\u001b[0m" "error" : "\u001b[1;31m{name}: {message}\u001b[0m"
} }
}, },
"logfile": { "logfile": {
"path": "./gallery-dl/log.txt", "path": "./gallery-dl/log.txt",
"mode": "w", "mode": "w",