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

@ -19,28 +19,33 @@ echo "$output"
url=$(echo "$output" | awk '{print $1}')
path=$(echo "$output" | awk '{print $3}')
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
echo "command: gallery-dl --config ./gallery-dl/config.json --directory $path $url"
[[ $(hostname) = \s\a\t\a\n ]] && rm -rf ./Artists/*
for ((n=0;n<5;n++)); do
if ! gallery-dl --config ./gallery-dl/config.json --directory "$2" "$1"; then
echo -e "${IGREEN}Success${NO_COLOR}"
exit 0
if [[ $url =~ "iwara.tv" ]]; then
echo "command: yt-dlp --config-locations ./yt-dlp/iwara.conf -o ${path}/%(id)s.%(ext)s $url"
if yt-dlp --config-locations ./yt-dlp/iwara.conf -o "${path}/%(id)s.%(ext)s" "$url"; then
echo -e "${IGREEN}Success${NO_COLOR}"
exit 0
fi
else
echo "command: gallery-dl --config ./gallery-dl/config.json --directory $path $url"
if gallery-dl --config ./gallery-dl/config.json --directory "$path" "$url"; then
echo -e "${IGREEN}Success${NO_COLOR}"
exit 0
fi
fi
echo -e "${IYELLOW}download failed${NO_COLOR}"
if ! ping -c 3 v4.ip.hopeless-cloud.xyz > /dev/null 2>&1; then
echo -e "${IRED}no internet${NO_COLOR}"
if ! ping -qc 3 v4.ip.hopeless-cloud.xyz > /dev/null 2>&1; then
echo -e "${IYELLOW}no internet${NO_COLOR}"
exit 1
fi
if ! ping -c 3 v6.ip.hopeless-cloud.xyz > /dev/null 2>&1; then
echo -e "${IRED}no internet${NO_COLOR}"
elif ! ping -qc 3 v6.ip.hopeless-cloud.xyz > /dev/null 2>&1; then
echo -e "${IYELLOW}no internet${NO_COLOR}"
exit 1
else
echo -e "${IGREEN}has internet${NO_COLOR}"
fi
echo -e "${IGREEN}has internet${NO_COLOR}"
done