1 | #!/bin/sh |
---|
2 | # first sh box hoster for titannit mfg obi |
---|
3 | |
---|
4 | TYPE=$1 |
---|
5 | INPUT=$2 |
---|
6 | |
---|
7 | ARCH=`cat /etc/.arch` |
---|
8 | debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2` |
---|
9 | curlbin='curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies' |
---|
10 | if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi |
---|
11 | wgetbin="wget -q -T2" |
---|
12 | TMP=/tmp/localcache |
---|
13 | CMD=/tmp/localhoster |
---|
14 | BIN=python |
---|
15 | |
---|
16 | if [ "$ARCH" = "sh4" ];then |
---|
17 | BIN="$CMD/bin/$BIN" |
---|
18 | export PYTHONHOME=/tmp/localhoster |
---|
19 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/localhoster/lib |
---|
20 | fi |
---|
21 | |
---|
22 | hoster=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!http://!!' | sed 's!https://!!' | cut -d'/' -f1 | sed 's/www.//' | tr '.' '\n' | head -n1` |
---|
23 | |
---|
24 | debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2` |
---|
25 | curlbin='curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies' |
---|
26 | if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi |
---|
27 | |
---|
28 | ecostream() |
---|
29 | { |
---|
30 | hosterurl=http://www.ecostream.tv |
---|
31 | data="tpm=`$curlbin $INPUT | grep footerhash | cut -d"'" -f2``$curlbin $INPUT | grep superslots | cut -d"'" -f2`&id=`$curlbin $INPUT | grep data-id | cut -d'"' -f4`" |
---|
32 | streampage=`$curlbin $hosterurl/js/ecoss.js | grep "$.post('" | grep videos | cut -d"'" -f2` |
---|
33 | streamurl=$hosterurl`$curlbin -H "X-Requested-With: XMLHttpRequest" -X POST --data "$data" --referer $INPUT $hosterurl/$streampage | cut -d'"' -f6` |
---|
34 | if [ "$streamurl" != "$hosterurl" ];then |
---|
35 | echo $streamurl |
---|
36 | fi |
---|
37 | } |
---|
38 | |
---|
39 | giga() |
---|
40 | { |
---|
41 | streampage=`$curlbin $INPUT | grep "<iframe src=" | cut -d'"' -f2 | head -n1` |
---|
42 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 1080p` |
---|
43 | if [ -z "$streamurl" ];then |
---|
44 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 720p` |
---|
45 | fi |
---|
46 | if [ -z "$streamurl" ];then |
---|
47 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 480p` |
---|
48 | fi |
---|
49 | if [ -z "$streamurl" ];then |
---|
50 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 360p` |
---|
51 | fi |
---|
52 | if [ -z "$streamurl" ];then |
---|
53 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 240p` |
---|
54 | fi |
---|
55 | if [ -z "$streamurl" ];then |
---|
56 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 180p` |
---|
57 | fi |
---|
58 | echo $streamurl |
---|
59 | } |
---|
60 | |
---|
61 | vidup() |
---|
62 | { |
---|
63 | $BIN $CMD/vidup.py $INPUT |
---|
64 | } |
---|
65 | |
---|
66 | nosvideo() |
---|
67 | { |
---|
68 | $BIN $CMD/nosvideo.py $INPUT |
---|
69 | } |
---|
70 | |
---|
71 | allmyvideos() |
---|
72 | { |
---|
73 | $BIN $CMD/allmyvideos.py $INPUT |
---|
74 | } |
---|
75 | |
---|
76 | flashx() |
---|
77 | { |
---|
78 | $BIN $CMD/flashx.py $INPUT |
---|
79 | } |
---|
80 | |
---|
81 | openload() |
---|
82 | { |
---|
83 | $BIN $CMD/openload.py $INPUT |
---|
84 | } |
---|
85 | |
---|
86 | if [ "$TYPE" == "get" ];then |
---|
87 | case $hoster in |
---|
88 | ecostream) ecostream $INPUT;; |
---|
89 | giga) giga $INPUT;; |
---|
90 | vidup) vidup $INPUT;; |
---|
91 | nosvideo) nosvideo $INPUT;; |
---|
92 | allmyvideos) allmyvideos $INPUT;; |
---|
93 | flashx) flashx $INPUT;; |
---|
94 | openload) openload $INPUT;; |
---|
95 | esac |
---|
96 | fi |
---|