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

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

fix

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