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

Last change on this file since 45034 was 45034, checked in by obi, 10 months ago

tithek voe disable proxy

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