Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- if [ ! -d "$1" ]
- then
- echo Creating "$1"
- mkdir "$1"
- fi
- # получаем список всех глав
- manga=$1
- exp1=\\/fairytail\\/\\d{1,8}\\/
- curl -s http://manga24.ru/$manga/ | pcregrep -o -e $exp1 > chaplist.txt
- echo `cat chaplist.txt|wc -l` chapters to download.
- # качаем главы
- for i in `cat chaplist.txt| sed -s 's/\///'`;
- do
- # папка для новой лавы
- if [ ! -d "$i" ]
- then
- echo Creating $i...
- mkdir $i
- fi
- echo Entering $i...
- cd $i
- # Временный файл
- curl -s http://manga24.ru/$i/ > temp.html
- # базовый url страниц
- dir=`cat temp.html |pcregrep -o -e 'dir\:.+'|pcregrep -o -e 'http.*[^\(",)]'`
- # Список страниц главы
- expr=s/\"/$dir/g
- cat temp.html | pcregrep -o -e 'images\:.+'|pcregrep -o -e '\"[^(\",)]+'| sed ${expr} > images.txt
- # Всё качаем
- wget -nc -i images.txt
- # уборка
- rm -f images.txt temp.html
- # новая глава
- cd ../..
- done;
- # уборка
- rm -f chaplist.txt
Advertisement
Add Comment
Please, Sign In to add comment