Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- # настройки логина
- danlogin=ЛОГИН
- danpass=ПАРОЛЬ
- dldr='aria2c --remote-time'
- if [ ! -d $2 ]
- then
- echo Creating $2
- mkdir "$2"
- else
- dldr='wget -nc'
- fi
- echo Entering $2
- cd "$2"
- ATH=`curl -s -c konachan.txt -F"commit=Login" -F"user[name]=${danlogin}" -F"user[password]=${danpass}" http://konachan.com/user/authenticate`
- uag="Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.1.1) Gecko/20090715 Firefox/3.5.1 (.NET CLR 3.5.30729)"
- postcount=`curl -b konachan.txt -# "http://konachan.com/post/index.xml?tags=$1&limit=1"|pcregrep -o 'posts\ count=\"[^"]+'|sed -e 's/posts\ count=//' -e 's/\"//'`
- rm -f get2.konachan.txt
- let "pcount=postcount/1000+1"
- for ((i=1; i<=$pcount; i++))
- do
- wget "http://konachan.com/post/index.xml?tags=$1&limit=1000&page=$i" --load-cookies="konachan.txt" -U "$uag" -O - |pcregrep -o -e 'file_url=[^ ]+'|sed -e 's/file_url=//g' -e 's/\"//g' >>get2.konachan.txt
- done;
- $dldr -i get2.konachan.txt
- rm -f *.txt
Advertisement
Add Comment
Please, Sign In to add comment