Tuesday, February 9, 2010

Automate downloading from hotfile.com

    1 #!/bin/bash
2
3 RED='\e[1;31m'
4 CYAN='\e[1;36m'
5 NC='\e[0m' # No Color
6
7 if [ -z "$1" ]
8 then
9 echo
10 echo -e "${RED}[+] usage: ${CYAN}`basename $0` http://hotfile.com/...
11 /filename.rar.html${NC}"
12 echo
13 exit
14 fi
15
16 url="$1"
17
18 echo
19 echo -e "[+] Input URL : ${RED}$url${NC}"
20
21 tm_='1245072880'
22 tmhash_='e5b845119f0055c5d8554ee5f2ffc7b2d5ef86d7'
23 wait_='30'
24 waithash_='3bf07c5d83f2e652ff22eeaee00a6f08d4d2409a'
25 action_='capt'
26
27 line_with_url='http://hotfile.com/get/'
28
29 url2=`wget -q "$url" --post-data "tm=${tm_}&tmhash=${tmhash_}&wait=${wait_}
30 &waithash=${waithash_}&action=${action_}" -O - | grep "$line_with_url" |
31 sed -s 's/.*<a href="\([^"]*\)".*$/\1/g'`
32
33 echo -e "[+] Real URL : ${RED}$url2 ${NC}"
34 echo
35
36 if [ ! -z "$url2" ]
37 then
38 wget "$url2"
39 fi
40