logo

utils

~/.local/bin tools and git-hooks git clone https://hacktivis.me/git/utils.git

mangareader.net.sh (626B)


  1. #!/bin/sh
  2. name="${1}"
  3. for chap in $(seq 1 "${2:-1}")
  4. do mkdir -p "${HOME}/${name}/${chap}"
  5. cd "$HOME/${name}/${chap}" || exit
  6. chap_pages=$(curl "http://www.mangareader.net/${name}/${chap}/" 2>/dev/null | grep '</select> of' | sed -r 's|</select> of ([0-9]*).*|\1|')
  7. curl "http://www.mangareader.net/${name}/${chap}/" 2>/dev/null | grep 'img id="img"' | sed -r 's|.* src="(.*)" alt.*|\1|' | xargs wget -c -O 1.jpg
  8. for p in $(seq 2 "${chap_pages}")
  9. do curl "http://www.mangareader.net/${name}/${chap}/${p}" 2>/dev/null | grep 'img id="img"' | sed -r 's|.* src="(.*)" alt.*|\1|' | xargs wget -c -O "${p}.jpg"
  10. done
  11. done