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

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

tithek change USERAGENT

  • Property svn:executable set to *
File size: 9.0 KB
Line 
1#!/bin/sh
2# first sh box hoster for titannit mfg obi
3
4TYPE=$1
5INPUT=$2
6DEST=$3
7
8INPUT=`echo $INPUT | sed 's!/Out/?s=!!g'`
9
10ARCH=`cat /etc/.arch`
11BOX=`cat /etc/model`
12TMP=/tmp/localcache
13CMD=/tmp/localhoster
14#USERAGENT='Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0'
15USERAGENT='Mozilla%2F5.0+%28Windows+NT+6.3%3B+rv%3A36.0%29+Gecko%2F20100101+Firefox%2F36.0'
16debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
17curlbin="curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A '$USERAGENT'"
18curlbin2='curl -k -s --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A '$USERAGENT''
19youtubebin="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent '$USERAGENT' --format mp4 --restrict-filenames --ignore-errors -g"
20youtubebinbg="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent '$USERAGENT' --format mp4 --restrict-filenames --ignore-errors --output"
21export PYTHONHOME=/tmp/localhoster
22export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/localhoster/lib
23
24if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
25if [ "$debuglevel" == "99" ]; then curlbin2="$curlbin2 -v"; fi
26#if [ "$debuglevel" == "99" ]; then youtubebin="$youtubebin --verbose"; fi
27
28wgetbin="wget -q -T2"
29
30BIN="$CMD"/bin/python."$ARCH"
31
32if [ ! -e "/tmp/localhoster/lib/python2.7/lib-dynload" ] && [ -e /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" ];then
33#       ln -fs /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload
34        mv -f /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload
35        rm -rf /tmp/localhoster/lib/python2.7/lib-dynload.*
36fi
37if [ ! -e "/tmp/localhoster/lib/libpython2.7.so.1.0" ] && [ -e /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" ];then
38#       ln -fs /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0
39        mv -f /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0
40        rm -f /tmp/localhoster/lib/libpython2.7.so.1.0.*
41fi
42if [ ! -e "/tmp/localhoster/lib/libcrypto.so.1.0.0" ] && [ -e /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" ];then
43#       ln -fs /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" /tmp/localhoster/lib/libcrypto.so.1.0.0
44        mv -f /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" /tmp/localhoster/lib/libcrypto.so.1.0.0
45        rm -f /tmp/localhoster/lib/libcrypto.so.1.0.0.*
46fi
47if [ ! -e "/tmp/localhoster/lib/libssl.so.1.0.0" ] && [ -e /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" ];then
48#       ln -fs /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" /tmp/localhoster/lib/llibssl.so.1.0.0
49        mv -f /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" /tmp/localhoster/lib/libssl.so.1.0.0
50        rm -f /tmp/localhoster/lib/libssl.so.1.0.0.*
51fi
52
53if [ -e "$TMP/hoster.tar" ]; then rm -f $TMP/hoster.tar; fi
54if [ -e "$TMP/parser.tar" ]; then rm -f $TMP/parser.tar; fi
55
56if [ "$ARCH" == "sh4" ] && [ "$BOX" != "ufs912" ]; then
57        if [ -e "$CMD/lib/python2.7/lib-dynload.mipsel" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.mipsel; fi
58        if [ -e "$CMD/lib/python2.7/lib-dynload.arm" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.arm; fi
59
60        if [ -e "$CMD/lib/libpython2.7.so.1.0.mipsel" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.mipsel; fi
61        if [ -e "$CMD/lib/libpython2.7.so.1.0.arm" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.arm; fi
62
63        if [ -e "$CMD/lib/libssl.so.1.0.0.mipsel" ]; then rm -rf $CMD/lib/libssl.so.1.0.0.mipsel; fi
64        if [ -e "$CMD/lib/libssl.so.1.0.0.arm" ]; then rm -rf $CMD/lib/libssl.so.1.0.0.arm; fi
65
66        if [ -e "$CMD/lib/libcrypto.so.1.0.0.mipsel" ]; then rm -rf $CMD/lib/libcrypto.so.1.0.0.mipsel; fi
67        if [ -e "$CMD/lib/libcrypto.so.1.0.0.arm" ]; then rm -rf $CMD/lib/libcrypto.so.1.0.0.arm; fi
68fi
69
70hostercheck=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | tr '.' '\n' | wc -l`
71hosterline=`expr $hostercheck - 1`
72hoster=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | cut -d"." -f$hosterline`
73#echo $hoster
74
75debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
76if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
77
78ecostream()
79{
80        hosterurl=http://www.ecostream.tv
81        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`"
82        streampage=`$curlbin $hosterurl/js/ecoss.js | grep "$.post('" | grep videos | cut -d"'" -f2`
83        streamurl=$hosterurl`$curlbin -H "X-Requested-With: XMLHttpRequest" -X POST --data "$data" --referer $INPUT $hosterurl/$streampage | cut -d'"' -f6`
84        if [ "`echo $streamurl | grep DOCTYPE | wc -l`" -eq 0 ] && [ "$streamurl" != "$hosterurl" ];then
85                echo $streamurl
86        fi
87}
88
89giga()
90{
91        streampage=`$curlbin $INPUT | grep "<iframe src=" | cut -d'"' -f2 | head -n1`
92        streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 1080p`
93        if [ -z "$streamurl" ];then
94                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 720p`
95        fi
96        if [ -z "$streamurl" ];then
97                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 480p`
98        fi
99        if [ -z "$streamurl" ];then
100                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 360p`
101        fi
102        if [ -z "$streamurl" ];then
103                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 240p`
104        fi
105        if [ -z "$streamurl" ];then
106                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 180p`
107        fi
108        echo $streamurl
109}
110
111vidup()
112{
113        $BIN $CMD/vidup.py $INPUT
114}
115
116nosvideo()
117{
118        $BIN $CMD/nosvideo.py $INPUT
119}
120
121allmyvideos()
122{
123        $BIN $CMD/allmyvideos.py $INPUT
124}
125
126flashx()
127{
128        $BIN $CMD/flashx.py $INPUT
129}
130
131openload()
132{
133        $BIN $CMD/openload.py $INPUT
134}
135
136briskfile()
137{
138        $BIN $CMD/briskfile.py $INPUT
139}
140
141vodlocker()
142{
143        $BIN $CMD/vodlocker.py $INPUT
144}
145
146videoweed()
147{
148        $BIN $CMD/videoweed.py $INPUT
149}
150
151vodzi()
152{
153        $BIN $CMD/vodzi.py $INPUT
154}
155
156youwatch()
157{
158        $BIN $CMD/youwatch.py $INPUT
159}
160
161thevideo()
162{
163        $BIN $CMD/thevideo.py $INPUT
164}
165
166movshare()
167{
168        $BIN $CMD/movshare.py $INPUT
169}
170
171streamcloud()
172{
173        $BIN $CMD/streamcloud.py $INPUT
174}
175
176vidzi()
177{
178        $BIN $CMD/vidzi.py $INPUT
179}
180
181vivo()
182{
183        $BIN $CMD/vivo.py $INPUT
184}
185
186vidto()
187{
188        $BIN $CMD/vidto.py $INPUT
189}
190
191goldesel()
192{
193        $BIN $CMD/goldesel.py $INPUT
194}
195
196cloudflare()
197{
198        $BIN $CMD/cloudflare.py $INPUT
199}
200
201nowvideo()
202{
203        $BIN $CMD/nowvideo.py $INPUT
204}
205
206divxstage()
207{
208        $BIN $CMD/divxstage.py $INPUT
209}
210
211novamov()
212{
213        $BIN $CMD/novamov.py $INPUT
214}
215
216xvidstage()
217{
218        $BIN $CMD/xvidstage.py $INPUT
219}
220
221waaw()
222{
223        $BIN $CMD/waaw.py $INPUT
224}
225
226streamango()
227{
228        $BIN $CMD/streamango.py $INPUT
229}
230
231vidlox()
232{
233        $BIN $CMD/vidlox.py $INPUT
234}
235
236aliez()
237{
238        URL=`$curlbin "$INPUT" | sed 's/source:/\nsource:/' | grep ^source: | cut -d"'" -f2`
239        REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'`
240        echo "$URL|Referer=$REFERER&User-Agent=$USERAGENT"
241#       echo "$URL|Referer=$REFERER&User-Agent='Mozilla/5.0 (Windows NT 6.3; rv:36.0) Gecko/20100101 Firefox/36.0'"
242}
243
244#http://emb.aliez.me/player/live.php?id=56180&w=700&h=480"
245
246
247directstream()
248{
249        echo "$INPUT"
250#       rm -f /tmp/_last_hoster_* > /dev/null 2>&1
251        echo  "$INPUT" > /tmp/.last_hoster_$hoster.log
252}
253
254youtube_dl()
255{
256#       echo "$BIN $youtubebin $INPUT" > /tmp/.last_hoster_youtube_dl.log
257#       $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
258#       cat /tmp/youtube_dl.streamlink.log | tail -n1
259        $BIN $youtubebin "$INPUT"
260}
261
262youtube_dlbg()
263{
264#       echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_youtube_dlbg.log
265#       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"`
266#       echo "$URL" >> /tmp/.last_hoster_youtube_dlbg.log
267#       echo $URL
268        $BIN $youtubebinbg $DEST $INPUT
269}
270
271if [ "$TYPE" == "get" ];then
272        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
273        case $hoster in
274                ecostream) ecostream $INPUT;;
275                giga) giga $INPUT;;
276                nosvideo) nosvideo $INPUT;;
277                allmyvideos) allmyvideos $INPUT;;
278                flashx) flashx $INPUT;;
279                openload) openload $INPUT;;
280                briskfile) briskfile $INPUT;;
281                videoweed|bitvid) videoweed $INPUT;;
282                vodlocker) vodlocker $INPUT;;
283                youwatch|chouhaa|ay8ou8ohth) youwatch $INPUT;;
284                thevideo) thevideo $INPUT;;
285                movshare|wholecloud|vidgg) movshare $INPUT;;
286                vidto) vidto $INPUT;;
287                vidup) vidup $INPUT;;
288                vidzi) vidzi $INPUT;;
289                vivo) vivo $INPUT;;
290                goldesel|movie4k) cloudflare $INPUT;;
291                streamcloud1) streamcloud $INPUT;;     
292                nowvideo) nowvideo $INPUT;;
293                divxstage|cloudtime) divxstage $INPUT;;
294                novamov|auroravid) novamov $INPUT;;
295                xvidstage) xvidstage $INPUT;;
296                waaw|netu|hqq) waaw $INPUT;;
297                streamango|streamcherry) streamango $INPUT;;
298                vidlox) vidlox $INPUT;;
299                redirector|googlevideo|vodcloud|google) directstream "$INPUT";;
300                aliez) aliez $INPUT;;
301        esac
302fi
303
304if [ "$TYPE" == "youtube_dl" ];then
305        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
306        case $hoster in
307                *) youtube_dl $INPUT;;
308        esac
309fi
310
311if [ "$TYPE" == "youtube_dlbg" ];then
312        echo  "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log
313        case $hoster in
314                *) youtube_dlbg $DEST $INPUT;;
315        esac
316fi
317
Note: See TracBrowser for help on using the repository browser.