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

Last change on this file since 41548 was 41548, checked in by obi, 5 years ago

fix ytdl

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