add iwara support

This commit is contained in:
2025-02-07 21:57:12 +01:00
parent f9271efd0e
commit ea3b670546
5 changed files with 44 additions and 37 deletions

View File

@ -12,10 +12,18 @@ download() {
SUCCESS="false"
for ((n=0;n<5;n++)); do
if gallery-dl --config ./gallery-dl/config.json --directory "$2" "$1"; then
echo "$1" >> "$SUCCESS_FILE"
SUCCESS="true"
break
if [[ $1 =~ "iwara.tv" ]]; then
if yt-dlp --config-locations ./yt-dlp/iwara.conf -o "${2}/%(id)s.%(ext)s" "$1"; then
echo "$1" >> "$SUCCESS_FILE"
SUCCESS="true"
break
fi
else
if gallery-dl --config ./gallery-dl/config.json --directory "$2" "$1"; then
echo "$1" >> "$SUCCESS_FILE"
SUCCESS="true"
break
fi
fi
echo -e "${IYELLOW}download failed${NO_COLOR}"
@ -33,10 +41,7 @@ download() {
[[ $SUCCESS != \t\r\u\e ]] && echo "$1" >> "$FAIL_FILE"
}
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
[[ $(hostname) = \s\a\t\a\n ]] && rm -rf ./Artists/*
if [[ -f $FAIL_FILE ]]; then
[[ -f "${FAIL_FILE}.old" ]] && rm -f "${FAIL_FILE}.old"
@ -66,4 +71,4 @@ while IFS= read -r line; do
download $url $path
done < "$IN_FILE"
[[ $(hostname) != \s\a\t\a\n ]] && cp ./gallery-dl/archive-${1,,}.sqlite3 /data/backup
[[ -s $FAIL_FILE ]] && echo -e "${IGREEN}Sucess!${NO_COLOR}" || echo -e "${IRED}Some links failed!${NO_COLOR}"