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

Last change on this file since 40675 was 40675, checked in by tt4sk, 4 years ago

[TiThek] fixed: hoster.sh python.sh4: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

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