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; rv:36.0) Gecko/20100101 Firefox/36.0' |
---|
15 | USERAGENT='Mozilla%2F5.0+%28Windows+NT+6.3%3B+rv%3A36.0%29+Gecko%2F20100101+Firefox%2F36.0' |
---|
16 | debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2` |
---|
17 | curlbin="curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A '$USERAGENT'" |
---|
18 | curlbin2="curl -k -s --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A '$USERAGENT'" |
---|
19 | youtubebin="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent '$USERAGENT' --format mp4 --restrict-filenames --ignore-errors -g" |
---|
20 | youtubebinbg="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent '$USERAGENT' --format mp4 --restrict-filenames --ignore-errors --output" |
---|
21 | export PYTHONHOME=/tmp/localhoster |
---|
22 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/localhoster/lib |
---|
23 | |
---|
24 | |
---|
25 | if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi |
---|
26 | if [ "$debuglevel" == "99" ]; then curlbin2="$curlbin2 -v"; fi |
---|
27 | if [ "$debuglevel" == "99" ]; then youtubebin="$youtubebin --verbose"; fi |
---|
28 | |
---|
29 | wgetbin="wget -q -T2" |
---|
30 | |
---|
31 | BIN="$CMD"/bin/python."$ARCH" |
---|
32 | |
---|
33 | if [ ! -e "/tmp/localhoster/lib/python2.7/lib-dynload" ] && [ -e /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" ];then |
---|
34 | # ln -fs /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload |
---|
35 | mv -f /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload |
---|
36 | rm -rf /tmp/localhoster/lib/python2.7/lib-dynload.* |
---|
37 | fi |
---|
38 | if [ ! -e "/tmp/localhoster/lib/libpython2.7.so.1.0" ] && [ -e /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" ];then |
---|
39 | # ln -fs /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0 |
---|
40 | mv -f /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0 |
---|
41 | rm -f /tmp/localhoster/lib/libpython2.7.so.1.0.* |
---|
42 | fi |
---|
43 | if [ ! -e "/tmp/localhoster/lib/libcrypto.so.1.0.0" ] && [ -e /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" ];then |
---|
44 | # ln -fs /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" /tmp/localhoster/lib/libcrypto.so.1.0.0 |
---|
45 | mv -f /tmp/localhoster/lib/libcrypto.so.1.0.0."$ARCH" /tmp/localhoster/lib/libcrypto.so.1.0.0 |
---|
46 | rm -f /tmp/localhoster/lib/libcrypto.so.1.0.0.* |
---|
47 | fi |
---|
48 | if [ ! -e "/tmp/localhoster/lib/libssl.so.1.0.0" ] && [ -e /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" ];then |
---|
49 | # ln -fs /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" /tmp/localhoster/lib/llibssl.so.1.0.0 |
---|
50 | mv -f /tmp/localhoster/lib/libssl.so.1.0.0."$ARCH" /tmp/localhoster/lib/libssl.so.1.0.0 |
---|
51 | rm -f /tmp/localhoster/lib/libssl.so.1.0.0.* |
---|
52 | fi |
---|
53 | |
---|
54 | if [ -e "$TMP/hoster.tar" ]; then rm -f $TMP/hoster.tar; fi |
---|
55 | if [ -e "$TMP/parser.tar" ]; then rm -f $TMP/parser.tar; fi |
---|
56 | |
---|
57 | if [ "$ARCH" == "sh4" ] && [ "$BOX" != "ufs912" ]; then |
---|
58 | if [ -e "$CMD/lib/python2.7/lib-dynload.mipsel" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.mipsel; fi |
---|
59 | if [ -e "$CMD/lib/python2.7/lib-dynload.arm" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.arm; fi |
---|
60 | |
---|
61 | if [ -e "$CMD/lib/libpython2.7.so.1.0.mipsel" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.mipsel; fi |
---|
62 | if [ -e "$CMD/lib/libpython2.7.so.1.0.arm" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.arm; fi |
---|
63 | |
---|
64 | if [ -e "$CMD/lib/libssl.so.1.0.0.mipsel" ]; then rm -rf $CMD/lib/libssl.so.1.0.0.mipsel; fi |
---|
65 | if [ -e "$CMD/lib/libssl.so.1.0.0.arm" ]; then rm -rf $CMD/lib/libssl.so.1.0.0.arm; fi |
---|
66 | |
---|
67 | if [ -e "$CMD/lib/libcrypto.so.1.0.0.mipsel" ]; then rm -rf $CMD/lib/libcrypto.so.1.0.0.mipsel; fi |
---|
68 | if [ -e "$CMD/lib/libcrypto.so.1.0.0.arm" ]; then rm -rf $CMD/lib/libcrypto.so.1.0.0.arm; fi |
---|
69 | fi |
---|
70 | |
---|
71 | hostercheck=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | tr '.' '\n' | wc -l` |
---|
72 | hosterline=`expr $hostercheck - 1` |
---|
73 | hoster=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | cut -d"." -f$hosterline` |
---|
74 | #echo $hoster |
---|
75 | |
---|
76 | ecostream() |
---|
77 | { |
---|
78 | hosterurl=http://www.ecostream.tv |
---|
79 | 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`" |
---|
80 | streampage=`$curlbin $hosterurl/js/ecoss.js | grep "$.post('" | grep videos | cut -d"'" -f2` |
---|
81 | streamurl=$hosterurl`$curlbin -H "X-Requested-With: XMLHttpRequest" -X POST --data "$data" --referer $INPUT $hosterurl/$streampage | cut -d'"' -f6` |
---|
82 | if [ "`echo $streamurl | grep DOCTYPE | wc -l`" -eq 0 ] && [ "$streamurl" != "$hosterurl" ];then |
---|
83 | echo $streamurl |
---|
84 | fi |
---|
85 | } |
---|
86 | |
---|
87 | giga() |
---|
88 | { |
---|
89 | streampage=`$curlbin $INPUT | grep "<iframe src=" | cut -d'"' -f2 | head -n1` |
---|
90 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 1080p` |
---|
91 | if [ -z "$streamurl" ];then |
---|
92 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 720p` |
---|
93 | fi |
---|
94 | if [ -z "$streamurl" ];then |
---|
95 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 480p` |
---|
96 | fi |
---|
97 | if [ -z "$streamurl" ];then |
---|
98 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 360p` |
---|
99 | fi |
---|
100 | if [ -z "$streamurl" ];then |
---|
101 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 240p` |
---|
102 | fi |
---|
103 | if [ -z "$streamurl" ];then |
---|
104 | streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 180p` |
---|
105 | fi |
---|
106 | echo $streamurl |
---|
107 | } |
---|
108 | |
---|
109 | vidup() |
---|
110 | { |
---|
111 | $BIN $CMD/vidup.py $INPUT |
---|
112 | } |
---|
113 | |
---|
114 | nosvideo() |
---|
115 | { |
---|
116 | $BIN $CMD/nosvideo.py $INPUT |
---|
117 | } |
---|
118 | |
---|
119 | allmyvideos() |
---|
120 | { |
---|
121 | $BIN $CMD/allmyvideos.py $INPUT |
---|
122 | } |
---|
123 | |
---|
124 | flashx() |
---|
125 | { |
---|
126 | $BIN $CMD/flashx.py $INPUT |
---|
127 | } |
---|
128 | |
---|
129 | openload() |
---|
130 | { |
---|
131 | $BIN $CMD/openload.py $INPUT |
---|
132 | } |
---|
133 | |
---|
134 | briskfile() |
---|
135 | { |
---|
136 | $BIN $CMD/briskfile.py $INPUT |
---|
137 | } |
---|
138 | |
---|
139 | vodlocker() |
---|
140 | { |
---|
141 | $BIN $CMD/vodlocker.py $INPUT |
---|
142 | } |
---|
143 | |
---|
144 | videoweed() |
---|
145 | { |
---|
146 | $BIN $CMD/videoweed.py $INPUT |
---|
147 | } |
---|
148 | |
---|
149 | vodzi() |
---|
150 | { |
---|
151 | $BIN $CMD/vodzi.py $INPUT |
---|
152 | } |
---|
153 | |
---|
154 | youwatch() |
---|
155 | { |
---|
156 | $BIN $CMD/youwatch.py $INPUT |
---|
157 | } |
---|
158 | |
---|
159 | thevideo() |
---|
160 | { |
---|
161 | $BIN $CMD/thevideo.py $INPUT |
---|
162 | } |
---|
163 | |
---|
164 | movshare() |
---|
165 | { |
---|
166 | $BIN $CMD/movshare.py $INPUT |
---|
167 | } |
---|
168 | |
---|
169 | streamcloud() |
---|
170 | { |
---|
171 | $BIN $CMD/streamcloud.py $INPUT |
---|
172 | } |
---|
173 | |
---|
174 | vidzi() |
---|
175 | { |
---|
176 | $BIN $CMD/vidzi.py $INPUT |
---|
177 | } |
---|
178 | |
---|
179 | vivo() |
---|
180 | { |
---|
181 | $BIN $CMD/vivo.py $INPUT |
---|
182 | } |
---|
183 | |
---|
184 | vidto() |
---|
185 | { |
---|
186 | $BIN $CMD/vidto.py $INPUT |
---|
187 | } |
---|
188 | |
---|
189 | goldesel() |
---|
190 | { |
---|
191 | $BIN $CMD/goldesel.py $INPUT |
---|
192 | } |
---|
193 | |
---|
194 | cloudflare() |
---|
195 | { |
---|
196 | $BIN $CMD/cloudflare.py $INPUT |
---|
197 | } |
---|
198 | |
---|
199 | nowvideo() |
---|
200 | { |
---|
201 | $BIN $CMD/nowvideo.py $INPUT |
---|
202 | } |
---|
203 | |
---|
204 | divxstage() |
---|
205 | { |
---|
206 | $BIN $CMD/divxstage.py $INPUT |
---|
207 | } |
---|
208 | |
---|
209 | novamov() |
---|
210 | { |
---|
211 | $BIN $CMD/novamov.py $INPUT |
---|
212 | } |
---|
213 | |
---|
214 | xvidstage() |
---|
215 | { |
---|
216 | $BIN $CMD/xvidstage.py $INPUT |
---|
217 | } |
---|
218 | |
---|
219 | waaw() |
---|
220 | { |
---|
221 | $BIN $CMD/waaw.py $INPUT |
---|
222 | } |
---|
223 | |
---|
224 | streamango() |
---|
225 | { |
---|
226 | $BIN $CMD/streamango.py $INPUT |
---|
227 | } |
---|
228 | |
---|
229 | vidlox() |
---|
230 | { |
---|
231 | $BIN $CMD/vidlox.py $INPUT |
---|
232 | } |
---|
233 | |
---|
234 | aliezold() |
---|
235 | { |
---|
236 | URL=`$curlbin "$INPUT" | sed 's/source:/\nsource:/' | grep ^source: | cut -d"'" -f2` |
---|
237 | REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'` |
---|
238 | echo "$URL|Referer=$REFERER&User-Agent=$USERAGENT" |
---|
239 | } |
---|
240 | |
---|
241 | aliez() |
---|
242 | { |
---|
243 | #http://emb.aliez.me/player/live.php?id=56180&w=700&h=480" |
---|
244 | $curlbin "$INPUT" -o $TMP/cache.$hoster.1 |
---|
245 | cat $TMP/cache.$hoster.1 | sed 's/source:/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.$hoster.url1 |
---|
246 | URL=`cat $TMP/cache.$hoster.url1 | head -n1` |
---|
247 | |
---|
248 | #URL="" |
---|
249 | #"file": "rtmp%3A%2F%2Fa3.aliez.me%2Flive%2Fstreama57449%3Ftoken%3Dd11304fabb8e64327df8427e1c2fd5d9" |
---|
250 | if [ -z "$URL" ];then |
---|
251 | cat $TMP/cache.$hoster.1 | sed 's/"file":/\nfound=/' | grep ^found= | cut -d'"' -f2 >$TMP/cache.$hoster.url3 |
---|
252 | URL=`cat $TMP/cache.$hoster.url3 | head -n1` |
---|
253 | fi |
---|
254 | REFERER=`echo "$INPUT" | sed -e 's/=/%3D/g' -e 's/&/%26/g'` |
---|
255 | EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT" |
---|
256 | |
---|
257 | if [ "`echo $URL | grep rtmp | wc -l`" -eq 1 ];then |
---|
258 | |
---|
259 | #new swfobject.embedSWF("http://i.aliez.me/swf/playernew.swf?0", "mediaspace", "700", "480", "9.0.115.0", false, flashvars, params); |
---|
260 | cat $TMP/cache.$hoster.1 | sed 's/swfobject.embedSWF/\nfound=/' | grep ^found= | cut -d'"' -f2 >$TMP/cache.$hoster.rtmp.swfurl |
---|
261 | SWFURL=`cat $TMP/cache.$hoster.rtmp.swfurl | head -n1` |
---|
262 | URL=`echo "$URL" | sed -e 's/%3A/:/g' -e 's!%2F!/!g' -e 's!%3D!=!g' -e 's!%3F!?!g'` |
---|
263 | EXTRA=" pageUrl=$REFERER" |
---|
264 | if [ ! -z "$SWFURL" ];then |
---|
265 | EXTRA="$EXTRA swfUrl=$SWFURL swfVfy=1 timeout=15 live=1" |
---|
266 | fi |
---|
267 | fi |
---|
268 | |
---|
269 | # URL="" |
---|
270 | #file: 'http://a3.aliez.me:8080/hls/streama57449/index.m3u8?st=dgw2dOq8tyFkLLBLn2ycXA', |
---|
271 | if [ -z "$URL" ];then |
---|
272 | cat $TMP/cache.$hoster.1 | sed 's/file:/\nfound=/' | grep ^found= | cut -d"'" -f2 >$TMP/cache.$hoster.url2 |
---|
273 | URL=`cat $TMP/cache.$hoster.url2 | head -n1` |
---|
274 | EXTRA="|Referer=$REFERER&User-Agent=$USERAGENT" |
---|
275 | fi |
---|
276 | |
---|
277 | echo "$URL$EXTRA" |
---|
278 | # echo "$URL|If-None-Match=5a1842ad-c4&Accept=*/*&Referer=$REFERER&User-Agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36" |
---|
279 | |
---|
280 | |
---|
281 | } |
---|
282 | |
---|
283 | sport7() |
---|
284 | { |
---|
285 | #http://sport7.tech/487b826914d11080dce4b502052b012d-live.html |
---|
286 | #var videoLink = 'http://g4.securestream.sport7.tech/stream/NzYyZDUwZWNkODc5YWM5YjViY2ZkOTVhZGNjOGM1ZTc=/BTSport3.m3u8'; |
---|
287 | |
---|
288 | URL=`$curlbin "$INPUT" | sed 's/var videoLink/\nfound=/' | grep ^found= | cut -d"'" -f2` |
---|
289 | REFERER=`echo "$INPUT" | sed -e 's/=/3D/g' -e 's/&/26/g'` |
---|
290 | sed 's/#HttpOnly_//g' -i /mnt/network/cookies |
---|
291 | echo "$URL|Referer=$REFERER&X-f=95.91.79.87&User-Agent=$USERAGENT" |
---|
292 | } |
---|
293 | |
---|
294 | |
---|
295 | directstream() |
---|
296 | { |
---|
297 | echo "$INPUT" |
---|
298 | # rm -f /tmp/_last_hoster_* > /dev/null 2>&1 |
---|
299 | echo "$INPUT" > /tmp/.last_hoster_$hoster.log |
---|
300 | } |
---|
301 | |
---|
302 | youtube_dl() |
---|
303 | { |
---|
304 | # echo "$BIN $youtubebin $INPUT" > /tmp/.last_hoster_youtube_dl.log |
---|
305 | # $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 |
---|
306 | # cat /tmp/youtube_dl.streamlink.log | tail -n1 |
---|
307 | $BIN $youtubebin "$INPUT" |
---|
308 | } |
---|
309 | |
---|
310 | youtube_dlbg() |
---|
311 | { |
---|
312 | # echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_youtube_dlbg.log |
---|
313 | # 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"` |
---|
314 | # echo "$URL" >> /tmp/.last_hoster_youtube_dlbg.log |
---|
315 | # echo $URL |
---|
316 | $BIN $youtubebinbg $DEST $INPUT |
---|
317 | } |
---|
318 | |
---|
319 | if [ "$TYPE" == "get" ];then |
---|
320 | echo "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log |
---|
321 | case $hoster in |
---|
322 | ecostream) ecostream $INPUT;; |
---|
323 | giga) giga $INPUT;; |
---|
324 | nosvideo) nosvideo $INPUT;; |
---|
325 | allmyvideos) allmyvideos $INPUT;; |
---|
326 | flashx) flashx $INPUT;; |
---|
327 | openload|oload) openload $INPUT;; |
---|
328 | briskfile) briskfile $INPUT;; |
---|
329 | videoweed|bitvid) videoweed $INPUT;; |
---|
330 | vodlocker) vodlocker $INPUT;; |
---|
331 | youwatch|chouhaa|ay8ou8ohth) youwatch $INPUT;; |
---|
332 | thevideo) thevideo $INPUT;; |
---|
333 | movshare|wholecloud|vidgg) movshare $INPUT;; |
---|
334 | vidto) vidto $INPUT;; |
---|
335 | vidup) vidup $INPUT;; |
---|
336 | vidzi) vidzi $INPUT;; |
---|
337 | vivo) vivo $INPUT;; |
---|
338 | goldesel|movie4k) cloudflare $INPUT;; |
---|
339 | streamcloud1) streamcloud $INPUT;; |
---|
340 | nowvideo) nowvideo $INPUT;; |
---|
341 | divxstage|cloudtime) divxstage $INPUT;; |
---|
342 | novamov|auroravid) novamov $INPUT;; |
---|
343 | xvidstage) xvidstage $INPUT;; |
---|
344 | waaw|netu|hqq) waaw $INPUT;; |
---|
345 | streamango|streamcherry) streamango $INPUT;; |
---|
346 | vidlox) vidlox $INPUT;; |
---|
347 | redirector|googlevideo|vodcloud|google) directstream "$INPUT";; |
---|
348 | aliez) aliez $INPUT;; |
---|
349 | sport7) sport7 $INPUT;; |
---|
350 | esac |
---|
351 | fi |
---|
352 | |
---|
353 | if [ "$TYPE" == "youtube_dl" ];then |
---|
354 | echo "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log |
---|
355 | case $hoster in |
---|
356 | *) youtube_dl $INPUT;; |
---|
357 | esac |
---|
358 | fi |
---|
359 | |
---|
360 | if [ "$TYPE" == "youtube_dlbg" ];then |
---|
361 | echo "$INPUT" > /tmp/.last_hoster_$TYPE_$hoster.log |
---|
362 | case $hoster in |
---|
363 | *) youtube_dlbg $DEST $INPUT;; |
---|
364 | esac |
---|
365 | fi |
---|
366 | |
---|