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

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

tithek add proxy support first step use in titan.cfg tithek_proxy=socks5://user:pass@ip:port

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