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

Last change on this file since 40904 was 40904, checked in by obi, 5 years ago

enable openload pyhoster

  • Property svn:executable set to *
File size: 8.9 KB
RevLine 
[39002]1#!/bin/sh
2# first sh box hoster for titannit mfg obi
3
4TYPE=$1
5INPUT=$2
[40846]6DEST=$3
[39002]7
[39362]8INPUT=`echo $INPUT | sed 's!/Out/?s=!!g'`
9
[39002]10ARCH=`cat /etc/.arch`
[39030]11BOX=`cat /etc/model`
[40108]12TMP=/tmp/localcache
13CMD=/tmp/localhoster
[40086]14USERAGENT='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'
[39002]15debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
[40086]16curlbin="curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies -A $USERAGENT"
[39391]17curlbin2='curl -k -s --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies'
[40404]18youtubebin="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent '$USERAGENT' --format mp4 --restrict-filenames --ignore-errors -g"
[40852]19youtubebinbg="$CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent '$USERAGENT' --format mp4 --restrict-filenames --ignore-errors --output"
[40853]20export PYTHONHOME=/tmp/localhoster
21export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/localhoster/lib
[40108]22
[39002]23if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
[39622]24if [ "$debuglevel" == "99" ]; then curlbin2="$curlbin2 -v"; fi
[40111]25#if [ "$debuglevel" == "99" ]; then youtubebin="$youtubebin --verbose"; fi
[40108]26
[39002]27wgetbin="wget -q -T2"
28
[39030]29BIN="$CMD"/bin/python."$ARCH"
[40100]30
[40124]31if [ ! -e "/tmp/localhoster/lib/python2.7/lib-dynload" ] && [ -e /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" ];then
[40242]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.*
[40100]35fi
[40675]36if [ ! -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.*
40fi
[40663]41if [ ! -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.*
[40100]45fi
[40663]46if [ ! -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.*
50fi
51
[39030]52if [ -e "$TMP/hoster.tar" ]; then rm -f $TMP/hoster.tar; fi
53if [ -e "$TMP/parser.tar" ]; then rm -f $TMP/parser.tar; fi
54
55if [ "$ARCH" == "sh4" ] && [ "$BOX" != "ufs912" ]; then
[39124]56        if [ -e "$CMD/lib/python2.7/lib-dynload.mipsel" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.mipsel; fi
[40663]57        if [ -e "$CMD/lib/python2.7/lib-dynload.arm" ]; then rm -rf $CMD/lib/python2.7/lib-dynload.arm; fi
58
[39124]59        if [ -e "$CMD/lib/libpython2.7.so.1.0.mipsel" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.mipsel; fi
[40122]60        if [ -e "$CMD/lib/libpython2.7.so.1.0.arm" ]; then rm -rf $CMD/lib/libpython2.7.so.1.0.arm; fi
[40663]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
[39030]67fi
68
[40069]69hostercheck=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | tr '.' '\n' | wc -l`
70hosterline=`expr $hostercheck - 1`
71hoster=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!://!\n!' | cut -d'/' -f1 | tail -n1 | cut -d"." -f$hosterline`
72#echo $hoster
[39002]73
74debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
75curlbin='curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies'
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`
[39633]84        if [ "`echo $streamurl | grep DOCTYPE | wc -l`" -eq 0 ] && [ "$streamurl" != "$hosterurl" ];then
[39002]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
[39037]136briskfile()
137{
138        $BIN $CMD/briskfile.py $INPUT
139}
140
[39052]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
[39219]161thevideo()
162{
163        $BIN $CMD/thevideo.py $INPUT
164}
165
[39232]166movshare()
167{
168        $BIN $CMD/movshare.py $INPUT
169}
170
171streamcloud()
172{
173        $BIN $CMD/streamcloud.py $INPUT
174}
175
[39354]176vidzi()
177{
178        $BIN $CMD/vidzi.py $INPUT
179}
180
[39355]181vivo()
182{
183        $BIN $CMD/vivo.py $INPUT
184}
185
[39358]186vidto()
187{
188        $BIN $CMD/vidto.py $INPUT
189}
190
[39387]191goldesel()
192{
193        $BIN $CMD/goldesel.py $INPUT
194}
[39358]195
[39520]196cloudflare()
197{
198        $BIN $CMD/cloudflare.py $INPUT
199}
200
[39580]201nowvideo()
202{
203        $BIN $CMD/nowvideo.py $INPUT
204}
205
[39608]206divxstage()
207{
208        $BIN $CMD/divxstage.py $INPUT
209}
210
[39650]211novamov()
212{
213        $BIN $CMD/novamov.py $INPUT
214}
[39608]215
[40036]216xvidstage()
217{
218        $BIN $CMD/xvidstage.py $INPUT
219}
220
[40063]221directstream()
[40051]222{
223        echo "$INPUT"
[40097]224#       rm -f /tmp/_last_hoster_* > /dev/null 2>&1
[40134]225        echo  "$INPUT" > /tmp/.last_hoster_$hoster.log
[40051]226}
227
[40094]228youtube_dl()
229{
[40097]230#       rm -f /tmp/_last_hoster_* > /dev/null 2>&1
[40404]231        echo "$BIN $youtubebin $INPUT" > /tmp/.last_hoster_youtube_dl.log
[40112]232#       $BIN $youtubebin "$INPUT"
[40318]233#       $BIN $CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent "$USERAGENT" --all-formats -g "$INPUT"
[40853]234#       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"`
235#       echo "$URL" >> /tmp/.last_hoster_youtube_dl.log
[40855]236#       echo $URL
[40853]237
[40855]238        $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
239        cat /tmp/youtube_dl.streamlink.log | tail -n1
[40094]240}
241
[40846]242youtube_dlbg()
243{
244#       rm -f /tmp/_last_hoster_* > /dev/null 2>&1
[40852]245        echo "$BIN $youtubebinbg $DEST $INPUT" > /tmp/.last_hoster_youtube_dlbg.log
[40846]246#       $BIN $youtubebin "$INPUT"
247#       $BIN $CMD/lib/youtube_dl/__main__.py --no-check-certificate --cookies /mnt/network/cookies --user-agent "$USERAGENT" --all-formats -g "$INPUT"
[40852]248        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"`
[40846]249        echo "$URL" >> /tmp/.last_hoster_youtube_dlbg.log
250        echo $URL
251}
[39002]252if [ "$TYPE" == "get" ];then
[40134]253        echo  "$INPUT" > /tmp/.last_hoster_$hoster.log
[39002]254        case $hoster in
255                ecostream) ecostream $INPUT;;
256                giga) giga $INPUT;;
257                nosvideo) nosvideo $INPUT;;
258                allmyvideos) allmyvideos $INPUT;;
259                flashx) flashx $INPUT;;
[40904]260                openload) openload $INPUT;;
[39037]261                briskfile) briskfile $INPUT;;
[39650]262                videoweed|bitvid) videoweed $INPUT;;
[39052]263                vodlocker) vodlocker $INPUT;;
[39652]264                youwatch|chouhaa|ay8ou8ohth) youwatch $INPUT;;
[39219]265                thevideo) thevideo $INPUT;;
[39650]266                movshare|wholecloud|vidgg) movshare $INPUT;;
267                vidto) vidto $INPUT;;
268                vidup) vidup $INPUT;;
[39354]269                vidzi) vidzi $INPUT;;
[39355]270                vivo) vivo $INPUT;;
[39650]271                goldesel|movie4k) cloudflare $INPUT;;
[39267]272                streamcloud1) streamcloud $INPUT;;     
[39580]273                nowvideo) nowvideo $INPUT;;
[39650]274                divxstage|cloudtime) divxstage $INPUT;;
275                novamov|auroravid) novamov $INPUT;;
[40038]276                xvidstage) xvidstage $INPUT;;
[40077]277                redirector|googlevideo|vodcloud|google) directstream "$INPUT";;
[39002]278        esac
[40094]279fi
280
281if [ "$TYPE" == "youtube_dl" ];then
282        case $hoster in
283                *) youtube_dl $INPUT;;
284        esac
285fi
[40846]286
287if [ "$TYPE" == "youtube_dlbg" ];then
288        case $hoster in
[40852]289                *) youtube_dlbg $DEST $INPUT;;
[40846]290        esac
291fi
[40854]292
Note: See TracBrowser for help on using the repository browser.