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

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

update tithek hoster streamlist

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