Files
scripts/download_chapters.sh
2025-05-23 22:09:52 +02:00

32 lines
652 B
Bash

#!/bin/bash
# Default values
FORMAT="cbz"
DELAY_MS=2000
URL="https://www.webtoons.com/en/fantasy/tower-of-god/list?title_no=95"
# Usage message
usage() {
echo "Usage: $0 [-f format] [-d delay_ms] [-u url]"
echo " -f Output format (default: cbz)"
echo " -d Delay in milliseconds between episodes (default: 2000)"
echo " -u Webtoon URL"
exit 1
}
# Parse CLI arguments
while getopts ":f:d:u:" opt; do
case ${opt} in
f) FORMAT=$OPTARG ;;
d) DELAY_MS=$OPTARG ;;
u) URL=$OPTARG ;;
\?) usage ;;
esac
done
# Execute the command
webtoon-dl \
--format "$FORMAT" \
--delay-ms="$DELAY_MS" \
"$URL"