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

Last change on this file since 45028 was 45028, checked in by obi, 11 months ago

tithek fix sportsondemand alize hoster and add nba preseason

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