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

Last change on this file since 42647 was 42647, checked in by obi, 9 months ago

update hoster

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