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

Last change on this file since 45539 was 45539, checked in by obi, 3 years ago

fix tithek hoster alizetv

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