Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/sh
- echo DOWNLOADING: $1
- wget --header='User-Agent: Opera/9.64 (Windows NT 5.1; U; cs) Presto/2.1.1' \
- --header='Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1' \
- --header='Accept-Language: cs,cs-CZ;q=0.9,en;q=0.8' \
- --header='Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1' \
- --header='Accept-Encoding: deflate, identity, *;q=0' \
- --header='Connection: Keep-Alive' \
- -q -O tmp_first.tmp $1
- first_url=`egrep -o "(http://.+\.rapidshare.com/files/[^\"]*)" tmp_first.tmp | sed q`
- rm tmp_first.tmp
- sleep 3
- is_true=false
- while [ $is_true = "false" ];
- do
- wget --header='User-Agent: Opera/9.64 (Windows NT 5.1; U; cs) Presto/2.1.1' \
- --header='Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1' \
- --header='Accept-Language: cs,cs-CZ;q=0.9,en;q=0.8' \
- --header='Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1' \
- --header='Accept-Encoding: deflate, identity, *;q=0' \
- --header='Connection: Keep-Alive' \
- -q --post-data="dl.start=Free;" -O tmp_second.tmp $first_url
- wait_number=`egrep -o "var c=.*;" tmp_second.tmp | egrep -o "[0-9]+"`
- count_link=`egrep -c -o '(http://.+\.rapidshare.com/[^\\"]*)' tmp_second.tmp`
- if [ $count_link -lt 2 ]; then
- rm tmp_second.tmp
- echo error... wait 1 min
- sleep 60
- else
- is_true=true
- fi
- done
- RANDOM=$$$(date +%S)
- number=$(( ( $RANDOM % ( $count_link - 1 ) ) + 2 ))
- egrep -o "(http://.+\.rapidshare.com/[^\\\"]*)" tmp_second.tmp > links.tmp
- final_link=`sed -n $number,"$number"p links.tmp`
- echo Download... wait time: $(( $wait_number + 1 ))
- echo
- sleep $(( $wait_number + 1 ))
- rm tmp_second.tmp
- rm links.tmp
- wget $final_link
- echo
- echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement