1 | #!/bin/sh |
---|
2 | # first sh box hoster for titannit mfg obi |
---|
3 | |
---|
4 | TYPE=$1 |
---|
5 | INPUT=$2 |
---|
6 | DEST=$3 |
---|
7 | |
---|
8 | INPUT=`echo $INPUT | sed 's!/Out/?s=!!g'` |
---|
9 | |
---|
10 | ARCH=`cat /etc/.arch` |
---|
11 | BOX=`cat /etc/model` |
---|
12 | TMP=/tmp/localcache |
---|
13 | CMD=/tmp/localhoster |
---|
14 | USERAGENT='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' |
---|
15 | debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2` |
---|
16 | curlbin="curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A $USERAGENT" |
---|
17 | curlbin2='curl -k -s --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies' |
---|
18 | youtubebin="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent '$USERAGENT' --format mp4 --restrict-filenames --ignore-errors -g" |
---|
19 | youtubebinbg="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent '$USERAGENT' --format mp4 --restrict-filenames --ignore-errors --output" |
---|
20 | export PYTHONHOME=/tmp/localhoster |
---|
21 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/localhoster/lib |
---|
22 | |
---|
23 | if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi |
---|
24 | if [ "$debuglevel" == "99" ]; then curlbin2="$curlbin2 -v"; fi |
---|
25 | #if [ "$debuglevel" == "99" ]; then youtubebin="$youtubebin --verbose"; fi |
---|
26 | |
---|
27 | wgetbin="wget -q -T2" |
---|
28 | |
---|
29 | BIN="$CMD"/bin/python."$ARCH" |
---|
30 | |
---|
31 | if [ ! -e "/tmp/localhoster/lib/python2.7/lib-dynload" ] && [ -e /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" ];then |
---|
32 | # ln -fs /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload |
---|
33 | mv -f /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload |
---|
34 | rm -rf /tmp/localhoster/lib/python2.7/lib-dynload.* |
---|
35 | fi |
---|
36 | if [ ! -e "/tmp/localhoster/lib/libpython2.7.so.1.0" ] && [ -e /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" ];then |
---|
37 | # ln -fs /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0 |
---|
38 | mv -f /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0 |
---|
39 | rm -f /tmp/localhoster/lib/libpython2.7.so.1.0.* |
---|
40 | fi |
---|
41 | if [ ! -e "/tmp/localhoster/lib/libcrypto.so.1.0.0" ] && [ -e /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" ];then |
---|
42 | # ln -fs /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" /tmp/localhoster/lib/libcrypto.so.1.0.0 |
---|
43 | mv -f /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" /tmp/localhoster/lib/libcrypto.so.1.0.0 |
---|
44 | rm -f /tmp/localhoster/lib/libcrypto.so.1.0.0.* |
---|
45 | fi |
---|
46 | if [ ! -e "/tmp/localhoster/lib/libssl.so.1.0.0" ] && [ -e /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" ];then |
---|
47 | # ln -fs /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" /tmp/localhoster/lib/llibssl.so.1.0.0 |
---|
48 | mv -f /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" /tmp/localhoster/lib/libssl.so.1.0.0 |
---|
49 | rm -f /tmp/localhoster/lib/libssl.so.1.0.0.* |
---|
50 | fi |
---|
51 | |
---|
52 | if [ -e "$TMP/hoster.tar" ]; then rm -f $TMP/hoster.tar; fi |
---|
53 | if [ -e "$TMP/parser.tar" ]; then rm -f $TMP/parser.tar; fi |
---|
54 | |
---|
55 | if [ "$ARCH" == "sh4" ] && [ "$BOX" != "ufs912" ]; then |
---|
56 | if [ -e "$CMD/lib/python2.7/lib-dynload.mipsel" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.mipsel; fi |
---|
57 | if [ -e "$CMD/lib/python2.7/lib-dynload.arm" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.arm; fi |
---|
58 | |
---|
59 | if [ -e "$CMD/lib/libpython2.7.so.1.0.mipsel" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.mipsel; fi |
---|
60 | if [ -e "$CMD/lib/libpython2.7.so.1.0.arm" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.arm; fi |
---|
61 | |
---|
62 | if [ -e "$CMD/lib/libssl.so.1.0.0.mipsel" ]; then rm -rf $CMD/lib/libssl.so.1.0.0.mipsel; fi |
---|
63 | if [ -e "$CMD/lib/libssl.so.1.0.0.arm" ]; then rm -rf $CMD/lib/libssl.so.1.0.0.arm; fi |
---|
64 | |
---|
65 | if [ -e "$CMD/lib/libcrypto.so.1.0.0.mipsel" ]; then rm -rf $CMD/lib/libcrypto.so.1.0.0.mipsel; fi |
---|
66 | if [ -e "$CMD/lib/libcrypto.so.1.0.0.arm" ]; then rm -rf $CMD/lib/libcrypto.so.1.0.0.arm; fi |
---|
67 | fi |
---|
68 | |
---|
69 | hostercheck=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | tr '.' '\n' | wc -l` |
---|
70 | hosterline=`expr $hostercheck - 1` |
---|
71 | hoster=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | cut -d"." -f$hosterline` |
---|
72 | #echo $hoster |
---|
73 | |
---|
74 | debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2` |
---|
75 | curlbin='curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies' |
---|
76 | if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi |
---|
77 | |
---|
78 | ecostream() |
---|
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 | |
---|
89 | giga() |
---|
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 | |
---|
111 | vidup() |
---|
112 | { |
---|
113 | $BIN $CMD/vidup.py $INPUT |
---|
114 | } |
---|
115 | |
---|
116 | nosvideo() |
---|
117 | { |
---|
118 | $BIN $CMD/nosvideo.py $INPUT |
---|
119 | } |
---|
120 | |
---|
121 | allmyvideos() |
---|
122 | { |
---|
123 | $BIN $CMD/allmyvideos.py $INPUT |
---|
124 | } |
---|
125 | |
---|
126 | flashx() |
---|
127 | { |
---|
128 | $BIN $CMD/flashx.py $INPUT |
---|
129 | } |
---|
130 | |
---|
131 | openload() |
---|
132 | { |
---|
133 | $BIN $CMD/openload.py $INPUT |
---|
134 | } |
---|
135 | |
---|
136 | briskfile() |
---|
137 | { |
---|
138 | $BIN $CMD/briskfile.py $INPUT |
---|
139 | } |
---|
140 | |
---|
141 | vodlocker() |
---|
142 | { |
---|
143 | $BIN $CMD/vodlocker.py $INPUT |
---|
144 | } |
---|
145 | |
---|
146 | videoweed() |
---|
147 | { |
---|
148 | $BIN $CMD/videoweed.py $INPUT |
---|
149 | } |
---|
150 | |
---|
151 | vodzi() |
---|
152 | { |
---|
153 | $BIN $CMD/vodzi.py $INPUT |
---|
154 | } |
---|
155 | |
---|
156 | youwatch() |
---|
157 | { |
---|
158 | $BIN $CMD/youwatch.py $INPUT |
---|
159 | } |
---|
160 | |
---|
161 | thevideo() |
---|
162 | { |
---|
163 | $BIN $CMD/thevideo.py $INPUT |
---|
164 | } |
---|
165 | |
---|
166 | movshare() |
---|
167 | { |
---|
168 | $BIN $CMD/movshare.py $INPUT |
---|
169 | } |
---|
170 | |
---|
171 | streamcloud() |
---|
172 | { |
---|
173 | $BIN $CMD/streamcloud.py $INPUT |
---|
174 | } |
---|
175 | |
---|
176 | vidzi() |
---|
177 | { |
---|
178 | $BIN $CMD/vidzi.py $INPUT |
---|
179 | } |
---|
180 | |
---|
181 | vivo() |
---|
182 | { |
---|
183 | $BIN $CMD/vivo.py $INPUT |
---|
184 | } |
---|
185 | |
---|
186 | vidto() |
---|
187 | { |
---|
188 | $BIN $CMD/vidto.py $INPUT |
---|
189 | } |
---|
190 | |
---|
191 | goldesel() |
---|
192 | { |
---|
193 | $BIN $CMD/goldesel.py $INPUT |
---|
194 | } |
---|
195 | |
---|
196 | cloudflare() |
---|
197 | { |
---|
198 | $BIN $CMD/cloudflare.py $INPUT |
---|
199 | } |
---|
200 | |
---|
201 | nowvideo() |
---|
202 | { |
---|
203 | $BIN $CMD/nowvideo.py $INPUT |
---|
204 | } |
---|
205 | |
---|
206 | divxstage() |
---|
207 | { |
---|
208 | $BIN $CMD/divxstage.py $INPUT |
---|
209 | } |
---|
210 | |
---|
211 | novamov() |
---|
212 | { |
---|
213 | $BIN $CMD/novamov.py $INPUT |
---|
214 | } |
---|
215 | |
---|
216 | xvidstage() |
---|
217 | { |
---|
218 | $BIN $CMD/xvidstage.py $INPUT |
---|
219 | } |
---|
220 | |
---|
221 | waaw() |
---|
222 | { |
---|
223 | $BIN $CMD/waaw.py $INPUT |
---|
224 | } |
---|
225 | |
---|
226 | streamango() |
---|
227 | { |
---|
228 | $BIN $CMD/streamango.py $INPUT |
---|
229 | } |
---|
230 | |
---|
231 | directstream() |
---|
232 | { |
---|
233 | echo "$INPUT" |
---|
234 | # rm -f /tmp/_last_hoster_* > /dev/null 2>&1 |
---|
235 | echo "$INPUT" > /tmp/.last_hoster_$hoster.log |
---|
236 | } |
---|
237 | |
---|
238 | youtube_dl() |
---|
239 | { |
---|
240 | # rm -f /tmp/_last_hoster_* > /dev/null 2>&1 |
---|
241 | echo "$BIN $youtubebin $INPUT" > /tmp/.last_hoster_youtube_dl.log |
---|
242 | # $BIN $youtubebin "$INPUT" |
---|
243 | # $BIN $CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent "$USERAGENT" --all-formats -g "$INPUT" |
---|
244 | # 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"` |
---|
245 | # echo "$URL" >> /tmp/.last_hoster_youtube_dl.log |
---|
246 | # echo $URL |
---|
247 | |
---|
248 | $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 |
---|
249 | cat /tmp/youtube_dl.streamlink.log | tail -n1 |
---|
250 | } |
---|
251 | |
---|
252 | youtube_dlbg() |
---|
253 | { |
---|
254 | # rm -f /tmp/_last_hoster_* > /dev/null 2>&1 |
---|
255 | echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_youtube_dlbg.log |
---|
256 | # $BIN $youtubebin "$INPUT" |
---|
257 | # $BIN $CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent "$USERAGENT" --all-formats -g "$INPUT" |
---|
258 | 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"` |
---|
259 | echo "$URL" >> /tmp/.last_hoster_youtube_dlbg.log |
---|
260 | echo $URL |
---|
261 | } |
---|
262 | if [ "$TYPE" == "get" ];then |
---|
263 | echo "$INPUT" > /tmp/.last_hoster_$hoster.log |
---|
264 | case $hoster in |
---|
265 | ecostream) ecostream $INPUT;; |
---|
266 | giga) giga $INPUT;; |
---|
267 | nosvideo) nosvideo $INPUT;; |
---|
268 | allmyvideos) allmyvideos $INPUT;; |
---|
269 | flashx) flashx $INPUT;; |
---|
270 | openload) openload $INPUT;; |
---|
271 | briskfile) briskfile $INPUT;; |
---|
272 | videoweed|bitvid) videoweed $INPUT;; |
---|
273 | vodlocker) vodlocker $INPUT;; |
---|
274 | youwatch|chouhaa|ay8ou8ohth) youwatch $INPUT;; |
---|
275 | thevideo) thevideo $INPUT;; |
---|
276 | movshare|wholecloud|vidgg) movshare $INPUT;; |
---|
277 | vidto) vidto $INPUT;; |
---|
278 | vidup) vidup $INPUT;; |
---|
279 | vidzi) vidzi $INPUT;; |
---|
280 | vivo) vivo $INPUT;; |
---|
281 | goldesel|movie4k) cloudflare $INPUT;; |
---|
282 | streamcloud1) streamcloud $INPUT;; |
---|
283 | nowvideo) nowvideo $INPUT;; |
---|
284 | divxstage|cloudtime) divxstage $INPUT;; |
---|
285 | novamov|auroravid) novamov $INPUT;; |
---|
286 | xvidstage) xvidstage $INPUT;; |
---|
287 | waaw|netu|hqq) waaw $INPUT;; |
---|
288 | streamango|streamcherry) streamango $INPUT;; |
---|
289 | redirector|googlevideo|vodcloud|google) directstream "$INPUT";; |
---|
290 | esac |
---|
291 | fi |
---|
292 | |
---|
293 | if [ "$TYPE" == "youtube_dl" ];then |
---|
294 | case $hoster in |
---|
295 | *) youtube_dl $INPUT;; |
---|
296 | esac |
---|
297 | fi |
---|
298 | |
---|
299 | if [ "$TYPE" == "youtube_dlbg" ];then |
---|
300 | case $hoster in |
---|
301 | *) youtube_dlbg $DEST $INPUT;; |
---|
302 | esac |
---|
303 | fi |
---|
304 | |
---|