Advertisement
Guest User

Untitled

a guest
Aug 6th, 2009
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.88 KB | None | 0 0
  1. #! /bin/sh
  2. echo DOWNLOADING: $1
  3. wget --header='User-Agent: Opera/9.64 (Windows NT 5.1; U; cs) Presto/2.1.1' \
  4.               --header='Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1' \
  5.               --header='Accept-Language: cs,cs-CZ;q=0.9,en;q=0.8' \
  6.               --header='Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1' \
  7.               --header='Accept-Encoding: deflate, identity, *;q=0' \
  8.               --header='Connection: Keep-Alive' \
  9.               -q -O tmp_first.tmp $1
  10. first_url=`egrep -o "(http://.+\.rapidshare.com/files/[^\"]*)" tmp_first.tmp | sed q`
  11. rm tmp_first.tmp
  12. sleep 3
  13. is_true=false
  14. while [ $is_true = "false" ];
  15. do
  16.   wget --header='User-Agent: Opera/9.64 (Windows NT 5.1; U; cs) Presto/2.1.1' \
  17.        --header='Accept: text/html, application/xml;q=0.9, application/xhtml+xml, image/png, image/jpeg, image/gif, image/x-xbitmap, */*;q=0.1' \
  18.        --header='Accept-Language: cs,cs-CZ;q=0.9,en;q=0.8' \
  19.        --header='Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1' \
  20.        --header='Accept-Encoding: deflate, identity, *;q=0' \
  21.        --header='Connection: Keep-Alive' \
  22.        -q --post-data="dl.start=Free;" -O tmp_second.tmp $first_url
  23.   wait_number=`egrep -o "var c=.*;" tmp_second.tmp | egrep -o "[0-9]+"`
  24.   count_link=`egrep -c -o '(http://.+\.rapidshare.com/[^\\"]*)' tmp_second.tmp`
  25.   if [ $count_link -lt 2 ]; then
  26.     rm tmp_second.tmp
  27.     echo error... wait 1 min
  28.     sleep 60
  29.   else
  30.     is_true=true
  31.   fi
  32. done
  33. RANDOM=$$$(date +%S)
  34. number=$(( ( $RANDOM % ( $count_link - 1 ) ) + 2 ))
  35. egrep -o "(http://.+\.rapidshare.com/[^\\\"]*)" tmp_second.tmp > links.tmp
  36. final_link=`sed -n $number,"$number"p links.tmp`
  37. echo Download... wait time: $(( $wait_number + 1 ))
  38. echo
  39. sleep $(( $wait_number + 1 ))
  40. rm tmp_second.tmp
  41. rm links.tmp
  42. wget $final_link
  43. echo
  44. echo
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement