Radjah

get.gelbooru.sh

May 30th, 2012
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.69 KB | None | 0 0
  1. #! /bin/bash
  2.  
  3. 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)"
  4.  
  5. if [ ! -d $2 ]
  6. then
  7. echo Creating $2
  8. mkdir "$2"
  9. fi
  10. echo Entering $2
  11. cd $2
  12.  
  13. postcount=`curl -# "http://youhate.us/index.php?page=dapi&s=post&q=index&tags=$1&limit=1"|pcregrep -o 'posts\ count=\"[^"]+'|sed -e 's/posts\ count=//' -e 's/\"//'`
  14.  
  15. rm -f get2.gelbooru.txt
  16.  
  17. let "pcount=postcount/1000"
  18.  
  19. for ((i=0; i<=$pcount; i++))
  20. do
  21. wget "http://youhate.us/index.php?page=dapi&s=post&q=index&tags=$1&limit=1000&pid=$i" -U "$uag" -O - |pcregrep -o -e 'file_url=[^ ]+'|sed -e 's/file_url=//g' -e 's/\"//g'  >>get2.gelbooru.txt
  22. done;
  23.  
  24. wget -nc -i get2.gelbooru.txt
Advertisement
Add Comment
Please, Sign In to add comment