source: titan/mediathek/localhoster/hoster.sh

Last change on this file was 44905, checked in by obi, 5 weeks ago

fix sportspndemand

  • Property svn:executable set to *
File size: 38.3 KB
Line 
1#!/bin/bash
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 's/User-Agent.*//' | sed -e 's/|//g' | 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
20ARCH=`cat /etc/.arch`
21BOX=`cat /etc/model`
22TMP=/tmp/localcache
23CMD=/tmp/localhoster
24BIN="$CMD"/bin/python."$ARCH"
25HLSBIN="$CMD"/bin/hlsdl."$ARCH"
26CURLBIN="$CMD"/bin/curl."$ARCH"
27DUKBIN="$CMD"/bin/duk."$ARCH"
28if [ "$ARCH" == "i386" ]; then
29BIN=/usr/bin/python
30HLSBIN=/usr/bin/hlsdl
31CURLBIN=/usr/bin/curl
32DUKBIN=/usr/bin/duk
33fi
34
35if [ ! -e "$CURLBIN" ];then CURLBIN=curl; fi
36#USERAGENT='Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0'
37AUTH='aUtzhFRTzuDFa:JNHZbghnjuz'
38USERAGENT='Mozilla%2F5.0+%28Windows+NT+6.3%3B+rv%3A36.0%29+Gecko%2F20100101+Firefox%2F36.0'
39debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
40curlbin="$CURLBIN -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A $USERAGENT -u $AUTH"
41curlbin2="$CURLBIN -k -s --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A $USERAGENT -u $AUTH"
42youtubebin="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent $USERAGENT --format mp4 --restrict-filenames --ignore-errors -g"
43youtubebinbg="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent $USERAGENT --format mp4 --restrict-filenames --ignore-errors --output"
44hlsdlbg="$HLSBIN -u $USERAGENT -o"
45
46if [ -e /mnt/network/cookies ];then sed 's/#HttpOnly_//g' -i /mnt/network/cookies; fi
47
48export PYTHONHOME=/tmp/localhoster
49export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/localhoster/lib
50
51
52if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
53if [ "$debuglevel" == "99" ]; then curlbin2="$curlbin2 -v"; fi
54if [ "$debuglevel" == "99" ]; then youtubebin="$youtubebin --verbose"; fi
55
56wgetbin="wget -q -T2"
57
58if [ "$ARCH" == "i386" ]; then
59        if [ -d "/tmp/localhoster/lib/python2.7" ];then
60                mv -f /tmp/localhoster/lib/python2.7 /tmp/localhoster/lib/python2.7_old
61        fi
62        ln -fs /usr/lib/python2.7 /tmp/localhoster/lib/python2.7
63fi
64
65if [ ! -e "/tmp/localhoster/lib/python2.7/lib-dynload" ] && [ -e /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" ];then
66#       ln -fs /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload
67        time mv -f /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload
68        time rm -rf /tmp/localhoster/lib/python2.7/lib-dynload.*
69fi
70if [ ! -e "/tmp/localhoster/lib/libpython2.7.so.1.0" ] && [ -e /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" ];then
71#       ln -fs /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0
72        time mv -f /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0
73        time rm -f /tmp/localhoster/lib/libpython2.7.so.1.0.*
74fi
75if [ ! -e "/tmp/localhoster/lib/libcrypto.so.1.0.0" ] && [ -e /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" ];then
76#       ln -fs /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" /tmp/localhoster/lib/libcrypto.so.1.0.0
77        time mv -f /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" /tmp/localhoster/lib/libcrypto.so.1.0.0
78        time rm -f /tmp/localhoster/lib/libcrypto.so.1.0.0.*
79fi
80if [ ! -e "/tmp/localhoster/lib/libssl.so.1.0.0" ] && [ -e /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" ];then
81#       ln -fs /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" /tmp/localhoster/lib/llibssl.so.1.0.0
82        time mv -f /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" /tmp/localhoster/lib/libssl.so.1.0.0
83        time rm -f /tmp/localhoster/lib/libssl.so.1.0.0.*
84fi
85
86if [ -e "$TMP/hoster.tar" ]; then time rm -f $TMP/hoster.tar; fi
87if [ -e "$TMP/parser.tar" ]; then time rm -f $TMP/parser.tar; fi
88
89if [ "$ARCH" == "sh4" ];then #&& [ "$BOX" != "ufs912" ]; then
90        if [ -e "$CMD/lib/python2.7/lib-dynload.mipsel" ]; then time rm -rf $CMD/lib/python2.7/lib-dynload.mipsel; fi
91        if [ -e "$CMD/lib/python2.7/lib-dynload.arm" ]; then time rm -rf $CMD/lib/python2.7/lib-dynload.arm; fi
92
93        if [ -e "$CMD/lib/libpython2.7.so.1.0.mipsel" ]; then time rm -rf $CMD/lib/libpython2.7.so.1.0.mipsel; fi
94        if [ -e "$CMD/lib/libpython2.7.so.1.0.arm" ]; then time rm -rf $CMD/lib/libpython2.7.so.1.0.arm; fi
95
96        if [ -e "$CMD/lib/libssl.so.1.0.0.mipsel" ]; then time rm -rf $CMD/lib/libssl.so.1.0.0.mipsel; fi
97        if [ -e "$CMD/lib/libssl.so.1.0.0.arm" ]; then time rm -rf $CMD/lib/libssl.so.1.0.0.arm; fi
98
99        if [ -e "$CMD/lib/libcrypto.so.1.0.0.mipsel" ]; then time rm -rf $CMD/lib/libcrypto.so.1.0.0.mipsel; fi
100        if [ -e "$CMD/lib/libcrypto.so.1.0.0.arm" ]; then time rm -rf $CMD/lib/libcrypto.so.1.0.0.arm; fi
101fi
102
103hostercheck=`echo "$INPUT" | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d"/" -f1 | tail -n1 | tr '.' '\n' | wc -l`
104hosterline=`expr $hostercheck - 1`
105if [ "$hosterline" == "0" ];then hosterline=1; fi
106hoster=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d"/" -f1 | tail -n1 | cut -d"." -f$hosterline`
107
108ecostream()
109{
110        hosterurl=http://www.ecostream.tv
111        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`"
112        streampage=`$curlbin $hosterurl/js/ecoss.js | grep "$.post('" | grep videos | cut -d"'" -f2`
113        streamurl=$hosterurl`$curlbin -H "X-Requested-With: XMLHttpRequest" -X POST --data "$data" --referer $INPUT $hosterurl/$streampage | cut -d'"' -f6`
114        if [ "`echo $streamurl | grep DOCTYPE | wc -l`" -eq 0 ] && [ "$streamurl" != "$hosterurl" ];then
115                echo $streamurl
116        fi
117}
118
119giga()
120{
121        streampage=`$curlbin $INPUT | grep "<iframe src=" | cut -d'"' -f2 | head -n1`
122        streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 1080p`
123        if [ -z "$streamurl" ];then
124                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 720p`
125        fi
126        if [ -z "$streamurl" ];then
127                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 480p`
128        fi
129        if [ -z "$streamurl" ];then
130                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 360p`
131        fi
132        if [ -z "$streamurl" ];then
133                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 240p`
134        fi
135        if [ -z "$streamurl" ];then
136                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 180p`
137        fi
138        echo $streamurl
139}
140
141vidup()
142{
143        $BIN $CMD/vidup.py $INPUT
144}
145
146nosvideo()
147{
148        $BIN $CMD/nosvideo.py $INPUT
149}
150
151allmyvideos()
152{
153        $BIN $CMD/allmyvideos.py $INPUT
154}
155
156flashx()
157{
158#       $BIN $CMD/flashx.py $INPUT
159#exit
160        $BIN $CMD/flashx.py $INPUT > $TMP/cache.$FILENAME.2
161        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
162        cat $TMP/cache.$FILENAME.2  > $STREAMLIST
163#       cat $TMP/cache.$FILENAME.2 | grep "video/mp4" | sed -nr "s/.*src:\\\'([^']+)\\\'.*/\1/p" > $STREAMLIST
164        echo $STREAMLIST
165}
166
167vshare()
168{
169#       $BIN $CMD/flashx.py $INPUT
170#exit
171        $BIN $CMD/vshare.py $INPUT > $TMP/cache.$FILENAME.2
172        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
173        cat $TMP/cache.$FILENAME.2  > $STREAMLIST
174#       cat $TMP/cache.$FILENAME.2 | grep "video/mp4" | sed -nr "s/.*src:\\\'([^']+)\\\'.*/\1/p" > $STREAMLIST
175        echo $STREAMLIST
176}
177
178openload()
179{
180        $BIN $CMD/openload.py $INPUT
181}
182
183briskfile()
184{
185        $BIN $CMD/briskfile.py $INPUT
186}
187
188vodlockerold()
189{
190        $BIN $CMD/vodlocker.py $INPUT
191}
192
193videoweed()
194{
195        $BIN $CMD/videoweed.py $INPUT
196}
197
198vodzi()
199{
200        $BIN $CMD/vodzi.py $INPUT
201}
202
203youwatch()
204{
205        $BIN $CMD/youwatch.py $INPUT
206}
207
208thevideo()
209{
210        $BIN $CMD/thevideo.py $INPUT > $TMP/cache.$FILENAME.1
211# new #
212        videocode=`cat $TMP/cache.$FILENAME.1`
213
214        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
215        echo "https://thevideos.ga/$videocode" > $STREAMLIST
216        #start dummy page not found then works playback without input/outout error
217        curl "https://thevideos.ga/$videocode" > /dev/null 2>&1
218        echo $STREAMLIST
219#######
220exit
221#       $curlbin --referer $INPUT $INPUT -o $TMP/cache.$FILENAME.1
222       
223        videocode=`cat $TMP/cache.$FILENAME.1`
224        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
225
226        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
227        if [ -e "$STREAMLIST" ];then
228                rm -f $STREAMLIST > /dev/null 2>&1
229        fi
230
231        $curlbin --data '{}' https://vev.io/api/serve/video/$videocode -o $TMP/cache.$FILENAME.2
232        cat $TMP/cache.$FILENAME.2 | sed 's/{/\n/g' | sed 's/,/\n/g' | grep "/stream/" >$TMP/cache.$FILENAME.3
233
234        #{"code":400,"message":"invalid video specified","errors":[]}
235        if [ `cat $TMP/cache.$FILENAME.2 | grep '"code":400,' | wc -l` -eq 1 ];then
236                ERROR=`cat $TMP/cache.$FILENAME.2 | sed -nr 's/.*"message":"([^"]+)".*/\1/p'`
237                echo "errormsg=$ERROR"
238        else
239                while read -u 3 ROUND; do
240                        TITEL=`echo $ROUND | cut -d'"' -f2`
241                        URL=`echo $ROUND | cut -d'"' -f4`
242
243                        if [ ! -z "$URL" ];then
244                                echo "$URL" | tr -d '\n' | tr -d '\r' >> $STREAMLIST
245                                echo "" >> $STREAMLIST
246                        fi
247
248
249                done 3<$TMP/cache.$FILENAME.3
250                rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
251                echo $STREAMLIST
252        fi
253}
254
255movshare()
256{
257        $BIN $CMD/movshare.py $INPUT
258}
259
260streamcloud()
261{
262        $BIN $CMD/streamcloud.py $INPUT
263}
264
265vidzi()
266{
267        $BIN $CMD/vidzi.py $INPUT
268}
269
270vivo()
271{
272        $BIN $CMD/vivo.py $INPUT
273}
274
275vidto()
276{
277        $BIN $CMD/vidto.py $INPUT
278}
279
280goldesel()
281{
282        $BIN $CMD/goldesel.py $INPUT
283}
284
285cloudflare()
286{
287        mkdir $TMP > /dev/null 2>&1
288        rm -f $TMP/cache.hoster.$hoster.1 > /dev/null 2>&1
289        $BIN $CMD/cloudflare.py $INPUT > $TMP/cache.hoster.$hoster.1 2>&1
290        if [ `cat $TMP/cache.hoster.$hoster.1 | grep "urllib2.HTTPError" | wc -l` -eq 1 ];then
291                ERROR=`cat $TMP/cache.hoster.$hoster.1 | grep urllib2.HTTPError:`
292                echo "errormsg=$ERROR"
293        else
294                cat $TMP/cache.hoster.$hoster.1
295        fi
296}
297
298kinox()
299{
300        mkdir $TMP > /dev/null 2>&1
301        rm -f $TMP/cache.hoster.$hoster.1 > /dev/null 2>&1
302
303        if [ "$TYPE" == "get" ];then
304                $BIN $CMD/cloudflare.py $INPUT > $TMP/cache.hoster.$hoster.1 2>&1
305                if [ `cat $TMP/cache.hoster.$hoster.1 | grep "urllib2.HTTPError" | wc -l` -eq 1 ];then
306                        ERROR=`echo $INPUT | grep urllib2.HTTPError:`
307                        echo "errormsg=$ERROR"
308                else
309                        cat $TMP/cache.hoster.$hoster.1
310                fi
311        elif [ "$TYPE" == "hoster" ];then
312
313                if [ `echo $INPUT | grep "/aGET/" | wc -l` -eq 1 ];then
314                        URL=`$BIN $CMD/cloudflare.py $INPUT | tr -d '\\' | sed -nr 's/.*<iframe src="([^"]+)".*/\1/p'`
315                        if [ -z "$URL" ];then
316                                URL=`$BIN $CMD/cloudflare.py $INPUT | tr -d '\\' | sed -nr 's/.*<a href="([^"]+)".*/\1/p'`
317                        fi
318                        if [ `echo $URL | grep "urllib2.HTTPError" | wc -l` -eq 1 ];then
319                                ERROR=`echo $INPUT | grep urllib2.HTTPError:`
320                                echo "errormsg=$ERROR"
321                        else
322                                if [ `echo $URL | grep ^"//" | wc -l` -eq 1 ];then
323                                        echo "http:$URL"
324                                else
325                                        echo "$URL"
326                                fi
327                        fi
328                else
329                        $BIN $CMD/cloudflare.py $INPUT         
330                fi     
331        fi
332}
333
334nowvideo()
335{
336        $BIN $CMD/nowvideo.py $INPUT
337}
338
339divxstage()
340{
341        $BIN $CMD/divxstage.py $INPUT
342}
343
344novamov()
345{
346        $BIN $CMD/novamov.py $INPUT
347}
348
349xvidstage()
350{
351        $BIN $CMD/xvidstage.py $INPUT
352}
353
354waaw()
355{
356        $BIN $CMD/waaw.py $INPUT
357}
358
359streamango()
360{
361        $BIN $CMD/streamango.py $INPUT
362}
363
364vidlox()
365{
366        $BIN $CMD/vidlox.py $INPUT
367}
368
369vidcloud()
370{
371        $BIN $CMD/vidcloud.py $INPUT
372}
373
374streamz()
375{
376        $BIN $CMD/streamz.py $INPUT
377}
378
379mixdrop()
380{
381        $BIN $CMD/mixdrop.py $INPUT
382}
383
384
385streamcrypt()
386{
387        hoster=$(echo $INPUT | sed -nr 's/.*:\/\/.*\/([^\/]+)\/.*/\1/p')
388        hostercheck=$(echo $hoster | tr '.' '\n' | wc -l)
389        hosterline=$(expr $hostercheck - 1)
390        if [ "$hosterline" == "0" ];then hosterline=1; fi
391        echo $hoster | tr 'A-Z' 'a-z' | cut -d"." -f$hosterline
392        #INPUT=$(echo $INPUT | sed "s!streamcrypt.net/!!")
393}
394
395
396vodlocker()
397{
398        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
399
400        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
401        if [ -e "$STREAMLIST" ];then
402                rm -f $STREAMLIST > /dev/null 2>&1
403        fi
404
405        PAGE=`echo $INPUT | cut -d"|" -f1`
406        REFERER=`echo $INPUT | cut -d"|" -f2`
407
408        $curlbin "$PAGE" -o $TMP/cache.$FILENAME.1
409        cat $TMP/cache.$FILENAME.1 | sed 's/<source src/\n<source src/g' | sed -nr "s/.*src='([^']+)'.*/\1/p" | grep getfile >$TMP/cache.$FILENAME.2
410
411        while read -u 3 ROUND; do
412                NEWPAGE="$ROUND"
413
414                $curlbin2 -v "$NEWPAGE" --dump-header $TMP/cache.hoster.$hoster.1
415                cat $TMP/cache.hoster.$hoster.1 | grep ^Location: | cut -d" " -f2 >$TMP/cache.hoster.$hoster.1.url1
416                URL=`cat $TMP/cache.hoster.$hoster.1.url1`"|$REFERER"
417
418                CURTIME=`date +%s`
419                if [ `cat /mnt/network/cookies | grep .movie4k.ag | grep approve | wc -l` -eq 0 ];then
420                        echo ".movie4k.ag     TRUE    /       FALSE   $CURTIME      approve         1" >> /mnt/network/cookies
421                fi
422
423                if [ ! -z "$URL" ];then
424                        echo "$URL" | tr -d '\n' | tr -d '\r' >> $STREAMLIST
425                        echo "" >> $STREAMLIST
426
427                        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
428                        sed 's/.movie2k.ag/.movie4k.ag/g' -i /mnt/network/cookies
429                fi
430
431
432        done 3<$TMP/cache.$FILENAME.2
433        rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
434
435        URL=$STREAMLIST
436
437        echo "$URL"
438}
439
440aliezold()
441{
442        URL=`$curlbin "$INPUT" | sed 's/source:/\nsource:/' | grep ^source: | cut -d"'" -f2`
443        REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'`
444        echo "$URL|Referer=$REFERER&User-Agent=$USERAGENT"
445}
446
447aliez()
448{
449        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
450        #http://emb.aliez.me/player/live.php?id=56180&w=700&h=480"
451        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
452        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
453
454        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
455        if [ -e "$STREAMLIST" ];then
456                rm -f $STREAMLIST > /dev/null 2>&1
457        fi
458
459        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
460        cat $TMP/cache.hoster.$hoster.1 | sed 's/source:/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.url1
461        URL=`cat $TMP/cache.hoster.$hoster.url1 | head -n1`
462        if [ ! -z "$URL" ];then
463                echo "$URL$EXTRA" >> $STREAMLIST
464        fi
465#       URL=""
466        #file:  'http://a3.aliez.me:8080/hls/streama57449/index.m3u8?st=dgw2dOq8tyFkLLBLn2ycXA',
467
468        cat $TMP/cache.hoster.$hoster.1 | sed 's/file:/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.url2
469        URL=`cat $TMP/cache.hoster.$hoster.url2 | head -n1`
470        if [ ! -z "$URL" ];then
471                echo "$URL$EXTRA" >> $STREAMLIST
472        fi
473#URL=""
474        #"file":                "rtmp%3A%2F%2Fa3.aliez.me%2Flive%2Fstreama57449%3Ftoken%3Dd11304fabb8e64327df8427e1c2fd5d9"
475        cat $TMP/cache.hoster.$hoster.1 | sed 's/"file":/\nfound=/' | grep ^found= | cut -d'"' -f2 >$TMP/cache.hoster.$hoster.url3
476        URL=`cat $TMP/cache.hoster.$hoster.url3 | head -n1`
477
478        if [ "`echo $URL | grep rtmp | wc -l`" -eq 1 ];then
479                #new swfobject.embedSWF("http://i.aliez.me/swf/playernew.swf?0", "mediaspace", "700", "480", "9.0.115.0", false, flashvars, params);
480                cat $TMP/cache.hoster.$hoster.1 | sed 's/swfobject.embedSWF/\nfound=/' | grep ^found= | cut -d'"' -f2 >$TMP/cache.hoster.$hoster.url3.rtmp.swfurl
481                SWFURL=`cat $TMP/cache.hoster.$hoster.url3.rtmp.swfurl | head -n1`
482                URL=`echo "$URL" | sed -e 's/%3A/:/g' -e 's!%2F!/!g' -e 's!%3D!=!g' -e 's!%3F!?!g'`
483                EXTRA=" pageUrl=$REFERER"
484                if [ ! -z "$SWFURL" ];then
485                        EXTRA="$EXTRA swfUrl=$SWFURL swfVfy=1 timeout=15 live=1"
486                fi
487                if [ ! -z "$URL" ];then
488                        echo "$URL$EXTRA" >> $STREAMLIST
489                fi
490        fi
491        URL=$STREAMLIST
492
493
494        echo "$URL"
495}
496
497sport7()
498{
499        #http://sport7.tech/487b826914d11080dce4b502052b012d-live.html
500        #var videoLink = 'http://g4.securestream.sport7.tech/stream/NzYyZDUwZWNkODc5YWM5YjViY2ZkOTVhZGNjOGM1ZTc=/BTSport3.m3u8';
501
502        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
503        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
504        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
505
506        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
507        if [ -e "$STREAMLIST" ];then
508                rm -f $STREAMLIST > /dev/null 2>&1
509        fi
510
511        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
512        cat $TMP/cache.hoster.$hoster.1 | sed 's/var videoLink/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.url1
513        URL=`cat $TMP/cache.hoster.$hoster.url1 | head -n1`
514        # enable httponly cookie
515        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
516
517        if [ ! -z "$URL" ];then
518                echo "$URL$EXTRA" > $STREAMLIST
519                #echo "$URL$EXTRA"
520                echo "$STREAMLIST"
521        fi
522       
523       
524#       URL=`$curlbin "$INPUT" | sed 's/var videoLink/\nfound=/' | grep ^found= | cut -d"'" -f2`
525#       REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'`
526#       sed 's/#HttpOnly_//g' -i /mnt/network/cookies
527#       echo "$URL|Referer=$REFERER&X-f=96.91.79.87&User-Agent=$USERAGENT"
528#       cat $STREAMLIST
529}
530
531sportstream365()
532{
533        #http://sport7.tech/487b826914d11080dce4b502052b012d-live.html
534        #var videoLink = 'http://g4.securestream.sport7.tech/stream/NzYyZDUwZWNkODc5YWM5YjViY2ZkOTVhZGNjOGM1ZTc=/BTSport3.m3u8';
535
536        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
537#       REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
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 "$INPUT" -o $TMP/cache.hoster.$hoster.1
547
548        #<input type="hidden" name="game" value="146875046">
549        id=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*name="game" value="([^"]+)".*/\1/p')
550        ts=$(date +%s)
551        URL="http://sportstream365.com/LiveFeed/GetGame?id=$id&partner=24"
552
553        $curlbin "$URL" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.2
554
555
556        #"VI":"1032572"
557        id=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*"VI" :"([^"]+)".*/\1/p')
558        if [ -z "$id" ];then
559                id=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*"VI":"([^"]+)".*/\1/p')
560        fi
561        #https://github.com/XvBMC/repository.xvbmc/blob/master/Dependencies/script.module.liveresolver/lib/liveresolver/resolvers/sportstream365.py
562        URL=http://93.189.57.254/edge0/xrecord/$id/prog_index.m3u8
563        # enable httponly cookie
564        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
565
566        if [ ! -z "$URL" ];then
567                echo "$URL$EXTRA" > $STREAMLIST
568                #echo "$URL$EXTRA"
569                echo "$STREAMLIST"
570        fi
571}
572
573sportsonline()
574{
575        #http://sportsonline.pw/livetv/pt-sporttv1.html
576        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
577        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
578        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
579
580        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
581        if [ -e "$STREAMLIST" ];then
582                rm -f $STREAMLIST > /dev/null 2>&1
583        fi
584
585        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
586
587        #<iframe src="http://widestream.io/embedClappr.php?live=13593" width="100%" height="100%" scrolling="no" frameborder="0" allowfullscreen="true"></iframe>
588        TMPURL=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*iframe src="([^"]+)".*/\1/p')
589
590        $curlbin "$TMPURL" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.2
591
592        #source: "http://ultra.widestream.io:8081/wideedge/1022qvk/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9MTIvOS8yMDE3IDEyOjMyOjQzIEFNJmhhc2hfdmFsdWU9ZW9WeThRL0JmaVA2dnFUQm15Ukkvdz09JnZhbGlkbWludXRlcz0yMA==",
593        TMPURL=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*source: "([^"]+)".*/\1/p')
594
595        if [ ! -z "$TMPURL" ];then
596                echo "$TMPURL$EXTRA" > $STREAMLIST
597                #echo "$URL$EXTRA"
598                echo "$STREAMLIST"
599        fi
600}
601
602assia()
603{
604        #http://assia.tv/live/gol-tv/?lang=ru
605        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
606        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
607        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
608
609        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
610        if [ -e "$STREAMLIST" ];then
611                rm -f $STREAMLIST > /dev/null 2>&1
612        fi
613
614        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
615
616        #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);}});
617        TMPURL=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*file:"([^"]+)".*/\1/p' | tail -n1)
618
619        if [ ! -z "$TMPURL" ];then
620                echo "$TMPURL$EXTRA" > $STREAMLIST
621                #echo "$URL$EXTRA"
622                #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
623
624                echo "$STREAMLIST"
625        fi
626}
627
628cricfree()
629{
630        #http://cricfree.sc/update/bt2.php
631        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
632        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
633        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
634
635        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
636        if [ -e "$STREAMLIST" ];then
637                rm -f $STREAMLIST > /dev/null 2>&1
638        fi
639
640        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
641
642        #<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>
643        TMPURL1=$(cat $TMP/cache.hoster.$hoster.1 | grep "<iframe" | grep cricfree | sed -nr 's/.*src="([^"]+)".*/\1/p')
644
645#       $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
646        $curlbin "$TMPURL1" -o $TMP/cache.hoster.$hoster.2
647
648        #<script type='text/javascript'>id='bt2i'; width='620'; height='490';</script><script type='text/javascript' src='http://hi.notkodi.science/streamgame.js'></script>
649        TMPURL2=$(cat $TMP/cache.hoster.$hoster.2 | grep "id=" | sed -nr "s/.*src='([^']+)'.*/\1/p")
650        id=$(cat $TMP/cache.hoster.$hoster.2 | grep "id=" | sed -nr "s/.*id='([^']+)'.*/\1/p")
651
652        $curlbin "$TMPURL2" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.3
653
654        #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='
655        TMPURL3=$(cat $TMP/cache.hoster.$hoster.3 | grep document.write | sed -nr 's/.*src="([^"]+)".*/\1/p')
656
657        #var stretching = 'uniform';
658        stretching=$(cat $TMP/cache.hoster.$hoster.3 | sed -nr "s/.*var stretching = '([^']+)'.*/\1/p")
659
660        #var c = '0';
661        c=$(cat $TMP/cache.hoster.$hoster.3 | sed -nr "s/.*var c = '([^']+)'.*/\1/p")
662
663        #var p = '0';
664        p=$(cat $TMP/cache.hoster.$hoster.3 | sed -nr "s/.*var p = '([^']+)'.*/\1/p")
665
666        #http://veremos.date/all.php?id=bt2i&p=0&c=0&stretching=uniform
667        TMPURL3=$(echo $TMPURL3 | sed -e "s/'+id+'/$id/" -e "s/'+p+'/$p/" -e "s/'+c+'/$c/" -e "s/'+stretching+'/$stretching/")
668
669        #$curlbin http://veremos.date/all.php?id=bt2i&p=0&c=0&stretching=uniform" --referer "http://cricfree.sc/update/bt2.php"
670        $curlbin "$TMPURL3" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.4
671
672        #<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>
673        TMPURL4=$(cat $TMP/cache.hoster.$hoster.4 | grep "<iframe" | sed -nr 's/.*src="([^"]+)".*/\1/p')
674
675        #$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"
676        $curlbin "$TMPURL4" --referer "$TMPURL3" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.5
677
678        #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);
679        TMPURL=$(cat $TMP/cache.hoster.$hoster.5 | grep 'return(\["' | sed -e 's/","//g' -e 's/\\//g'| cut -d'"' -f2)
680
681        #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);
682        #uaagraneeblAStrsyrrUi
683        searchtoken1=$(cat $TMP/cache.hoster.$hoster.5 | grep 'return(\["'| sed -e 's/","//g' -e 's/\\//g' | awk '{ print $3 }' | cut -d"." -f1)
684        #var uaagraneeblAStrsyrrUi = ["3Rp","UJ5","ZoY","c2V","J","jgy","X3Z","9MT","XNo","ydm","ZEp","VyX","0OC","VlP","MDI","bWU","UxM","hbH"];
685        TOKEN1=$(cat $TMP/cache.hoster.$hoster.5 | grep "var $searchtoken1" | sed -e 's/","//g' -e 's/\\//g' | cut -d'"' -f2)
686
687        #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);
688        #rBkacSifaguntesith
689        searchtoken2=$(cat $TMP/cache.hoster.$hoster.5 | sed -nr 's/.*document.getElementById\("([^"]+)".*/\1/p')
690        #<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>
691        #MGZVL2wvanFha3ROWlVFQlE9PSZ2YWxpZG1pbnV0ZXM9MTAw
692        TOKEN2=$(cat $TMP/cache.hoster.$hoster.5 | sed "s/id=$searchtoken2/\nfoundid=/" | grep ^"foundid=" | cut -d'>' -f2 | cut -d'<' -f1)
693
694        if [ ! -z "$TMPURL" ];then
695#               echo "$TMPURL$token1$token2$EXTRA" > $STREAMLIST
696                #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
697
698                echo "$TMPURL$TOKEN1$TOKEN2" > $STREAMLIST
699
700                #echo "$URL$EXTRA"
701                echo "$STREAMLIST"
702        fi
703}
704
705#pl.init('http://78.142.19.151:8080/hls/streama113384/index.m3u8?st=dxSilE8xi3eR1Hk5_SLv1w');
706#apl3
707apl3()
708{
709        #http://assia.tv/live/gol-tv/?lang=ru
710        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
711        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
712        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
713
714        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
715        if [ -e "$STREAMLIST" ];then
716                rm -f $STREAMLIST > /dev/null 2>&1
717        fi
718
719        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
720        #pl.init('http://87.120.36.57:8080/hls/streama113535/index.m3u8?st=VsL7dEPX4fBHn3tcJmmcKw');
721        TMPURL=$(cat $TMP/cache.hoster.$hoster.1 | grep pl.init | cut -d"'" -f2)
722        # enable httponly cookie
723        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
724
725        if [ ! -z "$TMPURL" ];then
726                #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
727                echo "$TMPURL$TOKEN$EXTRA" > $STREAMLIST
728                echo "$STREAMLIST"
729        fi
730}
731
732broadcast()
733{
734        #http://assia.tv/live/gol-tv/?lang=ru
735        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
736        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
737        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
738
739        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
740        if [ -e "$STREAMLIST" ];then
741                rm -f $STREAMLIST > /dev/null 2>&1
742        fi
743
744        #$curlbin --referer "http://bro.adca.st/stream.php?id=17733&p=1&c=0&stretching=uniform&old=0" "http://bro.adca.st/token2.php"
745        $curlbin "http://bro.adca.st/token2.php" --referer "$INPUT" -o $TMP/cache.hoster.$hoster.1
746
747        #{"rumba":"ruYg748QTLGfAn2iZo3bpw&expires=1512880893"}
748        TOKEN=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*"rumba":"([^"]+)".*/\1/p' | tail -n1)
749
750        #$curlbin --referer "http://bonstreams.net" "http://bro.adca.st/stream.php?id=17733&p=1&c=0&stretching=uniform&old=0"
751        $curlbin "$INPUT" --referer "http://bonstreams.net" -o $TMP/cache.hoster.$hoster.2
752
753    #trap = "aHR0cDovL3RpZXIyLnBva2VyY29hbGl0aW9uLnB3L28xMC8xNzczMy5tM3U4P3NmPU5UazVOR0UzWXpSaE16bGpOUT09JnRva2VuPQ=
754        TRAP=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*trap = "([^"]+)".*/\1/p' | tail -n1)
755
756        echo "$TRAP" > $TMP/cache.hoster.$hoster.base64
757        TMPURL=$(base64 -d $TMP/cache.hoster.$hoster.base64)
758
759        # enable httponly cookie
760        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
761
762        if [ ! -z "$TMPURL" ];then
763                #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
764                echo "$TMPURL$TOKEN$EXTRA" > $STREAMLIST
765                echo "$STREAMLIST"
766        fi
767}
768
769all()
770{
771        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
772        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
773        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
774
775        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
776        if [ -e "$STREAMLIST" ];then
777                rm -f $STREAMLIST > /dev/null 2>&1
778        fi
779
780        rm $TMP/cache.$PARSER.$INPUT.$FROM.1 > /dev/null 2>&1
781
782        $curlbin -o $TMP/cache.$PARSER.$INPUT.$FROM.1 ${1}
783        URL=`zcat $TMP/cache.$PARSER.$INPUT.$FROM.1 | grep iframe | sed -nr 's/.*src="([^"]+)".*/\1/p'`
784        if [ -z "$URL" ];then
785                URL=`cat $TMP/cache.$PARSER.$INPUT.$FROM.1 | grep iframe | sed -nr 's/.*src="([^"]+)".*/\1/p'`
786        fi
787        if [ -z "$URL" ];then
788                URL=`cat $TMP/cache.$PARSER.$INPUT.$FROM.1 | grep "text/javascript" | grep -v jQuery | sed -nr 's/.*src="([^"]+)".*/\1/p'`
789        fi
790
791#       echo $URL
792        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.2
793}
794
795
796directstream()
797{
798        echo "$INPUT"
799#       rm -f /tmp/_last_hoster_* > /dev/null 2>&1
800        echo  "$INPUT" > /tmp/.last_hoster_$hoster.log
801}
802
803youtube_dl()
804{
805#       echo "$BIN $youtubebin $INPUT" > /tmp/.last_hoster_youtube_dl.log
806#       $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
807#       cat /tmp/youtube_dl.streamlink.log | tail -n1
808        mkdir $TMP > /dev/null 2>&1
809
810        if [ ! -z "$USER" ];then USER="--username $USER";fi
811        if [ ! -z "$PASS" ];then PASS="--password $PASS";fi
812
813        echo "$BIN $youtubebin $INPUT $USER $PASS" > /tmp/.last_hoster_$TYPE.log
814
815        if [ ! -z "$INPUT" ];then
816                $BIN $youtubebin "$INPUT" $USER $PASS > $TMP/$TYPE.$hoster.$FILENAME.streamlist
817                echo $INPUT >> $TMP/$TYPE.$hoster.$FILENAME.streamlist
818        else
819                echo "errormsg=Error: Youtube DL has Emthy Url from Parser" > $TMP/$TYPE.$hoster.$FILENAME.streamlist
820        fi
821#       cat $TMP/$TYPE.$hoster.$FILENAME.streamlist
822        echo $TMP/$TYPE.$hoster.$FILENAME.streamlist
823}
824
825youtube_dlbg()
826{
827#       echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_youtube_dlbg.log
828#       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"`
829#       echo "$URL" >> /tmp/.last_hoster_youtube_dlbg.log
830#       echo $URL
831        mkdir $TMP > /dev/null 2>&1
832
833        echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_$TYPE.log
834        $BIN $youtubebinbg "$DEST" "$INPUT" >> /tmp/.last_hoster_$TYPE.log
835        cat /tmp/.last_hoster_$TYPE.log | tail -n1
836#       echo $TMP/$TYPE.$hoster.$FILENAME.streamlist
837}
838
839hlsdl()
840{
841        mkdir $TMP > /dev/null 2>&1
842
843        echo "$HLSBIN $hlsdlbg $DEST $INPUT" > /tmp/.last_hoster_$TYPE.log
844
845        REFERER=$(echo "$INPUT" | sed -nr 's/.*Referer=([^=]+)&.*/\1/p')
846        if [ -z "$REFERER" ];then
847                REFERER=$(echo "$INPUT" | sed -nr 's/.*Referer=([^=]+).*/\1/p')
848        fi
849
850        if [ ! -z "$REFERER" ];then
851                REFERER="Referer: $REFERER"
852        fi
853
854        TMPUSERAGENT=$(echo "$INPUT" | sed -nr 's/.*User-Agent=([^=]+)&.*/\1/p')
855        if [ -z "$TMPUSERAGENT" ];then
856                TMPUSERAGENT=$(echo "$INPUT" | sed -nr 's/.*User-Agent=([^=]+).*/\1/p')
857        fi
858        if [ ! -z "$TMPUSERAGENT" ];then
859                USERAGENT=$TMPUSERAGENT
860        fi
861
862        URL=$(echo "$INPUT" | tr '|' '\n' | head -n1)
863
864        echo $HLSBIN "$URL" -v -f -u "$USERAGENT" -h "$REFERER" -o "$DEST" >> /tmp/.last_hoster_$TYPE.log
865        $HLSBIN "$URL" -v -f -u "$USERAGENT" -h "$REFERER" -o "$DEST" >> /tmp/.last_hoster_$TYPE.log
866#       $HLSBIN "$URL" -v -u "$USERA" -h "$REFERER" -o "$DEST" >> /tmp/.last_hlsdl_hoster_$TYPE.log
867
868}
869
870curldl()
871{
872        mkdir $TMP > /dev/null 2>&1
873
874        echo "$CURLBIN $INPUT -o $DEST " > /tmp/.last_hoster_$TYPE.log
875        $CURLBIN "$INPUT" -o "$DEST"
876}
877
878
879if [ "$TYPE" == "get" ];then
880        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
881        case $hoster in
882                apl3|apl13|apl14|apl15) apl3 $INPUT;;
883                ecostream) ecostream $INPUT;;
884                giga) giga $INPUT;;
885                nosvideo) nosvideo $INPUT;;
886                allmyvideos) allmyvideos $INPUT;;
887                flashx) flashx $INPUT;;
888                openload|oload) openload $INPUT;;
889                briskfile) briskfile $INPUT;;
890                videoweed|bitvid) videoweed $INPUT;;
891                vodlocker) vodlocker $INPUT;;
892                youwatch|chouhaa|ay8ou8ohth) youwatch $INPUT;;
893                thevideo|tvad|vev) thevideo $INPUT;;
894                movshare|wholecloud|vidgg) movshare $INPUT;;
895                vidto) vidto $INPUT;;
896                vidup) vidup $INPUT;;
897                vidzi) vidzi $INPUT;;
898                vivo) vivo $INPUT;;
899                goldesel|movie4k|movie4kto|kinox|kinos|kinoz|kinoxto|foxx) cloudflare $INPUT;;
900                streamcloud) streamcloud $INPUT;;       
901                nowvideo) nowvideo $INPUT;;
902                divxstage|cloudtime) divxstage $INPUT;;
903                novamov|auroravid) novamov $INPUT;;
904                xvidstage) xvidstage $INPUT;;
905                waaw|netu|hqq) waaw $INPUT;;
906                vidcloud|loadvid) vidcloud $INPUT;;
907                streamango|streamcherry) streamango $INPUT;;
908                vidlox) vidlox $INPUT;;
909                redirector|googlevideo|vodcloud|google|skyfall|s4) directstream "$INPUT";;
910                aliez|aplayer1) aliez $INPUT;;
911                sport7) sport7 $INPUT;;
912                sportstream365) sportstream365 $INPUT;;
913                sportsonline) sportsonline $INPUT;;
914                assia) assia $INPUT;;
915                cricfree) cricfree $INPUT;;
916                adca) broadcast $INPUT;;
917                streamz) streamz $INPUT;;
918                mixdrop) mixdrop $INPUT;;
919                vshare) vshare $INPUT;;
920                streamcrypt) hoster2=$(streamcrypt $INPUT);;
921#               *) all $INPUT;;
922        esac
923if [ ! -z "$hoster2" ];then
924        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster2.log
925        case $hoster2 in
926                apl3|apl13|apl14|apl15) apl3 $INPUT;;
927                ecostream) ecostream $INPUT;;
928                giga) giga $INPUT;;
929                nosvideo) nosvideo $INPUT;;
930                allmyvideos) allmyvideos $INPUT;;
931                flashx) flashx $INPUT;;
932                openload|oload) openload $INPUT;;
933                briskfile) briskfile $INPUT;;
934                videoweed|bitvid) videoweed $INPUT;;
935                vodlocker) vodlocker $INPUT;;
936                youwatch|chouhaa|ay8ou8ohth) youwatch $INPUT;;
937                thevideo|tvad|vev) thevideo $INPUT;;
938                movshare|wholecloud|vidgg) movshare $INPUT;;
939                vidto) vidto $INPUT;;
940                vidup) vidup $INPUT;;
941                vidzi) vidzi $INPUT;;
942                vivo) vivo $INPUT;;
943                goldesel|movie4k|movie4kto|kinox|kinos|kinoz|kinoxto|foxx) cloudflare $INPUT;;
944                streamcloud) streamcloud $INPUT;;       
945                nowvideo) nowvideo $INPUT;;
946                divxstage|cloudtime) divxstage $INPUT;;
947                novamov|auroravid) novamov $INPUT;;
948                xvidstage) xvidstage $INPUT;;
949                waaw|netu|hqq) waaw $INPUT;;
950                vidcloud|loadvid) vidcloud $INPUT;;
951                streamango|streamcherry) streamango $INPUT;;
952                vidlox) vidlox $INPUT;;
953                redirector|googlevideo|vodcloud|google|skyfall|s4) directstream "$INPUT";;
954                aliez|aplayer1) aliez $INPUT;;
955                sport7) sport7 $INPUT;;
956                sportstream365) sportstream365 $INPUT;;
957                sportsonline) sportsonline $INPUT;;
958                assia) assia $INPUT;;
959                cricfree) cricfree $INPUT;;
960                adca) broadcast $INPUT;;
961                streamz) streamz $INPUT;;
962                mixdrop) mixdrop $INPUT;;
963                vshare) vshare $INPUT;;
964                streamcrypt) streamcrypt $INPUT;;
965#               *) all $INPUT;;
966        esac
967fi
968fi
969
970if [ "$TYPE" == "hoster" ];then
971        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
972        case $hoster in
973                kinox|kinos|kinoz|kinoxto) kinox $INPUT;;
974        esac
975fi
976
977if [ "$TYPE" == "youtube_dl" ];then
978        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
979        case $hoster in
980                *) youtube_dl $INPUT $USER $PASS;;
981        esac
982fi
983
984if [ "$TYPE" == "youtube_dlbg" ];then
985        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
986        case $hoster in
987                *) youtube_dlbg $DEST $INPUT;;
988        esac
989fi
990
991if [ "$TYPE" == "hlsdl" ];then
992        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
993        case $hoster in
994                *) hlsdl $INPUT;;
995        esac
996fi
997
998if [ "$TYPE" == "curldl" ];then
999        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
1000        case $hoster in
1001                *) curldl $INPUT;;
1002        esac
1003fi
1004
1005if [ "$TYPE" == "cloudflare" ];then
1006        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
1007        case $hoster in
1008                *) cloudflare $INPUT;;
1009        esac
1010fi
1011
1012curlcmd()
1013{
1014        $curlbin "$INPUT" "$2" "$3"
1015}
1016
1017if [ "$TYPE" == "curl" ];then
1018        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
1019        case $hoster in
1020                *) curlcmd "$INPUT" "$3" "$4";;
1021        esac
1022fi
1023
1024
Note: See TracBrowser for help on using the repository browser.