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

Last change on this file since 44927 was 44927, checked in by obi, 2 years ago

test voe

  • Property svn:executable set to *
File size: 38.6 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
395voe()
396{
397        URL=`$curlbin "$INPUT" | sed -nr "s/.*src: '([^']+)'.*/\1/p"`
398        REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'`
399#       echo "$URL|Referer=$REFERER&User-Agent=$USERAGENT"
400        echo "$URL"
401}
402
403vodlocker()
404{
405        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
406
407        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
408        if [ -e "$STREAMLIST" ];then
409                rm -f $STREAMLIST > /dev/null 2>&1
410        fi
411
412        PAGE=`echo $INPUT | cut -d"|" -f1`
413        REFERER=`echo $INPUT | cut -d"|" -f2`
414
415        $curlbin "$PAGE" -o $TMP/cache.$FILENAME.1
416        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
417
418        while read -u 3 ROUND; do
419                NEWPAGE="$ROUND"
420
421                $curlbin2 -v "$NEWPAGE" --dump-header $TMP/cache.hoster.$hoster.1
422                cat $TMP/cache.hoster.$hoster.1 | grep ^Location: | cut -d" " -f2 >$TMP/cache.hoster.$hoster.1.url1
423                URL=`cat $TMP/cache.hoster.$hoster.1.url1`"|$REFERER"
424
425                CURTIME=`date +%s`
426                if [ `cat /mnt/network/cookies | grep .movie4k.ag | grep approve | wc -l` -eq 0 ];then
427                        echo ".movie4k.ag     TRUE    /       FALSE   $CURTIME      approve         1" >> /mnt/network/cookies
428                fi
429
430                if [ ! -z "$URL" ];then
431                        echo "$URL" | tr -d '\n' | tr -d '\r' >> $STREAMLIST
432                        echo "" >> $STREAMLIST
433
434                        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
435                        sed 's/.movie2k.ag/.movie4k.ag/g' -i /mnt/network/cookies
436                fi
437
438
439        done 3<$TMP/cache.$FILENAME.2
440        rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
441
442        URL=$STREAMLIST
443
444        echo "$URL"
445}
446
447aliezold()
448{
449        URL=`$curlbin "$INPUT" | sed 's/source:/\nsource:/' | grep ^source: | cut -d"'" -f2`
450        REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'`
451        echo "$URL|Referer=$REFERER&User-Agent=$USERAGENT"
452}
453
454aliez()
455{
456        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
457        #http://emb.aliez.me/player/live.php?id=56180&w=700&h=480"
458        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
459        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
460
461        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
462        if [ -e "$STREAMLIST" ];then
463                rm -f $STREAMLIST > /dev/null 2>&1
464        fi
465
466        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
467        cat $TMP/cache.hoster.$hoster.1 | sed 's/source:/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.url1
468        URL=`cat $TMP/cache.hoster.$hoster.url1 | head -n1`
469        if [ ! -z "$URL" ];then
470                echo "$URL$EXTRA" >> $STREAMLIST
471        fi
472#       URL=""
473        #file:  'http://a3.aliez.me:8080/hls/streama57449/index.m3u8?st=dgw2dOq8tyFkLLBLn2ycXA',
474
475        cat $TMP/cache.hoster.$hoster.1 | sed 's/file:/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.url2
476        URL=`cat $TMP/cache.hoster.$hoster.url2 | head -n1`
477        if [ ! -z "$URL" ];then
478                echo "$URL$EXTRA" >> $STREAMLIST
479        fi
480#URL=""
481        #"file":                "rtmp%3A%2F%2Fa3.aliez.me%2Flive%2Fstreama57449%3Ftoken%3Dd11304fabb8e64327df8427e1c2fd5d9"
482        cat $TMP/cache.hoster.$hoster.1 | sed 's/"file":/\nfound=/' | grep ^found= | cut -d'"' -f2 >$TMP/cache.hoster.$hoster.url3
483        URL=`cat $TMP/cache.hoster.$hoster.url3 | head -n1`
484
485        if [ "`echo $URL | grep rtmp | wc -l`" -eq 1 ];then
486                #new swfobject.embedSWF("http://i.aliez.me/swf/playernew.swf?0", "mediaspace", "700", "480", "9.0.115.0", false, flashvars, params);
487                cat $TMP/cache.hoster.$hoster.1 | sed 's/swfobject.embedSWF/\nfound=/' | grep ^found= | cut -d'"' -f2 >$TMP/cache.hoster.$hoster.url3.rtmp.swfurl
488                SWFURL=`cat $TMP/cache.hoster.$hoster.url3.rtmp.swfurl | head -n1`
489                URL=`echo "$URL" | sed -e 's/%3A/:/g' -e 's!%2F!/!g' -e 's!%3D!=!g' -e 's!%3F!?!g'`
490                EXTRA=" pageUrl=$REFERER"
491                if [ ! -z "$SWFURL" ];then
492                        EXTRA="$EXTRA swfUrl=$SWFURL swfVfy=1 timeout=15 live=1"
493                fi
494                if [ ! -z "$URL" ];then
495                        echo "$URL$EXTRA" >> $STREAMLIST
496                fi
497        fi
498        URL=$STREAMLIST
499
500
501        echo "$URL"
502}
503
504sport7()
505{
506        #http://sport7.tech/487b826914d11080dce4b502052b012d-live.html
507        #var videoLink = 'http://g4.securestream.sport7.tech/stream/NzYyZDUwZWNkODc5YWM5YjViY2ZkOTVhZGNjOGM1ZTc=/BTSport3.m3u8';
508
509        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
510        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
511        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
512
513        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
514        if [ -e "$STREAMLIST" ];then
515                rm -f $STREAMLIST > /dev/null 2>&1
516        fi
517
518        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
519        cat $TMP/cache.hoster.$hoster.1 | sed 's/var videoLink/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.url1
520        URL=`cat $TMP/cache.hoster.$hoster.url1 | head -n1`
521        # enable httponly cookie
522        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
523
524        if [ ! -z "$URL" ];then
525                echo "$URL$EXTRA" > $STREAMLIST
526                #echo "$URL$EXTRA"
527                echo "$STREAMLIST"
528        fi
529       
530       
531#       URL=`$curlbin "$INPUT" | sed 's/var videoLink/\nfound=/' | grep ^found= | cut -d"'" -f2`
532#       REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'`
533#       sed 's/#HttpOnly_//g' -i /mnt/network/cookies
534#       echo "$URL|Referer=$REFERER&X-f=96.91.79.87&User-Agent=$USERAGENT"
535#       cat $STREAMLIST
536}
537
538sportstream365()
539{
540        #http://sport7.tech/487b826914d11080dce4b502052b012d-live.html
541        #var videoLink = 'http://g4.securestream.sport7.tech/stream/NzYyZDUwZWNkODc5YWM5YjViY2ZkOTVhZGNjOGM1ZTc=/BTSport3.m3u8';
542
543        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
544#       REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
545        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
546        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
547
548        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
549        if [ -e "$STREAMLIST" ];then
550                rm -f $STREAMLIST > /dev/null 2>&1
551        fi
552
553        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
554
555        #<input type="hidden" name="game" value="146875046">
556        id=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*name="game" value="([^"]+)".*/\1/p')
557        ts=$(date +%s)
558        URL="http://sportstream365.com/LiveFeed/GetGame?id=$id&partner=24"
559
560        $curlbin "$URL" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.2
561
562
563        #"VI":"1032572"
564        id=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*"VI" :"([^"]+)".*/\1/p')
565        if [ -z "$id" ];then
566                id=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*"VI":"([^"]+)".*/\1/p')
567        fi
568        #https://github.com/XvBMC/repository.xvbmc/blob/master/Dependencies/script.module.liveresolver/lib/liveresolver/resolvers/sportstream365.py
569        URL=http://93.189.57.254/edge0/xrecord/$id/prog_index.m3u8
570        # enable httponly cookie
571        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
572
573        if [ ! -z "$URL" ];then
574                echo "$URL$EXTRA" > $STREAMLIST
575                #echo "$URL$EXTRA"
576                echo "$STREAMLIST"
577        fi
578}
579
580sportsonline()
581{
582        #http://sportsonline.pw/livetv/pt-sporttv1.html
583        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
584        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
585        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
586
587        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
588        if [ -e "$STREAMLIST" ];then
589                rm -f $STREAMLIST > /dev/null 2>&1
590        fi
591
592        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
593
594        #<iframe src="http://widestream.io/embedClappr.php?live=13593" width="100%" height="100%" scrolling="no" frameborder="0" allowfullscreen="true"></iframe>
595        TMPURL=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*iframe src="([^"]+)".*/\1/p')
596
597        $curlbin "$TMPURL" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.2
598
599        #source: "http://ultra.widestream.io:8081/wideedge/1022qvk/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9MTIvOS8yMDE3IDEyOjMyOjQzIEFNJmhhc2hfdmFsdWU9ZW9WeThRL0JmaVA2dnFUQm15Ukkvdz09JnZhbGlkbWludXRlcz0yMA==",
600        TMPURL=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*source: "([^"]+)".*/\1/p')
601
602        if [ ! -z "$TMPURL" ];then
603                echo "$TMPURL$EXTRA" > $STREAMLIST
604                #echo "$URL$EXTRA"
605                echo "$STREAMLIST"
606        fi
607}
608
609assia()
610{
611        #http://assia.tv/live/gol-tv/?lang=ru
612        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
613        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
614        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
615
616        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
617        if [ -e "$STREAMLIST" ];then
618                rm -f $STREAMLIST > /dev/null 2>&1
619        fi
620
621        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
622
623        #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);}});
624        TMPURL=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*file:"([^"]+)".*/\1/p' | tail -n1)
625
626        if [ ! -z "$TMPURL" ];then
627                echo "$TMPURL$EXTRA" > $STREAMLIST
628                #echo "$URL$EXTRA"
629                #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
630
631                echo "$STREAMLIST"
632        fi
633}
634
635cricfree()
636{
637        #http://cricfree.sc/update/bt2.php
638        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
639        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
640        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
641
642        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
643        if [ -e "$STREAMLIST" ];then
644                rm -f $STREAMLIST > /dev/null 2>&1
645        fi
646
647        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
648
649        #<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>
650        TMPURL1=$(cat $TMP/cache.hoster.$hoster.1 | grep "<iframe" | grep cricfree | sed -nr 's/.*src="([^"]+)".*/\1/p')
651
652#       $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
653        $curlbin "$TMPURL1" -o $TMP/cache.hoster.$hoster.2
654
655        #<script type='text/javascript'>id='bt2i'; width='620'; height='490';</script><script type='text/javascript' src='http://hi.notkodi.science/streamgame.js'></script>
656        TMPURL2=$(cat $TMP/cache.hoster.$hoster.2 | grep "id=" | sed -nr "s/.*src='([^']+)'.*/\1/p")
657        id=$(cat $TMP/cache.hoster.$hoster.2 | grep "id=" | sed -nr "s/.*id='([^']+)'.*/\1/p")
658
659        $curlbin "$TMPURL2" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.3
660
661        #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='
662        TMPURL3=$(cat $TMP/cache.hoster.$hoster.3 | grep document.write | sed -nr 's/.*src="([^"]+)".*/\1/p')
663
664        #var stretching = 'uniform';
665        stretching=$(cat $TMP/cache.hoster.$hoster.3 | sed -nr "s/.*var stretching = '([^']+)'.*/\1/p")
666
667        #var c = '0';
668        c=$(cat $TMP/cache.hoster.$hoster.3 | sed -nr "s/.*var c = '([^']+)'.*/\1/p")
669
670        #var p = '0';
671        p=$(cat $TMP/cache.hoster.$hoster.3 | sed -nr "s/.*var p = '([^']+)'.*/\1/p")
672
673        #http://veremos.date/all.php?id=bt2i&p=0&c=0&stretching=uniform
674        TMPURL3=$(echo $TMPURL3 | sed -e "s/'+id+'/$id/" -e "s/'+p+'/$p/" -e "s/'+c+'/$c/" -e "s/'+stretching+'/$stretching/")
675
676        #$curlbin http://veremos.date/all.php?id=bt2i&p=0&c=0&stretching=uniform" --referer "http://cricfree.sc/update/bt2.php"
677        $curlbin "$TMPURL3" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.4
678
679        #<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>
680        TMPURL4=$(cat $TMP/cache.hoster.$hoster.4 | grep "<iframe" | sed -nr 's/.*src="([^"]+)".*/\1/p')
681
682        #$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"
683        $curlbin "$TMPURL4" --referer "$TMPURL3" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.5
684
685        #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);
686        TMPURL=$(cat $TMP/cache.hoster.$hoster.5 | grep 'return(\["' | sed -e 's/","//g' -e 's/\\//g'| cut -d'"' -f2)
687
688        #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);
689        #uaagraneeblAStrsyrrUi
690        searchtoken1=$(cat $TMP/cache.hoster.$hoster.5 | grep 'return(\["'| sed -e 's/","//g' -e 's/\\//g' | awk '{ print $3 }' | cut -d"." -f1)
691        #var uaagraneeblAStrsyrrUi = ["3Rp","UJ5","ZoY","c2V","J","jgy","X3Z","9MT","XNo","ydm","ZEp","VyX","0OC","VlP","MDI","bWU","UxM","hbH"];
692        TOKEN1=$(cat $TMP/cache.hoster.$hoster.5 | grep "var $searchtoken1" | sed -e 's/","//g' -e 's/\\//g' | cut -d'"' -f2)
693
694        #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);
695        #rBkacSifaguntesith
696        searchtoken2=$(cat $TMP/cache.hoster.$hoster.5 | sed -nr 's/.*document.getElementById\("([^"]+)".*/\1/p')
697        #<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>
698        #MGZVL2wvanFha3ROWlVFQlE9PSZ2YWxpZG1pbnV0ZXM9MTAw
699        TOKEN2=$(cat $TMP/cache.hoster.$hoster.5 | sed "s/id=$searchtoken2/\nfoundid=/" | grep ^"foundid=" | cut -d'>' -f2 | cut -d'<' -f1)
700
701        if [ ! -z "$TMPURL" ];then
702#               echo "$TMPURL$token1$token2$EXTRA" > $STREAMLIST
703                #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
704
705                echo "$TMPURL$TOKEN1$TOKEN2" > $STREAMLIST
706
707                #echo "$URL$EXTRA"
708                echo "$STREAMLIST"
709        fi
710}
711
712#pl.init('http://78.142.19.151:8080/hls/streama113384/index.m3u8?st=dxSilE8xi3eR1Hk5_SLv1w');
713#apl3
714apl3()
715{
716        #http://assia.tv/live/gol-tv/?lang=ru
717        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
718        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
719        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
720
721        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
722        if [ -e "$STREAMLIST" ];then
723                rm -f $STREAMLIST > /dev/null 2>&1
724        fi
725
726        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
727        #pl.init('http://87.120.36.57:8080/hls/streama113535/index.m3u8?st=VsL7dEPX4fBHn3tcJmmcKw');
728        TMPURL=$(cat $TMP/cache.hoster.$hoster.1 | grep pl.init | cut -d"'" -f2)
729        # enable httponly cookie
730        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
731
732        if [ ! -z "$TMPURL" ];then
733                #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
734                echo "$TMPURL$TOKEN$EXTRA" > $STREAMLIST
735                echo "$STREAMLIST"
736        fi
737}
738
739broadcast()
740{
741        #http://assia.tv/live/gol-tv/?lang=ru
742        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
743        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
744        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
745
746        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
747        if [ -e "$STREAMLIST" ];then
748                rm -f $STREAMLIST > /dev/null 2>&1
749        fi
750
751        #$curlbin --referer "http://bro.adca.st/stream.php?id=17733&p=1&c=0&stretching=uniform&old=0" "http://bro.adca.st/token2.php"
752        $curlbin "http://bro.adca.st/token2.php" --referer "$INPUT" -o $TMP/cache.hoster.$hoster.1
753
754        #{"rumba":"ruYg748QTLGfAn2iZo3bpw&expires=1512880893"}
755        TOKEN=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*"rumba":"([^"]+)".*/\1/p' | tail -n1)
756
757        #$curlbin --referer "http://bonstreams.net" "http://bro.adca.st/stream.php?id=17733&p=1&c=0&stretching=uniform&old=0"
758        $curlbin "$INPUT" --referer "http://bonstreams.net" -o $TMP/cache.hoster.$hoster.2
759
760    #trap = "aHR0cDovL3RpZXIyLnBva2VyY29hbGl0aW9uLnB3L28xMC8xNzczMy5tM3U4P3NmPU5UazVOR0UzWXpSaE16bGpOUT09JnRva2VuPQ=
761        TRAP=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*trap = "([^"]+)".*/\1/p' | tail -n1)
762
763        echo "$TRAP" > $TMP/cache.hoster.$hoster.base64
764        TMPURL=$(base64 -d $TMP/cache.hoster.$hoster.base64)
765
766        # enable httponly cookie
767        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
768
769        if [ ! -z "$TMPURL" ];then
770                #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
771                echo "$TMPURL$TOKEN$EXTRA" > $STREAMLIST
772                echo "$STREAMLIST"
773        fi
774}
775
776all()
777{
778        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
779        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
780        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
781
782        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
783        if [ -e "$STREAMLIST" ];then
784                rm -f $STREAMLIST > /dev/null 2>&1
785        fi
786
787        rm $TMP/cache.$PARSER.$INPUT.$FROM.1 > /dev/null 2>&1
788
789        $curlbin -o $TMP/cache.$PARSER.$INPUT.$FROM.1 ${1}
790        URL=`zcat $TMP/cache.$PARSER.$INPUT.$FROM.1 | grep iframe | sed -nr 's/.*src="([^"]+)".*/\1/p'`
791        if [ -z "$URL" ];then
792                URL=`cat $TMP/cache.$PARSER.$INPUT.$FROM.1 | grep iframe | sed -nr 's/.*src="([^"]+)".*/\1/p'`
793        fi
794        if [ -z "$URL" ];then
795                URL=`cat $TMP/cache.$PARSER.$INPUT.$FROM.1 | grep "text/javascript" | grep -v jQuery | sed -nr 's/.*src="([^"]+)".*/\1/p'`
796        fi
797
798#       echo $URL
799        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.2
800}
801
802
803directstream()
804{
805        echo "$INPUT"
806#       rm -f /tmp/_last_hoster_* > /dev/null 2>&1
807        echo  "$INPUT" > /tmp/.last_hoster_$hoster.log
808}
809
810youtube_dl()
811{
812#       echo "$BIN $youtubebin $INPUT" > /tmp/.last_hoster_youtube_dl.log
813#       $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
814#       cat /tmp/youtube_dl.streamlink.log | tail -n1
815        mkdir $TMP > /dev/null 2>&1
816
817        if [ ! -z "$USER" ];then USER="--username $USER";fi
818        if [ ! -z "$PASS" ];then PASS="--password $PASS";fi
819
820        echo "$BIN $youtubebin $INPUT $USER $PASS" > /tmp/.last_hoster_$TYPE.log
821
822        if [ ! -z "$INPUT" ];then
823                $BIN $youtubebin "$INPUT" $USER $PASS > $TMP/$TYPE.$hoster.$FILENAME.streamlist
824                echo $INPUT >> $TMP/$TYPE.$hoster.$FILENAME.streamlist
825        else
826                echo "errormsg=Error: Youtube DL has Emthy Url from Parser" > $TMP/$TYPE.$hoster.$FILENAME.streamlist
827        fi
828#       cat $TMP/$TYPE.$hoster.$FILENAME.streamlist
829        echo $TMP/$TYPE.$hoster.$FILENAME.streamlist
830}
831
832youtube_dlbg()
833{
834#       echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_youtube_dlbg.log
835#       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"`
836#       echo "$URL" >> /tmp/.last_hoster_youtube_dlbg.log
837#       echo $URL
838        mkdir $TMP > /dev/null 2>&1
839
840        echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_$TYPE.log
841        $BIN $youtubebinbg "$DEST" "$INPUT" >> /tmp/.last_hoster_$TYPE.log
842        cat /tmp/.last_hoster_$TYPE.log | tail -n1
843#       echo $TMP/$TYPE.$hoster.$FILENAME.streamlist
844}
845
846hlsdl()
847{
848        mkdir $TMP > /dev/null 2>&1
849
850        echo "$HLSBIN $hlsdlbg $DEST $INPUT" > /tmp/.last_hoster_$TYPE.log
851
852        REFERER=$(echo "$INPUT" | sed -nr 's/.*Referer=([^=]+)&.*/\1/p')
853        if [ -z "$REFERER" ];then
854                REFERER=$(echo "$INPUT" | sed -nr 's/.*Referer=([^=]+).*/\1/p')
855        fi
856
857        if [ ! -z "$REFERER" ];then
858                REFERER="Referer: $REFERER"
859        fi
860
861        TMPUSERAGENT=$(echo "$INPUT" | sed -nr 's/.*User-Agent=([^=]+)&.*/\1/p')
862        if [ -z "$TMPUSERAGENT" ];then
863                TMPUSERAGENT=$(echo "$INPUT" | sed -nr 's/.*User-Agent=([^=]+).*/\1/p')
864        fi
865        if [ ! -z "$TMPUSERAGENT" ];then
866                USERAGENT=$TMPUSERAGENT
867        fi
868
869        URL=$(echo "$INPUT" | tr '|' '\n' | head -n1)
870
871        echo $HLSBIN "$URL" -v -f -u "$USERAGENT" -h "$REFERER" -o "$DEST" >> /tmp/.last_hoster_$TYPE.log
872        $HLSBIN "$URL" -v -f -u "$USERAGENT" -h "$REFERER" -o "$DEST" >> /tmp/.last_hoster_$TYPE.log
873#       $HLSBIN "$URL" -v -u "$USERA" -h "$REFERER" -o "$DEST" >> /tmp/.last_hlsdl_hoster_$TYPE.log
874
875}
876
877curldl()
878{
879        mkdir $TMP > /dev/null 2>&1
880
881        echo "$CURLBIN $INPUT -o $DEST " > /tmp/.last_hoster_$TYPE.log
882        $CURLBIN "$INPUT" -o "$DEST"
883}
884
885
886if [ "$TYPE" == "get" ];then
887        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
888        case $hoster in
889                apl3|apl13|apl14|apl15) apl3 $INPUT;;
890                ecostream) ecostream $INPUT;;
891                giga) giga $INPUT;;
892                nosvideo) nosvideo $INPUT;;
893                allmyvideos) allmyvideos $INPUT;;
894                flashx) flashx $INPUT;;
895                openload|oload) openload $INPUT;;
896                briskfile) briskfile $INPUT;;
897                videoweed|bitvid) videoweed $INPUT;;
898                vodlocker) vodlocker $INPUT;;
899                youwatch|chouhaa|ay8ou8ohth) youwatch $INPUT;;
900                thevideo|tvad|vev) thevideo $INPUT;;
901                movshare|wholecloud|vidgg) movshare $INPUT;;
902                vidto) vidto $INPUT;;
903                vidup) vidup $INPUT;;
904                vidzi) vidzi $INPUT;;
905                vivo) vivo $INPUT;;
906                goldesel|movie4k|movie4kto|kinox|kinos|kinoz|kinoxto|foxx) cloudflare $INPUT;;
907                streamcloud) streamcloud $INPUT;;       
908                nowvideo) nowvideo $INPUT;;
909                divxstage|cloudtime) divxstage $INPUT;;
910                novamov|auroravid) novamov $INPUT;;
911                xvidstage) xvidstage $INPUT;;
912                waaw|netu|hqq) waaw $INPUT;;
913                vidcloud|loadvid) vidcloud $INPUT;;
914                streamango|streamcherry) streamango $INPUT;;
915                vidlox) vidlox $INPUT;;
916                redirector|googlevideo|vodcloud|google|skyfall|s4) directstream "$INPUT";;
917                aliez|aplayer1) aliez $INPUT;;
918                sport7) sport7 $INPUT;;
919                sportstream365) sportstream365 $INPUT;;
920                sportsonline) sportsonline $INPUT;;
921                assia) assia $INPUT;;
922                cricfree) cricfree $INPUT;;
923                adca) broadcast $INPUT;;
924                streamz) streamz $INPUT;;
925                mixdrop) mixdrop $INPUT;;
926                vshare) vshare $INPUT;;
927                streamcrypt) hoster2=$(streamcrypt $INPUT);;
928                voe) voe $INPUT;;
929#               *) all $INPUT;;
930        esac
931if [ ! -z "$hoster2" ];then
932        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster2.log
933        case $hoster2 in
934                apl3|apl13|apl14|apl15) apl3 $INPUT;;
935                ecostream) ecostream $INPUT;;
936                giga) giga $INPUT;;
937                nosvideo) nosvideo $INPUT;;
938                allmyvideos) allmyvideos $INPUT;;
939                flashx) flashx $INPUT;;
940                openload|oload) openload $INPUT;;
941                briskfile) briskfile $INPUT;;
942                videoweed|bitvid) videoweed $INPUT;;
943                vodlocker) vodlocker $INPUT;;
944                youwatch|chouhaa|ay8ou8ohth) youwatch $INPUT;;
945                thevideo|tvad|vev) thevideo $INPUT;;
946                movshare|wholecloud|vidgg) movshare $INPUT;;
947                vidto) vidto $INPUT;;
948                vidup) vidup $INPUT;;
949                vidzi) vidzi $INPUT;;
950                vivo) vivo $INPUT;;
951                goldesel|movie4k|movie4kto|kinox|kinos|kinoz|kinoxto|foxx) cloudflare $INPUT;;
952                streamcloud) streamcloud $INPUT;;       
953                nowvideo) nowvideo $INPUT;;
954                divxstage|cloudtime) divxstage $INPUT;;
955                novamov|auroravid) novamov $INPUT;;
956                xvidstage) xvidstage $INPUT;;
957                waaw|netu|hqq) waaw $INPUT;;
958                vidcloud|loadvid) vidcloud $INPUT;;
959                streamango|streamcherry) streamango $INPUT;;
960                vidlox) vidlox $INPUT;;
961                redirector|googlevideo|vodcloud|google|skyfall|s4) directstream "$INPUT";;
962                aliez|aplayer1) aliez $INPUT;;
963                sport7) sport7 $INPUT;;
964                sportstream365) sportstream365 $INPUT;;
965                sportsonline) sportsonline $INPUT;;
966                assia) assia $INPUT;;
967                cricfree) cricfree $INPUT;;
968                adca) broadcast $INPUT;;
969                streamz) streamz $INPUT;;
970                mixdrop) mixdrop $INPUT;;
971                vshare) vshare $INPUT;;
972                streamcrypt) streamcrypt $INPUT;;
973                voe) voe $INPUT;;
974#               *) all $INPUT;;
975        esac
976fi
977fi
978
979if [ "$TYPE" == "hoster" ];then
980        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
981        case $hoster in
982                kinox|kinos|kinoz|kinoxto) kinox $INPUT;;
983        esac
984fi
985
986if [ "$TYPE" == "youtube_dl" ];then
987        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
988        case $hoster in
989                *) youtube_dl $INPUT $USER $PASS;;
990        esac
991fi
992
993if [ "$TYPE" == "youtube_dlbg" ];then
994        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
995        case $hoster in
996                *) youtube_dlbg $DEST $INPUT;;
997        esac
998fi
999
1000if [ "$TYPE" == "hlsdl" ];then
1001        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
1002        case $hoster in
1003                *) hlsdl $INPUT;;
1004        esac
1005fi
1006
1007if [ "$TYPE" == "curldl" ];then
1008        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
1009        case $hoster in
1010                *) curldl $INPUT;;
1011        esac
1012fi
1013
1014if [ "$TYPE" == "cloudflare" ];then
1015        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
1016        case $hoster in
1017                *) cloudflare $INPUT;;
1018        esac
1019fi
1020
1021curlcmd()
1022{
1023        $curlbin "$INPUT" "$2" "$3"
1024}
1025
1026if [ "$TYPE" == "curl" ];then
1027        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
1028        case $hoster in
1029                *) curlcmd "$INPUT" "$3" "$4";;
1030        esac
1031fi
1032
1033
Note: See TracBrowser for help on using the repository browser.