source: titan/mediathek/localhoster/hoster.sh @ 40122

Last change on this file since 40122 was 40122, checked in by obi, 5 years ago

fix

  • Property svn:executable set to *
File size: 6.1 KB
Line 
1#!/bin/sh
2# first sh box hoster for titannit mfg obi
3
4TYPE=$1
5INPUT=$2
6
7INPUT=`echo $INPUT | sed 's!/Out/?s=!!g'`
8
9ARCH=`cat /etc/.arch`
10BOX=`cat /etc/model`
11TMP=/tmp/localcache
12CMD=/tmp/localhoster
13USERAGENT='Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.7.3000 Chrome/30.0.1599.101 Safari/537.36'
14debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
15curlbin="curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A $USERAGENT"
16curlbin2='curl -k -s --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies'
17youtubebin="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent '$USERAGENT' -g"
18
19if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
20if [ "$debuglevel" == "99" ]; then curlbin2="$curlbin2 -v"; fi
21#if [ "$debuglevel" == "99" ]; then youtubebin="$youtubebin --verbose"; fi
22
23wgetbin="wget -q -T2"
24
25BIN="$CMD"/bin/python."$ARCH"
26
27if [ ! -e "/tmp/localhoster/lib/python2.7/lib-dynload" ];then
28        ln -fs /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload
29fi
30if [ ! -e "/tmp/localhoster/lib/libpython2.7.so.1.0" ];then
31        ln -fs /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0
32fi
33export PYTHONHOME=/tmp/localhoster
34export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/localhoster/lib
35
36if [ -e "$TMP/hoster.tar" ]; then rm -f $TMP/hoster.tar; fi
37if [ -e "$TMP/parser.tar" ]; then rm -f $TMP/parser.tar; fi
38
39if [ "$ARCH" == "sh4" ] && [ "$BOX" != "ufs912" ]; then
40        if [ -e "$CMD/lib/python2.7/lib-dynload.mipsel" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.mipsel; fi
41        if [ -e "$CMD/lib/libpython2.7.so.1.0.mipsel" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.mipsel; fi
42        if [ -e "$CMD/lib/python2.7/lib-dynload.arm" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.arm; fi
43        if [ -e "$CMD/lib/libpython2.7.so.1.0.arm" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.arm; fi
44fi
45
46hostercheck=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | tr '.' '\n' | wc -l`
47hosterline=`expr $hostercheck - 1`
48hoster=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | cut -d"." -f$hosterline`
49#echo $hoster
50
51debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
52curlbin='curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies'
53if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
54
55ecostream()
56{
57        hosterurl=http://www.ecostream.tv
58        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`"
59        streampage=`$curlbin $hosterurl/js/ecoss.js | grep "$.post('" | grep videos | cut -d"'" -f2`
60        streamurl=$hosterurl`$curlbin -H "X-Requested-With: XMLHttpRequest" -X POST --data "$data" --referer $INPUT $hosterurl/$streampage | cut -d'"' -f6`
61        if [ "`echo $streamurl | grep DOCTYPE | wc -l`" -eq 0 ] && [ "$streamurl" != "$hosterurl" ];then
62                echo $streamurl
63        fi
64}
65
66giga()
67{
68        streampage=`$curlbin $INPUT | grep "<iframe src=" | cut -d'"' -f2 | head -n1`
69        streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 1080p`
70        if [ -z "$streamurl" ];then
71                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 720p`
72        fi
73        if [ -z "$streamurl" ];then
74                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 480p`
75        fi
76        if [ -z "$streamurl" ];then
77                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 360p`
78        fi
79        if [ -z "$streamurl" ];then
80                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 240p`
81        fi
82        if [ -z "$streamurl" ];then
83                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 180p`
84        fi
85        echo $streamurl
86}
87
88vidup()
89{
90        $BIN $CMD/vidup.py $INPUT
91}
92
93nosvideo()
94{
95        $BIN $CMD/nosvideo.py $INPUT
96}
97
98allmyvideos()
99{
100        $BIN $CMD/allmyvideos.py $INPUT
101}
102
103flashx()
104{
105        $BIN $CMD/flashx.py $INPUT
106}
107
108openload()
109{
110        $BIN $CMD/openload.py $INPUT
111}
112
113briskfile()
114{
115        $BIN $CMD/briskfile.py $INPUT
116}
117
118vodlocker()
119{
120        $BIN $CMD/vodlocker.py $INPUT
121}
122
123videoweed()
124{
125        $BIN $CMD/videoweed.py $INPUT
126}
127
128vodzi()
129{
130        $BIN $CMD/vodzi.py $INPUT
131}
132
133youwatch()
134{
135        $BIN $CMD/youwatch.py $INPUT
136}
137
138thevideo()
139{
140        $BIN $CMD/thevideo.py $INPUT
141}
142
143movshare()
144{
145        $BIN $CMD/movshare.py $INPUT
146}
147
148streamcloud()
149{
150        $BIN $CMD/streamcloud.py $INPUT
151}
152
153vidzi()
154{
155        $BIN $CMD/vidzi.py $INPUT
156}
157
158vivo()
159{
160        $BIN $CMD/vivo.py $INPUT
161}
162
163vidto()
164{
165        $BIN $CMD/vidto.py $INPUT
166}
167
168goldesel()
169{
170        $BIN $CMD/goldesel.py $INPUT
171}
172
173cloudflare()
174{
175        $BIN $CMD/cloudflare.py $INPUT
176}
177
178nowvideo()
179{
180        $BIN $CMD/nowvideo.py $INPUT
181}
182
183divxstage()
184{
185        $BIN $CMD/divxstage.py $INPUT
186}
187
188novamov()
189{
190        $BIN $CMD/novamov.py $INPUT
191}
192
193xvidstage()
194{
195        $BIN $CMD/xvidstage.py $INPUT
196}
197
198directstream()
199{
200        echo "$INPUT"
201#       rm -f /tmp/_last_hoster_* > /dev/null 2>&1
202        echo  "$INPUT" > /tmp/.last_hoster_$hoster
203}
204
205youtube_dl()
206{
207#       rm -f /tmp/_last_hoster_* > /dev/null 2>&1
208        echo "$BIN $youtubebin $INPUT" > /tmp/.last_hoster_youtube_dl
209#       $BIN $youtubebin "$INPUT"
210        $BIN $CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent "$USERAGENT" -g "$INPUT"
211}
212
213if [ "$TYPE" == "get" ];then
214        echo  "$INPUT" > /tmp/.last_hoster_$hoster
215        case $hoster in
216                ecostream) ecostream $INPUT;;
217                giga) giga $INPUT;;
218                nosvideo) nosvideo $INPUT;;
219                allmyvideos) allmyvideos $INPUT;;
220                flashx) flashx $INPUT;;
221                openload_aus) openload $INPUT;;
222                briskfile) briskfile $INPUT;;
223                videoweed|bitvid) videoweed $INPUT;;
224                vodlocker) vodlocker $INPUT;;
225                youwatch|chouhaa|ay8ou8ohth) youwatch $INPUT;;
226                thevideo) thevideo $INPUT;;
227                movshare|wholecloud|vidgg) movshare $INPUT;;
228                vidto) vidto $INPUT;;
229                vidup) vidup $INPUT;;
230                vidzi) vidzi $INPUT;;
231                vivo) vivo $INPUT;;
232                goldesel|movie4k) cloudflare $INPUT;;
233                streamcloud1) streamcloud $INPUT;;     
234                nowvideo) nowvideo $INPUT;;
235                divxstage|cloudtime) divxstage $INPUT;;
236                novamov|auroravid) novamov $INPUT;;
237                xvidstage) xvidstage $INPUT;;
238                redirector|googlevideo|vodcloud|google) directstream "$INPUT";;
239        esac
240fi
241
242if [ "$TYPE" == "youtube_dl" ];then
243        case $hoster in
244                *) youtube_dl $INPUT;;
245        esac
246fi
Note: See TracBrowser for help on using the repository browser.