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

Last change on this file since 41274 was 41274, checked in by obi, 4 years ago

update tithel add hoster streamlist

  • Property svn:executable set to *
File size: 11.0 KB
Line 
1#!/bin/sh
2# first sh box hoster for titannit mfg obi
3
4TYPE=$1
5INPUT=$2
6DEST=$3
7
8INPUT=`echo $INPUT | sed 's!/Out/?s=!!g'`
9
10ARCH=`cat /etc/.arch`
11BOX=`cat /etc/model`
12TMP=/tmp/localcache
13CMD=/tmp/localhoster
14#USERAGENT='Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0'
15USERAGENT='Mozilla%2F5.0+%28Windows+NT+6.3%3B+rv%3A36.0%29+Gecko%2F20100101+Firefox%2F36.0'
16debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
17curlbin="curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A \$USERAGENT"
18curlbin2="curl -k -s --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A '$USERAGENT'"
19youtubebin="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent '$USERAGENT' --format mp4 --restrict-filenames --ignore-errors -g"
20youtubebinbg="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent '$USERAGENT' --format mp4 --restrict-filenames --ignore-errors --output"
21export PYTHONHOME=/tmp/localhoster
22export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/localhoster/lib
23
24
25if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
26if [ "$debuglevel" == "99" ]; then curlbin2="$curlbin2 -v"; fi
27if [ "$debuglevel" == "99" ]; then youtubebin="$youtubebin --verbose"; fi
28
29wgetbin="wget -q -T2"
30
31BIN="$CMD"/bin/python."$ARCH"
32
33if [ ! -e "/tmp/localhoster/lib/python2.7/lib-dynload" ] && [ -e /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" ];then
34#       ln -fs /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload
35        mv -f /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload
36        rm -rf /tmp/localhoster/lib/python2.7/lib-dynload.*
37fi
38if [ ! -e "/tmp/localhoster/lib/libpython2.7.so.1.0" ] && [ -e /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" ];then
39#       ln -fs /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0
40        mv -f /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0
41        rm -f /tmp/localhoster/lib/libpython2.7.so.1.0.*
42fi
43if [ ! -e "/tmp/localhoster/lib/libcrypto.so.1.0.0" ] && [ -e /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" ];then
44#       ln -fs /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" /tmp/localhoster/lib/libcrypto.so.1.0.0
45        mv -f /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" /tmp/localhoster/lib/libcrypto.so.1.0.0
46        rm -f /tmp/localhoster/lib/libcrypto.so.1.0.0.*
47fi
48if [ ! -e "/tmp/localhoster/lib/libssl.so.1.0.0" ] && [ -e /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" ];then
49#       ln -fs /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" /tmp/localhoster/lib/llibssl.so.1.0.0
50        mv -f /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" /tmp/localhoster/lib/libssl.so.1.0.0
51        rm -f /tmp/localhoster/lib/libssl.so.1.0.0.*
52fi
53
54if [ -e "$TMP/hoster.tar" ]; then rm -f $TMP/hoster.tar; fi
55if [ -e "$TMP/parser.tar" ]; then rm -f $TMP/parser.tar; fi
56
57if [ "$ARCH" == "sh4" ] && [ "$BOX" != "ufs912" ]; then
58        if [ -e "$CMD/lib/python2.7/lib-dynload.mipsel" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.mipsel; fi
59        if [ -e "$CMD/lib/python2.7/lib-dynload.arm" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.arm; fi
60
61        if [ -e "$CMD/lib/libpython2.7.so.1.0.mipsel" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.mipsel; fi
62        if [ -e "$CMD/lib/libpython2.7.so.1.0.arm" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.arm; fi
63
64        if [ -e "$CMD/lib/libssl.so.1.0.0.mipsel" ]; then rm -rf $CMD/lib/libssl.so.1.0.0.mipsel; fi
65        if [ -e "$CMD/lib/libssl.so.1.0.0.arm" ]; then rm -rf $CMD/lib/libssl.so.1.0.0.arm; fi
66
67        if [ -e "$CMD/lib/libcrypto.so.1.0.0.mipsel" ]; then rm -rf $CMD/lib/libcrypto.so.1.0.0.mipsel; fi
68        if [ -e "$CMD/lib/libcrypto.so.1.0.0.arm" ]; then rm -rf $CMD/lib/libcrypto.so.1.0.0.arm; fi
69fi
70
71hostercheck=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | tr '.' '\n' | wc -l`
72hosterline=`expr $hostercheck - 1`
73hoster=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | cut -d"." -f$hosterline`
74#echo $hoster
75
76ecostream()
77{
78        hosterurl=http://www.ecostream.tv
79        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`"
80        streampage=`$curlbin $hosterurl/js/ecoss.js | grep "$.post('" | grep videos | cut -d"'" -f2`
81        streamurl=$hosterurl`$curlbin -H "X-Requested-With: XMLHttpRequest" -X POST --data "$data" --referer $INPUT $hosterurl/$streampage | cut -d'"' -f6`
82        if [ "`echo $streamurl | grep DOCTYPE | wc -l`" -eq 0 ] && [ "$streamurl" != "$hosterurl" ];then
83                echo $streamurl
84        fi
85}
86
87giga()
88{
89        streampage=`$curlbin $INPUT | grep "<iframe src=" | cut -d'"' -f2 | head -n1`
90        streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 1080p`
91        if [ -z "$streamurl" ];then
92                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 720p`
93        fi
94        if [ -z "$streamurl" ];then
95                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 480p`
96        fi
97        if [ -z "$streamurl" ];then
98                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 360p`
99        fi
100        if [ -z "$streamurl" ];then
101                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 240p`
102        fi
103        if [ -z "$streamurl" ];then
104                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 180p`
105        fi
106        echo $streamurl
107}
108
109vidup()
110{
111        $BIN $CMD/vidup.py $INPUT
112}
113
114nosvideo()
115{
116        $BIN $CMD/nosvideo.py $INPUT
117}
118
119allmyvideos()
120{
121        $BIN $CMD/allmyvideos.py $INPUT
122}
123
124flashx()
125{
126        $BIN $CMD/flashx.py $INPUT
127}
128
129openload()
130{
131        $BIN $CMD/openload.py $INPUT
132}
133
134briskfile()
135{
136        $BIN $CMD/briskfile.py $INPUT
137}
138
139vodlocker()
140{
141        $BIN $CMD/vodlocker.py $INPUT
142}
143
144videoweed()
145{
146        $BIN $CMD/videoweed.py $INPUT
147}
148
149vodzi()
150{
151        $BIN $CMD/vodzi.py $INPUT
152}
153
154youwatch()
155{
156        $BIN $CMD/youwatch.py $INPUT
157}
158
159thevideo()
160{
161        $BIN $CMD/thevideo.py $INPUT
162}
163
164movshare()
165{
166        $BIN $CMD/movshare.py $INPUT
167}
168
169streamcloud()
170{
171        $BIN $CMD/streamcloud.py $INPUT
172}
173
174vidzi()
175{
176        $BIN $CMD/vidzi.py $INPUT
177}
178
179vivo()
180{
181        $BIN $CMD/vivo.py $INPUT
182}
183
184vidto()
185{
186        $BIN $CMD/vidto.py $INPUT
187}
188
189goldesel()
190{
191        $BIN $CMD/goldesel.py $INPUT
192}
193
194cloudflare()
195{
196        $BIN $CMD/cloudflare.py $INPUT
197}
198
199nowvideo()
200{
201        $BIN $CMD/nowvideo.py $INPUT
202}
203
204divxstage()
205{
206        $BIN $CMD/divxstage.py $INPUT
207}
208
209novamov()
210{
211        $BIN $CMD/novamov.py $INPUT
212}
213
214xvidstage()
215{
216        $BIN $CMD/xvidstage.py $INPUT
217}
218
219waaw()
220{
221        $BIN $CMD/waaw.py $INPUT
222}
223
224streamango()
225{
226        $BIN $CMD/streamango.py $INPUT
227}
228
229vidlox()
230{
231        $BIN $CMD/vidlox.py $INPUT
232}
233
234aliezold()
235{
236        URL=`$curlbin "$INPUT" | sed 's/source:/\nsource:/' | grep ^source: | cut -d"'" -f2`
237        REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'`
238        echo "$URL|Referer=$REFERER&User-Agent=$USERAGENT"
239}
240
241aliez()
242{
243        #http://emb.aliez.me/player/live.php?id=56180&w=700&h=480"
244        $curlbin "$INPUT" -o $TMP/cache.$hoster.1
245        cat $TMP/cache.$hoster.1 | sed 's/source:/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.$hoster.url1
246        URL=`cat $TMP/cache.$hoster.url1 | head -n1`
247
248#URL=""
249        #"file":                "rtmp%3A%2F%2Fa3.aliez.me%2Flive%2Fstreama57449%3Ftoken%3Dd11304fabb8e64327df8427e1c2fd5d9"
250        if [ -z "$URL" ];then
251                cat $TMP/cache.$hoster.1 | sed 's/"file":/\nfound=/' | grep ^found= | cut -d'"' -f2 >$TMP/cache.$hoster.url3
252                URL=`cat $TMP/cache.$hoster.url3 | head -n1`
253        fi
254        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
255        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
256
257        if [ "`echo $URL | grep rtmp | wc -l`" -eq 1 ];then
258
259                #new swfobject.embedSWF("http://i.aliez.me/swf/playernew.swf?0", "mediaspace", "700", "480", "9.0.115.0", false, flashvars, params);
260                cat $TMP/cache.$hoster.1 | sed 's/swfobject.embedSWF/\nfound=/' | grep ^found= | cut -d'"' -f2 >$TMP/cache.$hoster.rtmp.swfurl
261                SWFURL=`cat $TMP/cache.$hoster.rtmp.swfurl | head -n1`
262                URL=`echo "$URL" | sed -e 's/%3A/:/g' -e 's!%2F!/!g' -e 's!%3D!=!g' -e 's!%3F!?!g'`
263                EXTRA=" pageUrl=$REFERER"
264                if [ ! -z "$SWFURL" ];then
265                        EXTRA="$EXTRA swfUrl=$SWFURL swfVfy=1 timeout=15 live=1"
266                fi
267        fi
268
269#       URL=""
270        #file:  'http://a3.aliez.me:8080/hls/streama57449/index.m3u8?st=dgw2dOq8tyFkLLBLn2ycXA',
271        if [ -z "$URL" ];then
272                cat $TMP/cache.$hoster.1 | sed 's/file:/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.$hoster.url2
273                URL=`cat $TMP/cache.$hoster.url2 | head -n1`
274                EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
275        fi
276
277        echo "$URL$EXTRA"
278#       echo "$URL|If-None-Match=5a1842ad-c4&Accept=*/*&Referer=$REFERER&User-Agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36"
279
280
281}
282
283sport7()
284{
285        #http://sport7.tech/487b826914d11080dce4b502052b012d-live.html
286        #var videoLink = 'http://g4.securestream.sport7.tech/stream/NzYyZDUwZWNkODc5YWM5YjViY2ZkOTVhZGNjOGM1ZTc=/BTSport3.m3u8';
287           
288        URL=`$curlbin "$INPUT" | sed 's/var videoLink/\nfound=/' | grep ^found= | cut -d"'" -f2`
289        REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'`
290        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
291        echo "$URL|Referer=$REFERER&X-f=95.91.79.87&User-Agent=$USERAGENT"
292}
293
294
295directstream()
296{
297        echo "$INPUT"
298#       rm -f /tmp/_last_hoster_* > /dev/null 2>&1
299        echo  "$INPUT" > /tmp/.last_hoster_$hoster.log
300}
301
302youtube_dl()
303{
304#       echo "$BIN $youtubebin $INPUT" > /tmp/.last_hoster_youtube_dl.log
305#       $BIN $CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent "$USERAGENT" --format mp4 --restrict-filenames --ignore-errors -g "$INPUT" > /tmp/youtube_dl.streamlink.log 2>&1
306#       cat /tmp/youtube_dl.streamlink.log | tail -n1
307        $BIN $youtubebin "$INPUT"
308}
309
310youtube_dlbg()
311{
312#       echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_youtube_dlbg.log
313#       URL=`$BIN $CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent "$USERAGENT" --format mp4 --restrict-filenames --ignore-errors --output "$1" "$2"`
314#       echo "$URL" >> /tmp/.last_hoster_youtube_dlbg.log
315#       echo $URL
316        $BIN $youtubebinbg $DEST $INPUT
317}
318
319if [ "$TYPE" == "get" ];then
320        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
321        case $hoster in
322                ecostream) ecostream $INPUT;;
323                giga) giga $INPUT;;
324                nosvideo) nosvideo $INPUT;;
325                allmyvideos) allmyvideos $INPUT;;
326                flashx) flashx $INPUT;;
327                openload|oload) openload $INPUT;;
328                briskfile) briskfile $INPUT;;
329                videoweed|bitvid) videoweed $INPUT;;
330                vodlocker) vodlocker $INPUT;;
331                youwatch|chouhaa|ay8ou8ohth) youwatch $INPUT;;
332                thevideo) thevideo $INPUT;;
333                movshare|wholecloud|vidgg) movshare $INPUT;;
334                vidto) vidto $INPUT;;
335                vidup) vidup $INPUT;;
336                vidzi) vidzi $INPUT;;
337                vivo) vivo $INPUT;;
338                goldesel|movie4k) cloudflare $INPUT;;
339                streamcloud1) streamcloud $INPUT;;     
340                nowvideo) nowvideo $INPUT;;
341                divxstage|cloudtime) divxstage $INPUT;;
342                novamov|auroravid) novamov $INPUT;;
343                xvidstage) xvidstage $INPUT;;
344                waaw|netu|hqq) waaw $INPUT;;
345                streamango|streamcherry) streamango $INPUT;;
346                vidlox) vidlox $INPUT;;
347                redirector|googlevideo|vodcloud|google) directstream "$INPUT";;
348                aliez) aliez $INPUT;;
349                sport7) sport7 $INPUT;;
350        esac
351fi
352
353if [ "$TYPE" == "youtube_dl" ];then
354        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
355        case $hoster in
356                *) youtube_dl $INPUT;;
357        esac
358fi
359
360if [ "$TYPE" == "youtube_dlbg" ];then
361        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
362        case $hoster in
363                *) youtube_dlbg $DEST $INPUT;;
364        esac
365fi
366
Note: See TracBrowser for help on using the repository browser.