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

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

fix mediathek youtube-dl install

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