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

Last change on this file since 40201 was 40201, checked in by tt4sk, 5 years ago

[TiThek] fixed: hoster.sh ln does not work in linked path, replace with mv

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