source: titan/mediathek/localhoster/hoster.sh

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

fix

  • Property svn:executable set to *
File size: 33.8 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
191thevideo()
192{
193        $BIN $CMD/thevideo.py $INPUT > $TMP/cache.$FILENAME.1
194
195        videocode=`cat $TMP/cache.$FILENAME.1`
196        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
197
198        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
199        if [ -e "$STREAMLIST" ];then
200                rm -f $STREAMLIST > /dev/null 2>&1
201        fi
202
203        $curlbin --data '{}' https://vev.io/api/serve/video/$videocode -o $TMP/cache.$FILENAME.2
204        cat $TMP/cache.$FILENAME.2 | sed 's/{/\n/g' | sed 's/,/\n/g' | grep "/stream/" >$TMP/cache.$FILENAME.3
205
206        #{"code":400,"message":"invalid video specified","errors":[]}
207        if [ `cat $TMP/cache.$FILENAME.2 | grep '"code":400,' | wc -l` -eq 1 ];then
208                ERROR=`cat $TMP/cache.$FILENAME.2 | sed -nr 's/.*"message":"([^"]+)".*/\1/p'`
209                echo "errormsg=$ERROR"
210        else
211                while read -u 3 ROUND; do
212                        TITEL=`echo $ROUND | cut -d'"' -f2`
213                        URL=`echo $ROUND | cut -d'"' -f4`
214
215                        if [ ! -z "$URL" ];then
216                                echo "$URL" | tr -d '\n' | tr -d '\r' >> $STREAMLIST
217                                echo "" >> $STREAMLIST
218                        fi
219
220
221                done 3<$TMP/cache.$FILENAME.3
222                rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
223                echo $STREAMLIST
224        fi
225}
226
227movshare()
228{
229        $BIN $CMD/movshare.py $INPUT
230}
231
232streamcloud()
233{
234        $BIN $CMD/streamcloud.py $INPUT
235}
236
237vidzi()
238{
239        $BIN $CMD/vidzi.py $INPUT
240}
241
242vivo()
243{
244        $BIN $CMD/vivo.py $INPUT
245}
246
247vidto()
248{
249        $BIN $CMD/vidto.py $INPUT
250}
251
252goldesel()
253{
254        $BIN $CMD/goldesel.py $INPUT
255}
256
257cloudflare()
258{
259        mkdir $TMP > /dev/null 2>&1
260        rm -f $TMP/cache.hoster.$hoster.1 > /dev/null 2>&1
261        $BIN $CMD/cloudflare.py $INPUT > $TMP/cache.hoster.$hoster.1 2>&1
262        if [ `cat $TMP/cache.hoster.$hoster.1 | grep "urllib2.HTTPError" | wc -l` -eq 1 ];then
263                ERROR=`cat $TMP/cache.hoster.$hoster.1 | grep urllib2.HTTPError:`
264                echo "errormsg=$ERROR"
265        else
266                cat $TMP/cache.hoster.$hoster.1
267        fi
268}
269
270kinox()
271{
272        mkdir $TMP > /dev/null 2>&1
273        rm -f $TMP/cache.hoster.$hoster.1 > /dev/null 2>&1
274
275        if [ "$TYPE" == "get" ];then
276                $BIN $CMD/cloudflare.py $INPUT > $TMP/cache.hoster.$hoster.1 2>&1
277                if [ `cat $TMP/cache.hoster.$hoster.1 | grep "urllib2.HTTPError" | wc -l` -eq 1 ];then
278                        ERROR=`echo $INPUT | grep urllib2.HTTPError:`
279                        echo "errormsg=$ERROR"
280                else
281                        cat $TMP/cache.hoster.$hoster.1
282                fi
283        elif [ "$TYPE" == "hoster" ];then
284
285                if [ `echo $INPUT | grep "/aGET/" | wc -l` -eq 1 ];then
286                        URL=`$BIN $CMD/cloudflare.py $INPUT | tr -d '\\' | sed -nr 's/.*<iframe src="([^"]+)".*/\1/p'`
287                        if [ -z "$URL" ];then
288                                URL=`$BIN $CMD/cloudflare.py $INPUT | tr -d '\\' | sed -nr 's/.*<a href="([^"]+)".*/\1/p'`
289                        fi
290                        if [ `echo $URL | grep "urllib2.HTTPError" | wc -l` -eq 1 ];then
291                                ERROR=`echo $INPUT | grep urllib2.HTTPError:`
292                                echo "errormsg=$ERROR"
293                        else
294                                if [ `echo $URL | grep ^"//" | wc -l` -eq 1 ];then
295                                        echo "http:$URL"
296                                else
297                                        echo "$URL"
298                                fi
299                        fi
300                else
301                        $BIN $CMD/cloudflare.py $INPUT         
302                fi     
303        fi
304}
305
306nowvideo()
307{
308        $BIN $CMD/nowvideo.py $INPUT
309}
310
311divxstage()
312{
313        $BIN $CMD/divxstage.py $INPUT
314}
315
316novamov()
317{
318        $BIN $CMD/novamov.py $INPUT
319}
320
321xvidstage()
322{
323        $BIN $CMD/xvidstage.py $INPUT
324}
325
326waaw()
327{
328        $BIN $CMD/waaw.py $INPUT
329}
330
331streamango()
332{
333        $BIN $CMD/streamango.py $INPUT
334}
335
336vidlox()
337{
338        $BIN $CMD/vidlox.py $INPUT
339}
340
341vidcloud()
342{
343        $BIN $CMD/vidcloud.py $INPUT
344}
345
346vodlocker()
347{
348        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
349
350        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
351        if [ -e "$STREAMLIST" ];then
352                rm -f $STREAMLIST > /dev/null 2>&1
353        fi
354
355        PAGE=`echo $INPUT | cut -d"|" -f1`
356        REFERER=`echo $INPUT | cut -d"|" -f2`
357
358        $curlbin "$PAGE" -o $TMP/cache.$FILENAME.1
359        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
360
361        while read -u 3 ROUND; do
362                NEWPAGE="$ROUND"
363
364                $curlbin2 -v "$NEWPAGE" --dump-header $TMP/cache.hoster.$hoster.1
365                cat $TMP/cache.hoster.$hoster.1 | grep ^Location: | cut -d" " -f2 >$TMP/cache.hoster.$hoster.1.url1
366                URL=`cat $TMP/cache.hoster.$hoster.1.url1`"|$REFERER"
367
368                CURTIME=`date +%s`
369                if [ `cat /mnt/network/cookies | grep .movie4k.ag | grep approve | wc -l` -eq 0 ];then
370                        echo ".movie4k.ag     TRUE    /       FALSE   $CURTIME      approve         1" >> /mnt/network/cookies
371                fi
372
373                if [ ! -z "$URL" ];then
374                        echo "$URL" | tr -d '\n' | tr -d '\r' >> $STREAMLIST
375                        echo "" >> $STREAMLIST
376
377                        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
378                        sed 's/.movie2k.ag/.movie4k.ag/g' -i /mnt/network/cookies
379                fi
380
381
382        done 3<$TMP/cache.$FILENAME.2
383        rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
384
385        URL=$STREAMLIST
386
387        echo "$URL"
388}
389
390aliezold()
391{
392        URL=`$curlbin "$INPUT" | sed 's/source:/\nsource:/' | grep ^source: | cut -d"'" -f2`
393        REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'`
394        echo "$URL|Referer=$REFERER&User-Agent=$USERAGENT"
395}
396
397aliez()
398{
399        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
400        #http://emb.aliez.me/player/live.php?id=56180&w=700&h=480"
401        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
402        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
403
404        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
405        if [ -e "$STREAMLIST" ];then
406                rm -f $STREAMLIST > /dev/null 2>&1
407        fi
408
409        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
410        cat $TMP/cache.hoster.$hoster.1 | sed 's/source:/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.url1
411        URL=`cat $TMP/cache.hoster.$hoster.url1 | head -n1`
412        if [ ! -z "$URL" ];then
413                echo "$URL$EXTRA" >> $STREAMLIST
414        fi
415#       URL=""
416        #file:  'http://a3.aliez.me:8080/hls/streama57449/index.m3u8?st=dgw2dOq8tyFkLLBLn2ycXA',
417
418        cat $TMP/cache.hoster.$hoster.1 | sed 's/file:/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.url2
419        URL=`cat $TMP/cache.hoster.$hoster.url2 | head -n1`
420        if [ ! -z "$URL" ];then
421                echo "$URL$EXTRA" >> $STREAMLIST
422        fi
423#URL=""
424        #"file":                "rtmp%3A%2F%2Fa3.aliez.me%2Flive%2Fstreama57449%3Ftoken%3Dd11304fabb8e64327df8427e1c2fd5d9"
425        cat $TMP/cache.hoster.$hoster.1 | sed 's/"file":/\nfound=/' | grep ^found= | cut -d'"' -f2 >$TMP/cache.hoster.$hoster.url3
426        URL=`cat $TMP/cache.hoster.$hoster.url3 | head -n1`
427
428        if [ "`echo $URL | grep rtmp | wc -l`" -eq 1 ];then
429                #new swfobject.embedSWF("http://i.aliez.me/swf/playernew.swf?0", "mediaspace", "700", "480", "9.0.115.0", false, flashvars, params);
430                cat $TMP/cache.hoster.$hoster.1 | sed 's/swfobject.embedSWF/\nfound=/' | grep ^found= | cut -d'"' -f2 >$TMP/cache.hoster.$hoster.url3.rtmp.swfurl
431                SWFURL=`cat $TMP/cache.hoster.$hoster.url3.rtmp.swfurl | head -n1`
432                URL=`echo "$URL" | sed -e 's/%3A/:/g' -e 's!%2F!/!g' -e 's!%3D!=!g' -e 's!%3F!?!g'`
433                EXTRA=" pageUrl=$REFERER"
434                if [ ! -z "$SWFURL" ];then
435                        EXTRA="$EXTRA swfUrl=$SWFURL swfVfy=1 timeout=15 live=1"
436                fi
437                if [ ! -z "$URL" ];then
438                        echo "$URL$EXTRA" >> $STREAMLIST
439                fi
440        fi
441        URL=$STREAMLIST
442
443
444        echo "$URL"
445}
446
447sport7()
448{
449        #http://sport7.tech/487b826914d11080dce4b502052b012d-live.html
450        #var videoLink = 'http://g4.securestream.sport7.tech/stream/NzYyZDUwZWNkODc5YWM5YjViY2ZkOTVhZGNjOGM1ZTc=/BTSport3.m3u8';
451
452        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
453        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
454        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
455
456        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
457        if [ -e "$STREAMLIST" ];then
458                rm -f $STREAMLIST > /dev/null 2>&1
459        fi
460
461        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
462        cat $TMP/cache.hoster.$hoster.1 | sed 's/var videoLink/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.hoster.$hoster.url1
463        URL=`cat $TMP/cache.hoster.$hoster.url1 | head -n1`
464        # enable httponly cookie
465        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
466
467        if [ ! -z "$URL" ];then
468                echo "$URL$EXTRA" > $STREAMLIST
469                #echo "$URL$EXTRA"
470                echo "$STREAMLIST"
471        fi
472       
473       
474#       URL=`$curlbin "$INPUT" | sed 's/var videoLink/\nfound=/' | grep ^found= | cut -d"'" -f2`
475#       REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'`
476#       sed 's/#HttpOnly_//g' -i /mnt/network/cookies
477#       echo "$URL|Referer=$REFERER&X-f=96.91.79.87&User-Agent=$USERAGENT"
478#       cat $STREAMLIST
479}
480
481sportstream365()
482{
483        #http://sport7.tech/487b826914d11080dce4b502052b012d-live.html
484        #var videoLink = 'http://g4.securestream.sport7.tech/stream/NzYyZDUwZWNkODc5YWM5YjViY2ZkOTVhZGNjOGM1ZTc=/BTSport3.m3u8';
485
486        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
487#       REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
488        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
489        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
490
491        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
492        if [ -e "$STREAMLIST" ];then
493                rm -f $STREAMLIST > /dev/null 2>&1
494        fi
495
496        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
497
498        #<input type="hidden" name="game" value="146875046">
499        id=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*name="game" value="([^"]+)".*/\1/p')
500        ts=$(date +%s)
501        URL="http://sportstream365.com/LiveFeed/GetGame?id=$id&partner=24"
502
503        $curlbin "$URL" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.2
504
505
506        #"VI":"1032572"
507        id=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*"VI" :"([^"]+)".*/\1/p')
508        if [ -z "$id" ];then
509                id=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*"VI":"([^"]+)".*/\1/p')
510        fi
511        #https://github.com/XvBMC/repository.xvbmc/blob/master/Dependencies/script.module.liveresolver/lib/liveresolver/resolvers/sportstream365.py
512        URL=http://93.189.57.254/edge0/xrecord/$id/prog_index.m3u8
513        # enable httponly cookie
514        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
515
516        if [ ! -z "$URL" ];then
517                echo "$URL$EXTRA" > $STREAMLIST
518                #echo "$URL$EXTRA"
519                echo "$STREAMLIST"
520        fi
521}
522
523sportsonline()
524{
525        #http://sportsonline.pw/livetv/pt-sporttv1.html
526        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
527        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
528        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
529
530        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
531        if [ -e "$STREAMLIST" ];then
532                rm -f $STREAMLIST > /dev/null 2>&1
533        fi
534
535        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
536
537        #<iframe src="http://widestream.io/embedClappr.php?live=13593" width="100%" height="100%" scrolling="no" frameborder="0" allowfullscreen="true"></iframe>
538        TMPURL=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*iframe src="([^"]+)".*/\1/p')
539
540        $curlbin "$TMPURL" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.2
541
542        #source: "http://ultra.widestream.io:8081/wideedge/1022qvk/playlist.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9MTIvOS8yMDE3IDEyOjMyOjQzIEFNJmhhc2hfdmFsdWU9ZW9WeThRL0JmaVA2dnFUQm15Ukkvdz09JnZhbGlkbWludXRlcz0yMA==",
543        TMPURL=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*source: "([^"]+)".*/\1/p')
544
545        if [ ! -z "$TMPURL" ];then
546                echo "$TMPURL$EXTRA" > $STREAMLIST
547                #echo "$URL$EXTRA"
548                echo "$STREAMLIST"
549        fi
550}
551
552assia()
553{
554        #http://assia.tv/live/gol-tv/?lang=ru
555        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
556        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
557        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
558
559        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
560        if [ -e "$STREAMLIST" ];then
561                rm -f $STREAMLIST > /dev/null 2>&1
562        fi
563
564        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
565
566        #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);}});
567        TMPURL=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*file:"([^"]+)".*/\1/p' | tail -n1)
568
569        if [ ! -z "$TMPURL" ];then
570                echo "$TMPURL$EXTRA" > $STREAMLIST
571                #echo "$URL$EXTRA"
572                #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
573
574                echo "$STREAMLIST"
575        fi
576}
577
578cricfree()
579{
580        #http://cricfree.sc/update/bt2.php
581        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
582        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
583        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
584
585        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
586        if [ -e "$STREAMLIST" ];then
587                rm -f $STREAMLIST > /dev/null 2>&1
588        fi
589
590        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
591
592        #<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>
593        TMPURL1=$(cat $TMP/cache.hoster.$hoster.1 | grep "<iframe" | grep cricfree | sed -nr 's/.*src="([^"]+)".*/\1/p')
594
595#       $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.1
596        $curlbin "$TMPURL1" -o $TMP/cache.hoster.$hoster.2
597
598        #<script type='text/javascript'>id='bt2i'; width='620'; height='490';</script><script type='text/javascript' src='http://hi.notkodi.science/streamgame.js'></script>
599        TMPURL2=$(cat $TMP/cache.hoster.$hoster.2 | grep "id=" | sed -nr "s/.*src='([^']+)'.*/\1/p")
600        id=$(cat $TMP/cache.hoster.$hoster.2 | grep "id=" | sed -nr "s/.*id='([^']+)'.*/\1/p")
601
602        $curlbin "$TMPURL2" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.3
603
604        #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='
605        TMPURL3=$(cat $TMP/cache.hoster.$hoster.3 | grep document.write | sed -nr 's/.*src="([^"]+)".*/\1/p')
606
607        #var stretching = 'uniform';
608        stretching=$(cat $TMP/cache.hoster.$hoster.3 | sed -nr "s/.*var stretching = '([^']+)'.*/\1/p")
609
610        #var c = '0';
611        c=$(cat $TMP/cache.hoster.$hoster.3 | sed -nr "s/.*var c = '([^']+)'.*/\1/p")
612
613        #var p = '0';
614        p=$(cat $TMP/cache.hoster.$hoster.3 | sed -nr "s/.*var p = '([^']+)'.*/\1/p")
615
616        #http://veremos.date/all.php?id=bt2i&p=0&c=0&stretching=uniform
617        TMPURL3=$(echo $TMPURL3 | sed -e "s/'+id+'/$id/" -e "s/'+p+'/$p/" -e "s/'+c+'/$c/" -e "s/'+stretching+'/$stretching/")
618
619        #$curlbin http://veremos.date/all.php?id=bt2i&p=0&c=0&stretching=uniform" --referer "http://cricfree.sc/update/bt2.php"
620        $curlbin "$TMPURL3" --referer "$REFERER" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.4
621
622        #<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>
623        TMPURL4=$(cat $TMP/cache.hoster.$hoster.4 | grep "<iframe" | sed -nr 's/.*src="([^"]+)".*/\1/p')
624
625        #$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"
626        $curlbin "$TMPURL4" --referer "$TMPURL3" -H "X-Requested-With: ShockwaveFlash/27.0.0.187" -o $TMP/cache.hoster.$hoster.5
627
628        #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);
629        TMPURL=$(cat $TMP/cache.hoster.$hoster.5 | grep 'return(\["' | sed -e 's/","//g' -e 's/\\//g'| cut -d'"' -f2)
630
631        #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);
632        #uaagraneeblAStrsyrrUi
633        searchtoken1=$(cat $TMP/cache.hoster.$hoster.5 | grep 'return(\["'| sed -e 's/","//g' -e 's/\\//g' | awk '{ print $3 }' | cut -d"." -f1)
634        #var uaagraneeblAStrsyrrUi = ["3Rp","UJ5","ZoY","c2V","J","jgy","X3Z","9MT","XNo","ydm","ZEp","VyX","0OC","VlP","MDI","bWU","UxM","hbH"];
635        TOKEN1=$(cat $TMP/cache.hoster.$hoster.5 | grep "var $searchtoken1" | sed -e 's/","//g' -e 's/\\//g' | cut -d'"' -f2)
636
637        #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);
638        #rBkacSifaguntesith
639        searchtoken2=$(cat $TMP/cache.hoster.$hoster.5 | sed -nr 's/.*document.getElementById\("([^"]+)".*/\1/p')
640        #<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>
641        #MGZVL2wvanFha3ROWlVFQlE9PSZ2YWxpZG1pbnV0ZXM9MTAw
642        TOKEN2=$(cat $TMP/cache.hoster.$hoster.5 | sed "s/id=$searchtoken2/\nfoundid=/" | grep ^"foundid=" | cut -d'>' -f2 | cut -d'<' -f1)
643
644        if [ ! -z "$TMPURL" ];then
645#               echo "$TMPURL$token1$token2$EXTRA" > $STREAMLIST
646                #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
647
648                echo "$TMPURL$TOKEN1$TOKEN2" > $STREAMLIST
649
650                #echo "$URL$EXTRA"
651                echo "$STREAMLIST"
652        fi
653}
654
655broadcast()
656{
657        #http://assia.tv/live/gol-tv/?lang=ru
658        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
659        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
660        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
661
662        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
663        if [ -e "$STREAMLIST" ];then
664                rm -f $STREAMLIST > /dev/null 2>&1
665        fi
666
667        #$curlbin --referer "http://bro.adca.st/stream.php?id=17733&p=1&c=0&stretching=uniform&old=0" "http://bro.adca.st/token2.php"
668        $curlbin "http://bro.adca.st/token2.php" --referer "$INPUT" -o $TMP/cache.hoster.$hoster.1
669
670        #{"rumba":"ruYg748QTLGfAn2iZo3bpw&expires=1512880893"}
671        TOKEN=$(cat $TMP/cache.hoster.$hoster.1 | sed -nr 's/.*"rumba":"([^"]+)".*/\1/p' | tail -n1)
672
673        #$curlbin --referer "http://bonstreams.net" "http://bro.adca.st/stream.php?id=17733&p=1&c=0&stretching=uniform&old=0"
674        $curlbin "$INPUT" --referer "http://bonstreams.net" -o $TMP/cache.hoster.$hoster.2
675
676    #trap = "aHR0cDovL3RpZXIyLnBva2VyY29hbGl0aW9uLnB3L28xMC8xNzczMy5tM3U4P3NmPU5UazVOR0UzWXpSaE16bGpOUT09JnRva2VuPQ=
677        TRAP=$(cat $TMP/cache.hoster.$hoster.2 | sed -nr 's/.*trap = "([^"]+)".*/\1/p' | tail -n1)
678
679        echo "$TRAP" > $TMP/cache.hoster.$hoster.base64
680        TMPURL=$(base64 -d $TMP/cache.hoster.$hoster.base64)
681
682        # enable httponly cookie
683        sed 's/#HttpOnly_//g' -i /mnt/network/cookies
684
685        if [ ! -z "$TMPURL" ];then
686                #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
687                echo "$TMPURL$TOKEN$EXTRA" > $STREAMLIST
688                echo "$STREAMLIST"
689        fi
690}
691
692all()
693{
694        rm -f $TMP/cache.hoster.$hoster.* > /dev/null 2>&1
695        REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'`
696        EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT"
697
698        STREAMLIST="$TMP/$TYPE.$hoster.$FILENAME.streamlist"
699        if [ -e "$STREAMLIST" ];then
700                rm -f $STREAMLIST > /dev/null 2>&1
701        fi
702
703        rm $TMP/cache.$PARSER.$INPUT.$FROM.1 > /dev/null 2>&1
704
705        $curlbin -o $TMP/cache.$PARSER.$INPUT.$FROM.1 ${1}
706        URL=`zcat $TMP/cache.$PARSER.$INPUT.$FROM.1 | grep iframe | sed -nr 's/.*src="([^"]+)".*/\1/p'`
707        if [ -z "$URL" ];then
708                URL=`cat $TMP/cache.$PARSER.$INPUT.$FROM.1 | grep iframe | sed -nr 's/.*src="([^"]+)".*/\1/p'`
709        fi
710        if [ -z "$URL" ];then
711                URL=`cat $TMP/cache.$PARSER.$INPUT.$FROM.1 | grep "text/javascript" | grep -v jQuery | sed -nr 's/.*src="([^"]+)".*/\1/p'`
712        fi
713
714#       echo $URL
715        $curlbin "$INPUT" -o $TMP/cache.hoster.$hoster.2
716}
717
718
719directstream()
720{
721        echo "$INPUT"
722#       rm -f /tmp/_last_hoster_* > /dev/null 2>&1
723        echo  "$INPUT" > /tmp/.last_hoster_$hoster.log
724}
725
726youtube_dl()
727{
728#       echo "$BIN $youtubebin $INPUT" > /tmp/.last_hoster_youtube_dl.log
729#       $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
730#       cat /tmp/youtube_dl.streamlink.log | tail -n1
731        mkdir $TMP > /dev/null 2>&1
732
733        if [ ! -z "$USER" ];then USER="--username $USER";fi
734        if [ ! -z "$PASS" ];then PASS="--password $PASS";fi
735
736        echo "$BIN $youtubebin $INPUT $USER $PASS" > /tmp/.last_hoster_youtube_dl.log
737
738        if [ ! -z "$INPUT" ];then
739                $BIN $youtubebin "$INPUT" $USER $PASS > $TMP/$TYPE.$hoster.$FILENAME.streamlist
740        else
741                echo "errormsg=Error: Youtube DL has Emthy Url from Parser" > $TMP/$TYPE.$hoster.$FILENAME.streamlist
742        fi
743#       cat $TMP/$TYPE.$hoster.$FILENAME.streamlist
744        echo $TMP/$TYPE.$hoster.$FILENAME.streamlist
745}
746
747youtube_dlbg()
748{
749#       echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_youtube_dlbg.log
750#       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"`
751#       echo "$URL" >> /tmp/.last_hoster_youtube_dlbg.log
752#       echo $URL
753        mkdir $TMP > /dev/null 2>&1
754
755        echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_$TYPE.log
756        $BIN $youtubebinbg "$DEST" "$INPUT" >> /tmp/.last_hoster_$TYPE.log
757        cat /tmp/.last_hoster_$TYPE.log | tail -n1
758#       echo $TMP/$TYPE.$hoster.$FILENAME.streamlist
759}
760
761hlsdl()
762{
763        mkdir $TMP > /dev/null 2>&1
764
765        echo "$HLSBIN $hlsdlbg $DEST $INPUT" > /tmp/.last_hoster_$TYPE.log
766
767        REFERER=$(echo "$INPUT" | sed -nr 's/.*Referer=([^=]+)&.*/\1/p')
768        if [ -z "$REFERER" ];then
769                REFERER=$(echo "$INPUT" | sed -nr 's/.*Referer=([^=]+).*/\1/p')
770        fi
771
772        if [ ! -z "$REFERER" ];then
773                REFERER="Referer: $REFERER"
774        fi
775
776        TMPUSERAGENT=$(echo "$INPUT" | sed -nr 's/.*User-Agent=([^=]+)&.*/\1/p')
777        if [ -z "$TMPUSERAGENT" ];then
778                TMPUSERAGENT=$(echo "$INPUT" | sed -nr 's/.*User-Agent=([^=]+).*/\1/p')
779        fi
780        if [ ! -z "$TMPUSERAGENT" ];then
781                USERAGENT=$TMPUSERAGENT
782        fi
783
784        URL=$(echo "$INPUT" | tr '|' '\n' | head -n1)
785
786        echo $HLSBIN "$URL" -v -f -u "$USERAGENT" -h "$REFERER" -o "$DEST" >> /tmp/.last_hoster_$TYPE.log
787        $HLSBIN "$URL" -v -f -u "$USERAGENT" -h "$REFERER" -o "$DEST" >> /tmp/.last_hoster_$TYPE.log
788#       $HLSBIN "$URL" -v -u "$USERA" -h "$REFERER" -o "$DEST" >> /tmp/.last_hoster_$TYPE.log
789
790}
791
792
793if [ "$TYPE" == "get" ];then
794        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
795        case $hoster in
796                ecostream) ecostream $INPUT;;
797                giga) giga $INPUT;;
798                nosvideo) nosvideo $INPUT;;
799                allmyvideos) allmyvideos $INPUT;;
800                flashx) flashx $INPUT;;
801                openload|oload) openload $INPUT;;
802                briskfile) briskfile $INPUT;;
803                videoweed|bitvid) videoweed $INPUT;;
804                vodlocker) vodlocker $INPUT;;
805                youwatch|chouhaa|ay8ou8ohth) youwatch $INPUT;;
806                thevideo|tvad|vev) thevideo $INPUT;;
807                movshare|wholecloud|vidgg) movshare $INPUT;;
808                vidto) vidto $INPUT;;
809                vidup) vidup $INPUT;;
810                vidzi) vidzi $INPUT;;
811                vivo) vivo $INPUT;;
812                goldesel|movie4k|movie4kto|kinox|kinos|kinoxto|foxx) cloudflare $INPUT;;
813                streamcloud) streamcloud $INPUT;;       
814                nowvideo) nowvideo $INPUT;;
815                divxstage|cloudtime) divxstage $INPUT;;
816                novamov|auroravid) novamov $INPUT;;
817                xvidstage) xvidstage $INPUT;;
818                waaw|netu|hqq) waaw $INPUT;;
819                vidcloud|loadvid) vidcloud $INPUT;;
820                streamango|streamcherry) streamango $INPUT;;
821                vidlox) vidlox $INPUT;;
822                redirector|googlevideo|vodcloud|google|skyfall|s4) directstream "$INPUT";;
823                aliez|aplayer1) aliez $INPUT;;
824                sport7) sport7 $INPUT;;
825                sportstream365) sportstream365 $INPUT;;
826                sportsonline) sportsonline $INPUT;;
827                assia) assia $INPUT;;
828                cricfree) cricfree $INPUT;;
829                adca) broadcast $INPUT;;
830#               *) all $INPUT;;
831        esac
832fi
833
834if [ "$TYPE" == "hoster" ];then
835        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
836        case $hoster in
837                kinox|kinos|kinoxto) kinox $INPUT;;
838        esac
839fi
840
841if [ "$TYPE" == "youtube_dl" ];then
842        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
843        case $hoster in
844                *) youtube_dl $INPUT $USER $PASS;;
845        esac
846fi
847
848if [ "$TYPE" == "youtube_dlbg" ];then
849        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
850        case $hoster in
851                *) youtube_dlbg $DEST $INPUT;;
852        esac
853fi
854
855if [ "$TYPE" == "hlsdl" ];then
856        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
857        case $hoster in
858                *) hlsdl $INPUT;;
859        esac
860fi
861
862if [ "$TYPE" == "cloudflare" ];then
863        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
864        case $hoster in
865                *) cloudflare $INPUT;;
866        esac
867fi
868
869curlcmd()
870{
871        $curlbin "$INPUT" "$2" "$3"
872}
873
874if [ "$TYPE" == "curl" ];then
875        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
876        case $hoster in
877                *) curlcmd "$INPUT" "$3" "$4";;
878        esac
879fi
880
881
Note: See TracBrowser for help on using the repository browser.