Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ###################################
- # Skrypt pobierajacy wszystkie ob-#
- # razki z podanego kanalu 4chana #
- # (Oryginalny rozmiar) #
- ###################################
- ##Config
- FILENAME="imglist"
- FILENAME2="imglist2"
- ##Input
- echo "Podaj kanal: (ex. b)"
- read CHANNEL
- echo "Do ktorej strony? (max 15 dla b, 10 dla reszty)"
- read PAGES
- ##Pre-processing
- #FIRST PAGE
- ARRAY=($(curl -s "http://boards.4chan.org/"$CHANNEL"/"| grep -o -e 'res/[0-9]\{2,10\}' | uniq))
- echo "--Przetwarzanie strony 0 z "$PAGES
- for x in ${ARRAY[@]}
- do
- #echo $x
- curl "http://boards.4chan.org/"$CHANNEL"/"$x| grep -o -e "//images.4chan.org/"$CHANNEL"/src/................." | uniq>>$FILENAME
- done
- #REST OF PAGES
- for i in {1..$PAGES}
- do
- echo "Przetwarzanie strony "$i" z "$PAGES
- ARRAY=($(curl -s "http://boards.4chan.org/"$CHANNEL"/"$i| grep -o -e 'res/[0-9]\{2,10\}' | uniq))
- for x in ${ARRAY[@]}
- do
- #echo $x
- curl "http://boards.4chan.org/"$CHANNEL"/"$x| grep -o -e "//images.4chan.org/"$CHANNEL"/src/................." | uniq>>$FILENAME
- done
- done
- echo "-- Przetworzono"
- ##Downloading
- echo "-- Pobieranie"
- sed $FILENAME -e "s/\/\/images/http\:\/\/images/g" >$FILENAME2
- rm $FILENAME
- mkdir $CHANNEL
- mv ./$FILENAME2 ./$CHANNEL/$FILENAME2
- cd $CHANNEL
- wget -nc `cat $FILENAME2`
- rm $FILENAME2
- cd ..
- #EOF
Add Comment
Please, Sign In to add comment