Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- 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)"
- dldr='aria2c --remote-time'
- if [ ! -d $2 ]
- then
- echo Creating $2
- mkdir "$2"
- else
- dldr='wget -nc'
- fi
- echo Entering $2
- cd "$2"
- postcount=`curl -# "http://gelbooru.com/index.php?page=dapi&s=post&q=index&tags=$1&limit=1"|pcregrep -o 'posts\ count=\"[^"]+'|sed -e 's/posts\ count=//' -e 's/\"//'`
- echo $postcount posts
- rm -f get2.gelbooru.txt
- let "pcount=postcount/1000"
- echo $pcount
- echo "http://gelbooru.com/index.php?page=dapi&s=post&q=index&tags=$1&limit=1000&pid=$i"
- for ((i=0; i<=$pcount; i++))
- do
- curl "http://gelbooru.com/index.php?page=dapi&s=post&q=index&tags=$1&limit=1000&pid=$i" -A "$uag"|pcregrep -o -e 'file_url=[^ ]+'|sed -e 's/file_url=//g' -e 's/\"//g' >>get2.gelbooru.txt
- done;
- $dldr -i get2.gelbooru.txt
Advertisement
Add Comment
Please, Sign In to add comment