Radjah

mangadl.sh updated

Jun 27th, 2012
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.74 KB | None | 0 0
  1. #! /bin/bash
  2. if [ ! -d "$1" ]
  3. then
  4. echo Creating "$1"
  5. mkdir "$1"
  6. fi
  7. # получаем список всех глав
  8. manga=$1
  9. exp1=\\/fairytail\\/\\d{1,8}\\/
  10. curl -s http://manga24.ru/$manga/ | pcregrep -o -e $exp1 > chaplist.txt
  11. echo `cat chaplist.txt|wc -l` chapters to download.
  12.  
  13. for i in `cat chaplist.txt| sed -s 's/\///'`;
  14. do
  15.     if [ ! -d "$i" ]
  16.     then
  17.         echo Creating $i...
  18.         mkdir $i
  19.     fi
  20.     echo Entering $i...
  21.     cd $i
  22.     curl -s http://manga24.ru/$i/ > temp.html
  23.     dir=`cat temp.html |pcregrep -o -e 'dir\:.+'|pcregrep -o -e 'http.*[^\(",)]'`
  24.     expr=s/\"/$dir/g
  25.     cat temp.html | pcregrep -o -e 'images\:.+'|pcregrep -o -e '\"[^(\",)]+'| sed ${expr} > images.txt
  26.     wget -nc -i images.txt
  27.     rm -f images.txt temp.html
  28.     cd ../..
  29. done;
Advertisement
Add Comment
Please, Sign In to add comment