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 | |
---|
14 | hoster=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!http://!!' | sed 's!https://!!' | cut -d'/' -f1 | sed 's/www.//' | tr '.' '\n' | head -n1` |
---|
15 | |
---|
16 | debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2` |
---|
17 | curlbin='curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies' |
---|
18 | if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi |
---|
19 | |
---|
20 | ecostream() |
---|
21 | { |
---|
22 | hosterurl=http://www.ecostream.tv |
---|
23 | 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`" |
---|
24 | streampage=`$curlbin $hosterurl/js/ecoss.js | grep "$.post('" | grep videos | cut -d"'" -f2` |
---|
25 | streamurl=$hosterurl`$curlbin -H "X-Requested-With: XMLHttpRequest" -X POST --data "$data" --referer $INPUT $hosterurl/$streampage | cut -d'"' -f6` |
---|
26 | if [ "$streamurl" != "$hosterurl" ];then |
---|
27 | echo $streamurl |
---|
28 | fi |
---|
29 | } |
---|
30 | |
---|
31 | giga() |
---|
32 | { |
---|
33 | streampage=`$curlbin $INPUT | grep "<iframe src=" | cut -d'"' -f2 | head -n1` |
---|
34 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 1080p` |
---|
35 | if [ -z "$streamurl" ];then |
---|
36 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 720p` |
---|
37 | fi |
---|
38 | if [ -z "$streamurl" ];then |
---|
39 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 480p` |
---|
40 | fi |
---|
41 | if [ -z "$streamurl" ];then |
---|
42 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 360p` |
---|
43 | fi |
---|
44 | if [ -z "$streamurl" ];then |
---|
45 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 240p` |
---|
46 | fi |
---|
47 | if [ -z "$streamurl" ];then |
---|
48 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 180p` |
---|
49 | fi |
---|
50 | echo $streamurl |
---|
51 | } |
---|
52 | |
---|
53 | if [ "$TYPE" == "get" ];then |
---|
54 | case $hoster in |
---|
55 | ecostream) ecostream $INPUT;; |
---|
56 | giga) giga $INPUT;; |
---|
57 | esac |
---|
58 | fi |
---|