Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Download manga images
#!/bin/bash
# Brynhildr in the Darkness (Chinese ver.)
usage="./batch.sh chapter pages"
[ "$#" -lt 2 ] && { echo "$usage"; exit 1; }
declare -i chapter="$1"
declare -i pages="$2"
_page='$$'
printf -v _chapter "%.2d" "$chapter"
raw_url="http://imgfast.dmzj.com/j/%E6%9E%81%E9%BB%91%E7%9A%84%E5%B8%83%E4%BC%A6%E5%B8%8C%E5%B0%94%E7%89%B9/${_chapter}/%E7%AC%AC1%E8%AF%9D_00${_page}.jpg"
url=$(echo "$raw_url" | sed -e 's/%/%%/g' -e 's/\$\$/%.2d/g')
for page in $(seq 1 "$pages")
do
printf -v _url "$url" "$page"
wget "$_url" --restrict-file-names=ascii
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.