logo

utils

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

mangahere.co.sh (647B)


  1. #!/bin/sh
  2. name="${1}"
  3. for chap in $(seq -w 001 "${2:-1}")
  4. do mkdir -p "${HOME}/${name}/${chap}"
  5. cd "${HOME}/${name}/${chap}" || exit
  6. total_pages=$(curl "http://www.mangahere.co/manga/${name}/c${chap}/" 2>/dev/null | grep 'total_pages' | sed -r 's|.*=.([0-9]*).*|\1|')
  7. curl "http://www.mangahere.co/manga/${name}/c${chap}/" 2>/dev/null | grep 'id="image"' | sed -r 's|.* src="([^"]*)" .*|\1|' | xargs wget -c -O 1.jpg
  8. for page in $(seq 2 "${total_pages}")
  9. do curl "http://www.mangahere.co/manga/${name}/c${chap}/${page}.html" 2>/dev/null | grep 'id="image"' | sed -r 's|.* src="([^"]*)" .*|\1|' | xargs wget -c -O "${page}.jpg"
  10. done
  11. done