Search google

Google
 

This is the place where I leave my scripts, my useful files, glad to have your suggestions. If you want to make discuss, please contact me at YM id bornbygoogle or my mail bornbygoogle@yahoo.com or simply let ur mail. I'll try to contact as soon as possible :) Nice to see you :D

Sunday, April 20, 2008

Bash script : Lấy truyện tranh từ trang comic.vuilen.com !

Một bash script nhỏ tự viết để lấy truyện đọc cho đỡ buồn :

Save this script with the name comic-get :

#!/bin/bash
#USAGE : comic-get <_ten truyen_> <_so tap_> <_so trang trong 1 tap truyen_>
cd <_path_where_you_want_to_store_these_comic_books_>
echo "Script lay truyen tu trang comic.vuilen.com !"
mkdir $1
cd $1
for ((i=1; i<=$2; i++ ));
do
mkdir Tap\ $i/
wget http://data.vuilen.com/comic/3zdssxfhjgiu87z65txdfghyu761x/$1/tap$i/img/bia.jpg
for (( j=1; j<=$3; j++ ));
do
wget -o log.txt http://data.vuilen.com/comic/3zdssxfhjgiu87z65txdfghyu761x/$1/tap$i/img/Untitled-$j.jpg
fault=`cat log.txt | grep "ERROR 404" | wc -l`
if [ $fault -ne 0 ]; then
wget -o log.txt http://data.vuilen.com/comic/3zdssxfhjgiu87z65txdfghyu761x/$1/tap$i/img/$j.jpg
fi
done
echo "Download xong ! Bat dau thuc hien doi ten de sap xep truyen theo thu' tu. can doc !"
rename 's/^Untitled-//g ; s/^0+//g' *.jpg
rename -v 's/^(\d{1})\.jpg$/00$1\.jpg/' *.jpgFree to use, but please
rename -v 's/^(\d{2})\.jpg$/0$1\.jpg/' *.jpg
rename -v 's/^bia/000/' *.jpg
cp *.jpg Tap\ $i/
rm *.jpg
done
rm log.txt
cd ..
echo "Tao mot hoac nhieu file rar co dung luong 100M ! :D ;) "
rar a -m5 -v100M $1.rar $1
echo "All done ! Have a good time !"

#Copyright superguepard at bornbygoogle@yahoo.com

Then give the execute permission to it : chmod +x comic-get
Now, you can grab with the command : comic-get 200
<_ten truyen_> : là tên tiếng việt viết thường. VD : Conan ---> conan, Thám tử Kindaichi ---> thamtukindaichi
<_so tap_> : số tập mà truyện đó có ( vào comic.vuilen.com kiểm tra )

If you have the errors, please tell me, I will fix it and return to you immediately.
This script is only run with linux.

No comments:

Convert Megaupload links to Rapidshare links !

If someone want to convert Megaupload to Rapidshare links, please let me know, I'll do it for you ! ( for free, all ). If you want, please send those links to me, with the mail title : Convert to Rapidshare !. My mail is bornbygoogle@yahoo.com. Or YM ID : bornbygoogle.

Nice to help you ! :)