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

Last change on this file since 44481 was 44481, checked in by obi, 4 years ago

fix sportsondemand alize

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