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

Last change on this file since 41385 was 41385, checked in by obi, 3 years ago

add broadcast

  • Property svn:executable set to *
File size: 29.0 KB
Line 
1#!/bin/sh
2# first sh box hoster for titannit mfg obi
3
4TYPE=$1
5INPUT=$2
6DEST=$3
7USER=$DEST
8PASS=$4
9
10INPUT=`echo $INPUT | sed 's!/Out/?s=!!g'`
11
12#FILENAME="`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'` $INPUT $PAGE $NEXT"
13FILENAME="`echo $INPUT | sed -e 's/\-\+/./g' | sed -e 's/\+\+/./g' | sed -e 's/\&\+/./g' -e 's#\/\+#.#g' -e 's/\?\+/./g' -e 's/:\+/./g' -e 's/;\+/./g' -e 's/=\+/./g' -e 's/ \+/./g' -e 's/\.\+/./g'`"
14PICNAME=`echo $FILENAME`
15
16if [ -z "$FILENAME" ]; then
17        FILENAME=none
18fi
19
20
21ARCH=`cat /etc/.arch`
22BOX=`cat /etc/model`
23TMP=/tmp/localcache
24CMD=/tmp/localhoster
25BIN="$CMD"/bin/python."$ARCH"
26HLSBIN="$CMD"/bin/hlsdl."$ARCH"
27#USERAGENT='Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0'
28USERAGENT='Mozilla%2F5.0+%28Windows+NT+6.3%3B+rv%3A36.0%29+Gecko%2F20100101+Firefox%2F36.0'
29debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
30curlbin="curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A $USERAGENT"
31curlbin2="curl -k -s --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A $USERAGENT"
32youtubebin="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent $USERAGENT --format mp4 --restrict-filenames --ignore-errors -g"
33youtubebinbg="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent $USERAGENT --format mp4 --restrict-filenames --ignore-errors --output"
34hlsdlbg="$HLSBIN -u $USERAGENT -o"
35
36export PYTHONHOME=/tmp/localhoster
37export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/localhoster/lib
38
39
40if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
41if [ "$debuglevel" == "99" ]; then curlbin2="$curlbin2 -v"; fi
42if [ "$debuglevel" == "99" ]; then youtubebin="$youtubebin --verbose"; fi
43
44wgetbin="wget -q -T2"
45
46if [ ! -e "/tmp/localhoster/lib/python2.7/lib-dynload" ] && [ -e /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" ];then
47#       ln -fs /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload
48        mv -f /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload
49        rm -rf /tmp/localhoster/lib/python2.7/lib-dynload.*
50fi
51if [ ! -e "/tmp/localhoster/lib/libpython2.7.so.1.0" ] && [ -e /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" ];then
52#       ln -fs /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0
53        mv -f /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0
54        rm -f /tmp/localhoster/lib/libpython2.7.so.1.0.*
55fi
56if [ ! -e "/tmp/localhoster/lib/libcrypto.so.1.0.0" ] && [ -e /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" ];then
57#       ln -fs /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" /tmp/localhoster/lib/libcrypto.so.1.0.0
58        mv -f /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" /tmp/localhoster/lib/libcrypto.so.1.0.0
59        rm -f /tmp/localhoster/lib/libcrypto.so.1.0.0.*
60fi
61if [ ! -e "/tmp/localhoster/lib/libssl.so.1.0.0" ] && [ -e /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" ];then
62#       ln -fs /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" /tmp/localhoster/lib/llibssl.so.1.0.0
63        mv -f /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" /tmp/localhoster/lib/libssl.so.1.0.0
64        rm -f /tmp/localhoster/lib/libssl.so.1.0.0.*
65fi
66
67if [ -e "$TMP/hoster.tar" ]; then rm -f $TMP/hoster.tar; fi
68if [ -e "$TMP/parser.tar" ]; then rm -f $TMP/parser.tar; fi
69
70if [ "$ARCH" == "sh4" ] && [ "$BOX" != "ufs912" ]; then
71        if [ -e "$CMD/lib/python2.7/lib-dynload.mipsel" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.mipsel; fi
72        if [ -e "$CMD/lib/python2.7/lib-dynload.arm" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.arm; fi
73
74        if [ -e "$CMD/lib/libpython2.7.so.1.0.mipsel" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.mipsel; fi
75        if [ -e "$CMD/lib/libpython2.7.so.1.0.arm" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.arm; fi
76
77        if [ -e "$CMD/lib/libssl.so.1.0.0.mipsel" ]; then rm -rf $CMD/lib/libssl.so.1.0.0.mipsel; fi
78        if [ -e "$CMD/lib/libssl.so.1.0.0.arm" ]; then rm -rf $CMD/lib/libssl.so.1.0.0.arm; fi
79
80        if [ -e "$CMD/lib/libcrypto.so.1.0.0.mipsel" ]; then rm -rf $CMD/lib/libcrypto.so.1.0.0.mipsel; fi
81        if [ -e "$CMD/lib/libcrypto.so.1.0.0.arm" ]; then rm -rf $CMD/lib/libcrypto.so.1.0.0.arm; fi
82fi
83
84hostercheck=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | tr '.' '\n' | wc -l`
85hosterline=`expr $hostercheck - 1`
86hoster=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | cut -d"." -f$hosterline`
87#echo $hoster
88
89ecostream()
90{
91        hosterurl=http://www.ecostream.tv
92        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`"
93        streampage=`$curlbin $hosterurl/js/ecoss.js | grep "$.post('" | grep videos | cut -d"'" -f2`
94        streamurl=$hosterurl`$curlbin -H "X-Requested-With: XMLHttpRequest" -X POST --data "$data" --referer $INPUT $hosterurl/$streampage | cut -d'"' -f6`
95        if [ "`echo $streamurl | grep DOCTYPE | wc -l`" -eq 0 ] && [ "$streamurl" != "$hosterurl" ];then
96                echo $streamurl
97        fi
98}
99
100giga()
101{
102        streampage=`$curlbin $INPUT | grep "<iframe src=" | cut -d'"' -f2 | head -n1`
103        streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 1080p`
104        if [ -z "$streamurl" ];then
105                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 720p`
106        fi
107        if [ -z "$streamurl" ];then
108                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 480p`
109        fi
110        if [ -z "$streamurl" ];then
111                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 360p`
112        fi
113        if [ -z "$streamurl" ];then
114                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 240p`
115        fi
116        if [ -z "$streamurl" ];then
117                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 180p`
118        fi
119        echo $streamurl
120}
121
122vidup()
123{
124        $BIN $CMD/vidup.py $INPUT
125}
126
127nosvideo()
128{
129        $BIN $CMD/nosvideo.py $INPUT
130}
131
132allmyvideos()
133{
134        $BIN $CMD/allmyvideos.py $INPUT
135}
136
137flashx()
138{
139        $BIN $CMD/flashx.py $INPUT
140}
141
142openload()
143{
144        $BIN $CMD/openload.py $INPUT
145}
146
147briskfile()
148{
149        $BIN $CMD/briskfile.py $INPUT
150}
151
152vodlockerold()
153{
154        $BIN $CMD/vodlocker.py $INPUT
155}
156
157videoweed()
158{
159        $BIN $CMD/videoweed.py $INPUT
160}
161
162vodzi()
163{
164        $BIN $CMD/vodzi.py $INPUT
165}
166
167youwatch()
168{
169        $BIN $CMD/youwatch.py $INPUT
170}
171
172thevideo()
173{
174        $BIN $CMD/thevideo.py $INPUT
175}
176
177movshare()
178{
179        $BIN $CMD/movshare.py $INPUT
180}
181
182streamcloud()
183{
184        $BIN $CMD/streamcloud.py $INPUT
185}
186
187vidzi()
188{
189        $BIN $CMD/vidzi.py $INPUT
190}
191
192vivo()
193{
194        $BIN $CMD/vivo.py $INPUT
195}
196
197vidto()
198{
199        $BIN $CMD/vidto.py $INPUT
200}
201
202goldesel()
203{
204        $BIN $CMD/goldesel.py $INPUT
205}
206
207cloudflare()
208{
209        $BIN $CMD/cloudflare.py $INPUT
210}
211
212nowvideo()
213{
214        $BIN $CMD/nowvideo.py $INPUT
215}
216
217divxstage()
218{
219        $BIN $CMD/divxstage.py $INPUT
220}
221
222novamov()
223{
224        $BIN $CMD/novamov.py $INPUT
225}
226
227xvidstage()
228{
229        $BIN $CMD/xvidstage.py $INPUT
230}
231
232waaw()
233{
234        $BIN $CMD/waaw.py $INPUT
235}
236
237streamango()
238{
239        $BIN $CMD/streamango.py $INPUT
240}
241
242vidlox()
243{
244        $BIN $CMD/vidlox.py $INPUT
245}
246
247vodlocker()
248{
249        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
250
251        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
252        if [ -e "$STREAMLIST" ];then
253                rm -f $STREAMLIST > /dev/null 2>&1
254        fi
255
256        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
257        cat $TMP/cache.hoster.$hoster.1 | sed 's/<source src=/\nfound=/g' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.1.url1
258        URL=`cat $TMP/cache.hoster.$hoster.1.url1`
259
260        if [ ! -z "$URL" ];then
261                echo "$URL" >> $STREAMLIST
262        fi
263
264        URL=$STREAMLIST
265
266        echo "$URL"
267}
268
269aliezold()
270{
271        URL=`$curlbin "$INPUT" | sed 's/source:/\nsource:/' | grep ^source: | cut -d"'" -f2`
272        REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'`
273        echo "$URL|Referer=$REFERER&User-Agent=$USERAGENT"
274}
275
276aliez()
277{
278        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
279        #http://emb.aliez.me/player/live.php?id=56180&w=700&h=480"
280        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
281        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
282
283        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
284        if [ -e "$STREAMLIST" ];then
285                rm -f $STREAMLIST > /dev/null 2>&1
286        fi
287
288        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
289        cat $TMP/cache.hoster.$hoster.1 | sed 's/source:/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.url1
290        URL=`cat $TMP/cache.hoster.$hoster.url1 | head -n1`
291        if [ ! -z "$URL" ];then
292                echo "$URL$EXTRA" >> $STREAMLIST
293        fi
294#       URL=""
295        #file:  'http://a3.aliez.me:8080/hls/streama57449/index.m3u8?st=dgw2dOq8tyFkLLBLn2ycXA',
296
297        cat $TMP/cache.hoster.$hoster.1 | sed 's/file:/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.url2
298        URL=`cat $TMP/cache.hoster.$hoster.url2 | head -n1`
299        if [ ! -z "$URL" ];then
300                echo "$URL$EXTRA" >> $STREAMLIST
301        fi
302#URL=""
303        #"file":                "rtmp%3A%2F%2Fa3.aliez.me%2Flive%2Fstreama57449%3Ftoken%3Dd11304fabb8e64327df8427e1c2fd5d9"
304        cat $TMP/cache.hoster.$hoster.1 | sed 's/"file":/\nfound=/' | grep ^found= | cut -d'"' -f2 >$TMP/cache.hoster.$hoster.url3
305        URL=`cat $TMP/cache.hoster.$hoster.url3 | head -n1`
306
307        if [ "`echo $URL | grep rtmp | wc -l`" -eq 1 ];then
308                #new swfobject.embedSWF("http://i.aliez.me/swf/playernew.swf?0", "mediaspace", "700", "480", "9.0.115.0", false, flashvars, params);
309                cat $TMP/cache.hoster.$hoster.1 | sed 's/swfobject.embedSWF/\nfound=/' | grep ^found= | cut -d'"' -f2 >$TMP/cache.hoster.$hoster.url3.rtmp.swfurl
310                SWFURL=`cat $TMP/cache.hoster.$hoster.url3.rtmp.swfurl | head -n1`
311                URL=`echo "$URL" | sed -e 's/%3A/:/g' -e 's!%2F!/!g' -e 's!%3D!=!g' -e 's!%3F!?!g'`
312                EXTRA=" pageUrl=$REFERER"
313                if [ ! -z "$SWFURL" ];then
314                        EXTRA="$EXTRA swfUrl=$SWFURL swfVfy=1 timeout=15 live=1"
315                fi
316                if [ ! -z "$URL" ];then
317                        echo "$URL$EXTRA" >> $STREAMLIST
318                fi
319        fi
320        URL=$STREAMLIST
321
322
323        echo "$URL"
324}
325
326sport7()
327{
328        #http://sport7.tech/487b826914d11080dce4b502052b012d-live.html
329        #var videoLink = 'http://g4.securestream.sport7.tech/stream/NzYyZDUwZWNkODc5YWM5YjViY2ZkOTVhZGNjOGM1ZTc=/BTSport3.m3u8';
330
331        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
332        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
333        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
334
335        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
336        if [ -e "$STREAMLIST" ];then
337                rm -f $STREAMLIST > /dev/null 2>&1
338        fi
339
340        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
341        cat $TMP/cache.hoster.$hoster.1 | sed 's/var videoLink/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.url1
342        URL=`cat $TMP/cache.hoster.$hoster.url1 | head -n1`
343        # enable httponly cookie
344        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
345
346        if [ ! -z "$URL" ];then
347                echo "$URL$EXTRA" > $STREAMLIST
348                #echo "$URL$EXTRA"
349                echo "$STREAMLIST"
350        fi
351       
352       
353#       URL=`$curlbin "$INPUT" | sed 's/var videoLink/\nfound=/' | grep ^found= | cut -d"'" -f2`
354#       REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'`
355#       sed 's/#HttpOnly_//g' -i /mnt/network/cookies
356#       echo "$URL|Referer=$REFERER&X-f=96.91.79.87&User-Agent=$USERAGENT"
357#       cat $STREAMLIST
358}
359
360sportstream365()
361{
362        #http://sport7.tech/487b826914d11080dce4b502052b012d-live.html
363        #var videoLink = 'http://g4.securestream.sport7.tech/stream/NzYyZDUwZWNkODc5YWM5YjViY2ZkOTVhZGNjOGM1ZTc=/BTSport3.m3u8';
364
365        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
366#       REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
367        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
368        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
369
370        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
371        if [ -e "$STREAMLIST" ];then
372                rm -f $STREAMLIST > /dev/null 2>&1
373        fi
374
375        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
376
377        #<input type="hidden" name="game" value="146875046">
378        id=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*name="game" value="([^"]+)".*/\1/p')
379        ts=$(date +%s)
380        URL="http://sportstream365.com/LiveFeed/GetGame?id=$id&partner=24"
381
382        $curlbin "$URL" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.2
383
384
385        #"VI":"1032572"
386        id=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*"VI" :"([^"]+)".*/\1/p')
387        if [ -z "$id" ];then
388                id=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*"VI":"([^"]+)".*/\1/p')
389        fi
390        #https://github.com/XvBMC/repository.xvbmc/blob/master/Dependencies/script.module.liveresolver/lib/liveresolver/resolvers/sportstream365.py
391        URL=http://93.189.57.254/edge0/xrecord/$id/prog_index.m3u8
392        # enable httponly cookie
393        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
394
395        if [ ! -z "$URL" ];then
396                echo "$URL$EXTRA" > $STREAMLIST
397                #echo "$URL$EXTRA"
398                echo "$STREAMLIST"
399        fi
400}
401
402sportsonline()
403{
404        #http://sportsonline.pw/livetv/pt-sporttv1.html
405        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
406        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
407        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
408
409        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
410        if [ -e "$STREAMLIST" ];then
411                rm -f $STREAMLIST > /dev/null 2>&1
412        fi
413
414        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
415
416        #<iframe src="http://widestream.io/embedClappr.php?live=13593" width="100%" height="100%" scrolling="no" frameborder="0" allowfullscreen="true"></iframe>
417        TMPURL=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*iframe src="([^"]+)".*/\1/p')
418
419        $curlbin "$TMPURL" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.2
420
421        #source: "http://ultra.widestream.io:8081/wideedge/1022qvk/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9MTIvOS8yMDE3IDEyOjMyOjQzIEFNJmhhc2hfdmFsdWU9ZW9WeThRL0JmaVA2dnFUQm15Ukkvdz09JnZhbGlkbWludXRlcz0yMA==",
422        TMPURL=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*source: "([^"]+)".*/\1/p')
423
424        if [ ! -z "$TMPURL" ];then
425                echo "$TMPURL$EXTRA" > $STREAMLIST
426                #echo "$URL$EXTRA"
427                echo "$STREAMLIST"
428        fi
429}
430
431assia()
432{
433        #http://assia.tv/live/gol-tv/?lang=ru
434        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
435        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
436        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
437
438        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
439        if [ -e "$STREAMLIST" ];then
440                rm -f $STREAMLIST > /dev/null 2>&1
441        fi
442
443        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
444
445        #this.videoplayer2600 = new Uppod({m:"video",uid:"videoplayer2600",comment:"",file:"http://video.assia.tv/hls/50.m3u8?md5=UD9zcmEXXgjdB92hTu9_nw&expires=1512784272",st:"uppodvideo",onReady: function(uppod){setTimeout(uppod.Pause, 60000);}});
446        TMPURL=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*file:"([^"]+)".*/\1/p' | tail -n1)
447
448        if [ ! -z "$TMPURL" ];then
449                echo "$TMPURL$EXTRA" > $STREAMLIST
450                #echo "$URL$EXTRA"
451                #http://video.assia.tv/hls/50.m3u8?md5=olw9K2ANtWtCPiL6LreprA&expires=1512783904|User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36
452
453                echo "$STREAMLIST"
454        fi
455}
456
457cricfree()
458{
459        #http://cricfree.sc/update/bt2.php
460        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
461        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
462        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
463
464        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
465        if [ -e "$STREAMLIST" ];then
466                rm -f $STREAMLIST > /dev/null 2>&1
467        fi
468
469        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
470
471        #<iframe frameborder="0" marginheight="0" allowfullscreen="true" marginwidth="0" height="555" src="http://cricfree.sc/update/bt1.php" id="iframe" name="iframe_a" scrolling="no" width="620">Your Browser Do not Support Iframe</iframe>
472        TMPURL1=$(cat $TMP/cache.hoster.$hoster.1 | grep "<iframe" | grep cricfree | sed -nr 's/.*src="([^"]+)".*/\1/p')
473
474#       $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
475        $curlbin "$TMPURL1" -o $TMP/cache.hoster.$hoster.2
476
477        #<script type='text/javascript'>id='bt2i'; width='620'; height='490';</script><script type='text/javascript' src='http://hi.notkodi.science/streamgame.js'></script>
478        TMPURL2=$(cat $TMP/cache.hoster.$hoster.2 | grep "id=" | sed -nr "s/.*src='([^']+)'.*/\1/p")
479        id=$(cat $TMP/cache.hoster.$hoster.2 | grep "id=" | sed -nr "s/.*id='([^']+)'.*/\1/p")
480
481        $curlbin "$TMPURL2" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.3
482
483        #document.write('<iframe allowfullscreen width="'+width+'" height="'+height+'" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" allowtransparency="true" src="http://veremos.date/all.php?id='+id+'&p='+p+'&c='+c+'&stretching='
484        TMPURL3=$(cat $TMP/cache.hoster.$hoster.3 | grep document.write | sed -nr 's/.*src="([^"]+)".*/\1/p')
485
486        #var stretching = 'uniform';
487        stretching=$(cat $TMP/cache.hoster.$hoster.3 | sed -nr "s/.*var stretching = '([^']+)'.*/\1/p")
488
489        #var c = '0';
490        c=$(cat $TMP/cache.hoster.$hoster.3 | sed -nr "s/.*var c = '([^']+)'.*/\1/p")
491
492        #var p = '0';
493        p=$(cat $TMP/cache.hoster.$hoster.3 | sed -nr "s/.*var p = '([^']+)'.*/\1/p")
494
495        #http://veremos.date/all.php?id=bt2i&p=0&c=0&stretching=uniform
496        TMPURL3=$(echo $TMPURL3 | sed -e "s/'+id+'/$id/" -e "s/'+p+'/$p/" -e "s/'+c+'/$c/" -e "s/'+stretching+'/$stretching/")
497
498        #$curlbin http://veremos.date/all.php?id=bt2i&p=0&c=0&stretching=uniform" --referer "http://cricfree.sc/update/bt2.php"
499        $curlbin "$TMPURL3" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.4
500
501        #<iframe allowfullscreen="" width="100%" height="100%" scrolling="no" frameborder="0" marginwidth="0" marginheight="0" allowtransparency="true" src="http://soretin.stream/embeds/1all.php?id=256512&st=vkWS1ifC7TSE10IQKmgUEQ&e=1512815257&amp;p=0&amp;c=0&amp;stretching="></iframe>
502        TMPURL4=$(cat $TMP/cache.hoster.$hoster.4 | grep "<iframe" | sed -nr 's/.*src="([^"]+)".*/\1/p')
503
504        #$curlbin "http://soretin.stream/embeds/1all.php?id=256512&st=jOQy59wu1omnfUnNywQLDA&e=1512812987&p=0&c=0&stretching=" --referer "http://veremos.date/all.php?id=bt2i&p=0&c=0&stretching=uniform"
505        $curlbin "$TMPURL4" --referer "$TMPURL3" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.5
506
507        #return(["h","t","t","p",":","\/","\/","8","0",".","8","2",".","6","5",".","1","6","2","\/","c","a","v","s","c","a","m","p","e","o","n","\/","2","5","6","5","1","2",".","m","3","u","8","?","w","m","s","A","u","t","h","S","i","g","n","2","=","N","W","E","x","N","T","Y","3","Y","W","Y","3","N","j","h","l","Z","g","=","=","&","t","o","k","e","n","="].join("") + yUAerrrlsnutgriaaSbea.join("") + document.getElementById("aieBskfcrugtntihSa").innerHTML);
508        TMPURL=$(cat $TMP/cache.hoster.$hoster.5 | grep 'return(\["' | sed -e 's/","//g' -e 's/\\//g'| cut -d'"' -f2)
509
510        #return(["h","t","t","p",":","\/","\/","8","0",".","8","2",".","6","5",".","1","6","2","\/","c","a","v","s","c","a","m","p","e","o","n","\/","2","5","6","5","1","2",".","m","3","u","8","?","w","m","s","A","u","t","h","S","i","g","n","2","=","N","W","E","x","N","T","Y","3","Y","W","Y","3","N","j","h","l","Z","g","=","=","&","t","o","k","e","n","="].join("") + uaagraneeblAStrsyrrUi.join("") + document.getElementById("rBkacSifaguntesith").innerHTML);
511        #uaagraneeblAStrsyrrUi
512        searchtoken1=$(cat $TMP/cache.hoster.$hoster.5 | grep 'return(\["'| sed -e 's/","//g' -e 's/\\//g' | awk '{ print $3 }' | cut -d"." -f1)
513        #var uaagraneeblAStrsyrrUi = ["3Rp","UJ5","ZoY","c2V","J","jgy","X3Z","9MT","XNo","ydm","ZEp","VyX","0OC","VlP","MDI","bWU","UxM","hbH"];
514        TOKEN1=$(cat $TMP/cache.hoster.$hoster.5 | grep "var $searchtoken1" | sed -e 's/","//g' -e 's/\\//g' | cut -d'"' -f2)
515
516        #return(["h","t","t","p",":","\/","\/","8","0",".","8","2",".","6","5",".","1","6","2","\/","c","a","v","s","c","a","m","p","e","o","n","\/","2","5","6","5","1","2",".","m","3","u","8","?","w","m","s","A","u","t","h","S","i","g","n","2","=","N","W","E","x","N","T","Y","3","Y","W","Y","3","N","j","h","l","Z","g","=","=","&","t","o","k","e","n","="].join("") + uaagraneeblAStrsyrrUi.join("") + document.getElementById("rBkacSifaguntesith").innerHTML);
517        #rBkacSifaguntesith
518        searchtoken2=$(cat $TMP/cache.hoster.$hoster.5 | sed -nr 's/.*document.getElementById\("([^"]+)".*/\1/p')
519        #<span style='display:none' id=uieBiSefkngtshatrc>VZbFOMVlSL3F2lZhaE01Ta9xAWMvwQGwPZnMRY9nZ2ppVXWG</span><span style='display:none' id=suteaentirhgBfkSci>bnMWZL3XFlvAhMVpwPZ0pZ9TFSWnVGwaVMGR9Q22aOYZlEx1</span><span style='display:none' id=tSiBkaefnshuticegr>LWVMAbFZ1VaPhO3MnpF2R29ZlvSEGalwTYp9VMZQX0xZnWwG</span><span style='display:none' id=iecaSftBresutghkin>vVxZVQpVMn0ZS1Pp22nO3hwa9ZFTYRaWGFlMl9wZGEbAXLWM</span><span style='display:none' id=SnstuicrBgfitehake>Th2F1QFSWAZ9MWlPv92Vpw0LOZGwRMXbaV3ZElnMnaYpZVxG</span><span style='display:none' id=stBeiuSheiakfcrngt>bYTxap13WP2ZLlhnMF2GVXlwvWVOASaMEnQw9RVZ90GMZpZF</span><span style='display:none' id=ihenkcraesSiugBftt>wL2xZv9nMXwnZGGaAVVWWQFlZS90EMp3TlaVFP2ORbZpY1Mh</span><span style='display:none' id=hftrceSekuiiastngB>1ZXap0LlnO3VlGGZabWRnFZMMEw2xMvhZwpPVFY9VAWT92SQ</span><span style='display:none' id=inBehfgtcSautirkse>x2a2Zp3OF09XLWQZVbMMwFZnGGRpYnvPha19VEMlATVZWlwS</span><span style='display:none' id=rBkacSifaguntesith>MGZVL2wvanFha3ROWlVFQlE9PSZ2YWxpZG1pbnV0ZXM9MTAw</span><span style='display:none' id=etBirkuaiStfehgcsn>ZA1ZQGZOa39nYpVnWpS2llLwFxvawFVZb0MMPREGhXM2TVW9</span><span style='display:none' id=rshfekaguceSitnBit>pRW2TQMZaVlZ29OWFnXaFMLnV1VxZ3Y0ZGpAb9hPMSwvGEwl</span><span style='display:none' id=irBcttfehsganeSiuk>MTpXZWZb3MvnFZ2wlLFGA9nQpa2SYR9E01VxZGhwWMVOVPla</span><span style='display:none' id=skieftSBngitcuarhe>xAG1QET0WG9lnhZFPpYOa2M9lRZXnaFwVSpWLMbwVZ3MVZv2</span><span style='display:none' id=iSnkrBusfceghttiea>32EbYXWFl1Z2VZMVSGv9pZPMZLaFnaTpAh9OxGlQWMwRVw0n</span><span style='display:none' id=utrtiSfieeasBhnkcg>wZGZWxF2bPpahW9EnMV1TvYw92XlVaMpSLGMQl3OVRnA0FZZ</span><span style='display:none' id=SiisktnfeaghceuBrt>29W1LbRnVlMTZwF2WMEpw9AvGVZ0VYSnZXP3OMhxGZlQpFaa</span><span style='display:none' id=scugBteriiSehafktn>lFTMVV9W3ZhZaA1FMn9YpEvVnaxQL2XSZMpGWbwO2R0lZwPG</span><span style='display:none' id=itefaihSreuBgkcnts>Y0Eb2hQannvFZV2ZGZAaLVZlSMGlFp3V9xXPwMMTR9wO1WWp</span><span style='display:none' id=aecnhiigtuekfSrsBt>naYZSMMPbQnvE9hTVW3Ga2pwZ0GMRZwXpWFZ2llLAxOVVF19</span><span style='display:none' id=citeehgiustarnBSkf>XG29ZphlbYMLSaZ9V3PwWlQpGM12a0ZZvEFwVxWAFOMVnnRT</span><span style='display:none' id=rtcenehgusaikBSfit>3hpv2ZnVXV9lWlYxV0M9wMWPSMAnGa2ZQFROpab1ZwZETGLF</span><span style='display:none' id=csSnhfBitteguakeir>ZnXhv2GpMZP0xaAMQ1YVV9lZROWwaFnWT3M9ZlwF2pEVGLbS</span><span style='display:none' id=stigfkinrehBSaceut>p2wl0RQG3OFZhFMnaTxXV9pvZA2LMbVESWlZaVP1YZwMnG9W</span><html>
520        #MGZVL2wvanFha3ROWlVFQlE9PSZ2YWxpZG1pbnV0ZXM9MTAw
521        TOKEN2=$(cat $TMP/cache.hoster.$hoster.5 | sed "s/id=$searchtoken2/\nfoundid=/" | grep ^"foundid=" | cut -d'>' -f2 | cut -d'<' -f1)
522
523        if [ ! -z "$TMPURL" ];then
524#               echo "$TMPURL$token1$token2$EXTRA" > $STREAMLIST
525                #http://89.248.172.95/cavscampeon/256512.m3u8?wmsAuthSign2=NWExNTY3YWY3NjhlZg==&token=c2VydmVyX3RpbWU9MTUxMjgxMjM4NyZoYXNoX3ZhbHVlPVNrcndRU0Z2Mlp2QlUvbjg4N0lLQWc9PSZ2YWxpZG1pbnV0ZXM9MTAw|Referer=http%3A%2F%2Fsoretin.stream%2Fembeds%2F1all.php%3Fid%3D256512%26st%3DjOQy59wu1omnfUnNywQLDA%26e%3D1512812987%26p%3D0%26c%3D0%26stretching%3D&User-Agent=Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36&X-Requested-With=ShockwaveFlash/23.0.0.162
526
527                echo "$TMPURL$TOKEN1$TOKEN2" > $STREAMLIST
528
529                #echo "$URL$EXTRA"
530                echo "$STREAMLIST"
531        fi
532}
533
534broadcast()
535{
536        #http://assia.tv/live/gol-tv/?lang=ru
537        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
538        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
539        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
540
541        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
542        if [ -e "$STREAMLIST" ];then
543                rm -f $STREAMLIST > /dev/null 2>&1
544        fi
545
546        #$curlbin --referer "http://bro.adca.st/stream.php?id=17733&p=1&c=0&stretching=uniform&old=0" "http://bro.adca.st/token2.php"
547        $curlbin "http://bro.adca.st/token2.php" --referer "$INPUT" -o $TMP/cache.hoster.$hoster.1
548
549        #{"rumba":"ruYg748QTLGfAn2iZo3bpw&expires=1512880893"}
550        TOKEN=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*"rumba":"([^"]+)".*/\1/p' | tail -n1)
551
552        #$curlbin --referer "http://bonstreams.net" "http://bro.adca.st/stream.php?id=17733&p=1&c=0&stretching=uniform&old=0"
553        $curlbin "$INPUT" --referer "http://bonstreams.net" -o $TMP/cache.hoster.$hoster.2
554
555    #trap = "aHR0cDovL3RpZXIyLnBva2VyY29hbGl0aW9uLnB3L28xMC8xNzczMy5tM3U4P3NmPU5UazVOR0UzWXpSaE16bGpOUT09JnRva2VuPQ=
556        TRAP=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*trap = "([^"]+)".*/\1/p' | tail -n1)
557
558        echo "$TRAP" > $TMP/cache.hoster.$hoster.base64
559        TMPURL=$(base64 -d $TMP/cache.hoster.$hoster.base64)
560
561        # enable httponly cookie
562        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
563
564        if [ ! -z "$TMPURL" ];then
565                #hls://http://tier2.pokercoalition.pw/o10/17733.m3u8?sf=NTk5NGE3YzRhMzljNQ==&token=jvVfe9gic8uQ3QqCXmZemw&expires=1512879969|Referer=http%3A%2F%2Fbro.adca.st%2Fstream.php%3Fid%3D17733%26p%3D1%26c%3D0%26stretching%3Duniform%26old%3D0&User-Agent=Mozilla%2F5.0%20(Windows%20NT%2010.0%3B%20Win64%3B%20x64)%20AppleWebKit%2F537.36%20(KHTML,%20like%20Gecko)%20Chrome%2F61.0.3163.100%20Safari%2F537.36
566                echo "$TMPURL$TOKEN$EXTRA" > $STREAMLIST
567                echo "$STREAMLIST"
568        fi
569}
570
571all()
572{
573        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
574        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
575        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
576
577        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
578        if [ -e "$STREAMLIST" ];then
579                rm -f $STREAMLIST > /dev/null 2>&1
580        fi
581
582        rm $TMP/cache.$PARSER.$INPUT.$FROM.1 > /dev/null 2>&1
583
584        $curlbin -o $TMP/cache.$PARSER.$INPUT.$FROM.1 ${1}
585        URL=`zcat $TMP/cache.$PARSER.$INPUT.$FROM.1 | grep iframe | sed -nr 's/.*src="([^"]+)".*/\1/p'`
586        if [ -z "$URL" ];then
587                URL=`cat $TMP/cache.$PARSER.$INPUT.$FROM.1 | grep iframe | sed -nr 's/.*src="([^"]+)".*/\1/p'`
588        fi
589        if [ -z "$URL" ];then
590                URL=`cat $TMP/cache.$PARSER.$INPUT.$FROM.1 | grep "text/javascript" | grep -v jQuery | sed -nr 's/.*src="([^"]+)".*/\1/p'`
591        fi
592
593#       echo $URL
594        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.2
595}
596
597
598directstream()
599{
600        echo "$INPUT"
601#       rm -f /tmp/_last_hoster_* > /dev/null 2>&1
602        echo  "$INPUT" > /tmp/.last_hoster_$hoster.log
603}
604
605youtube_dl()
606{
607#       echo "$BIN $youtubebin $INPUT" > /tmp/.last_hoster_youtube_dl.log
608#       $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
609#       cat /tmp/youtube_dl.streamlink.log | tail -n1
610        mkdir $TMP > /dev/null 2>&1
611
612        echo "$BIN $youtubebin $INPUT --username $USER --password $PASS" > /tmp/.last_hoster_youtube_dl.log
613
614        $BIN $youtubebin "$INPUT" --username "$USER" --password "$PASS" > $TMP/$TYPE.$hoster.$FILENAME.streamlist
615        cat $TMP/$TYPE.$hoster.$FILENAME.streamlist
616}
617
618youtube_dlbg()
619{
620#       echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_youtube_dlbg.log
621#       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"`
622#       echo "$URL" >> /tmp/.last_hoster_youtube_dlbg.log
623#       echo $URL
624        mkdir $TMP > /dev/null 2>&1
625
626        echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_$TYPE.log
627        $BIN $youtubebinbg "$DEST" "$INPUT" >> /tmp/.last_hoster_$TYPE.log
628#       echo $TMP/$TYPE.$hoster.$FILENAME.streamlist
629}
630
631hlsdl()
632{
633        mkdir $TMP > /dev/null 2>&1
634
635        echo "$HLSBIN $hlsdlbg $DEST $INPUT" > /tmp/.last_hoster_$TYPE.log
636
637        REFERER=$(echo "$INPUT" | sed -nr 's/.*Referer=([^=]+)&.*/\1/p')
638        if [ -z "$REFERER" ];then
639                REFERER=$(echo "$INPUT" | sed -nr 's/.*Referer=([^=]+).*/\1/p')
640        fi
641
642        if [ ! -z "$REFERER" ];then
643                REFERER="Referer: $REFERER"
644        fi
645
646        TMPUSERAGENT=$(echo "$INPUT" | sed -nr 's/.*User-Agent=([^=]+)&.*/\1/p')
647        if [ -z "$TMPUSERAGENT" ];then
648                TMPUSERAGENT=$(echo "$INPUT" | sed -nr 's/.*User-Agent=([^=]+).*/\1/p')
649        fi
650        if [ ! -z "$TMPUSERAGENT" ];then
651                USERAGENT=$TMPUSERAGENT
652        fi
653
654        URL=$(echo "$INPUT" | tr '|' '\n' | head -n1)
655
656        echo $HLSBIN "$URL" -v -f -u "$USERAGENT" -h "$REFERER" -o "$DEST" >> /tmp/.last_hoster_$TYPE.log
657        $HLSBIN "$URL" -v -f -u "$USERAGENT" -h "$REFERER" -o "$DEST" >> /tmp/.last_hoster_$TYPE.log
658#       $HLSBIN "$URL" -v -u "$USERA" -h "$REFERER" -o "$DEST" >> /tmp/.last_hoster_$TYPE.log
659
660}
661
662
663if [ "$TYPE" == "get" ];then
664        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
665        case $hoster in
666                ecostream) ecostream $INPUT;;
667                giga) giga $INPUT;;
668                nosvideo) nosvideo $INPUT;;
669                allmyvideos) allmyvideos $INPUT;;
670                flashx) flashx $INPUT;;
671                openload|oload) openload $INPUT;;
672                briskfile) briskfile $INPUT;;
673                videoweed|bitvid) videoweed $INPUT;;
674                vodlocker) vodlocker $INPUT;;
675                youwatch|chouhaa|ay8ou8ohth) youwatch $INPUT;;
676                thevideo) thevideo $INPUT;;
677                movshare|wholecloud|vidgg) movshare $INPUT;;
678                vidto) vidto $INPUT;;
679                vidup) vidup $INPUT;;
680                vidzi) vidzi $INPUT;;
681                vivo) vivo $INPUT;;
682                goldesel|movie4k) cloudflare $INPUT;;
683                streamcloud1) streamcloud $INPUT;;     
684                nowvideo) nowvideo $INPUT;;
685                divxstage|cloudtime) divxstage $INPUT;;
686                novamov|auroravid) novamov $INPUT;;
687                xvidstage) xvidstage $INPUT;;
688                waaw|netu|hqq) waaw $INPUT;;
689                streamango|streamcherry) streamango $INPUT;;
690                vidlox) vidlox $INPUT;;
691                redirector|googlevideo|vodcloud|google) directstream "$INPUT";;
692                aliez) aliez $INPUT;;
693                sport7) sport7 $INPUT;;
694                sportstream365) sportstream365 $INPUT;;
695                sportsonline) sportsonline $INPUT;;
696                assia) assia $INPUT;;
697                cricfree) cricfree $INPUT;;
698                adca) broadcast $INPUT;;
699#               *) all $INPUT;;
700        esac
701fi
702
703if [ "$TYPE" == "youtube_dl" ];then
704        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
705        case $hoster in
706                *) youtube_dl $INPUT $USER $PASS;;
707        esac
708fi
709
710if [ "$TYPE" == "youtube_dlbg" ];then
711        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
712        case $hoster in
713                *) youtube_dlbg $DEST $INPUT;;
714        esac
715fi
716
717if [ "$TYPE" == "hlsdl" ];then
718        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
719        case $hoster in
720                *) hlsdl $INPUT;;
721        esac
722fi
Note: See TracBrowser for help on using the repository browser.