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

Last change on this file since 39037 was 39037, checked in by obi, 3 years ago

tithek add Briskfile hoster

  • Property svn:executable set to *
File size: 3.2 KB
Line 
1#!/bin/sh
2# first sh box hoster for titannit mfg obi
3
4TYPE=$1
5INPUT=$2
6
7ARCH=`cat /etc/.arch`
8BOX=`cat /etc/model`
9debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
10curlbin='curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies'
11if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
12wgetbin="wget -q -T2"
13TMP=/tmp/localcache
14CMD=/tmp/localhoster
15
16BIN="$CMD"/bin/python."$ARCH"
17ln -fs /tmp/localhoster/lib/python2.7/lib-dynload."$ARCH" /tmp/localhoster/lib/python2.7/lib-dynload
18ln -fs /tmp/localhoster/lib/libpython2.7.so.1.0."$ARCH" /tmp/localhoster/lib/libpython2.7.so.1.0
19export PYTHONHOME=/tmp/localhoster
20export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/localhoster/lib
21
22if [ -e "$TMP/hoster.tar" ]; then rm -f $TMP/hoster.tar; fi
23if [ -e "$TMP/parser.tar" ]; then rm -f $TMP/parser.tar; fi
24
25if [ "$ARCH" == "sh4" ] && [ "$BOX" != "ufs912" ]; then
26        if [ -e "$CMD/lib/python2.7/lib-dynload.mipsel" ]; then rm -f $CMD/lib/python2.7/lib-dynload.mipsel; fi
27        if [ -e "$CMD/lib/libpython2.7.so.1.0.mipsel" ]; then rm -f $CMD/lib/libpython2.7.so.1.0.mipsel; fi
28fi
29
30hoster=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!http://!!' | sed 's!https://!!' | cut -d'/' -f1 | sed 's/www.//' | tr '.' '\n' | head -n1`
31
32debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
33curlbin='curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies'
34if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
35
36ecostream()
37{
38        hosterurl=http://www.ecostream.tv
39        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`"
40        streampage=`$curlbin $hosterurl/js/ecoss.js | grep "$.post('" | grep videos | cut -d"'" -f2`
41        streamurl=$hosterurl`$curlbin -H "X-Requested-With: XMLHttpRequest" -X POST --data "$data" --referer $INPUT $hosterurl/$streampage | cut -d'"' -f6`
42        if [ "$streamurl" != "$hosterurl" ];then
43                echo $streamurl
44        fi
45}
46
47giga()
48{
49        streampage=`$curlbin $INPUT | grep "<iframe src=" | cut -d'"' -f2 | head -n1`
50        streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 1080p`
51        if [ -z "$streamurl" ];then
52                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 720p`
53        fi
54        if [ -z "$streamurl" ];then
55                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 480p`
56        fi
57        if [ -z "$streamurl" ];then
58                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 360p`
59        fi
60        if [ -z "$streamurl" ];then
61                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 240p`
62        fi
63        if [ -z "$streamurl" ];then
64                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 180p`
65        fi
66        echo $streamurl
67}
68
69vidup()
70{
71        $BIN $CMD/vidup.py $INPUT
72}
73
74nosvideo()
75{
76        $BIN $CMD/nosvideo.py $INPUT
77}
78
79allmyvideos()
80{
81        $BIN $CMD/allmyvideos.py $INPUT
82}
83
84flashx()
85{
86        $BIN $CMD/flashx.py $INPUT
87}
88
89openload()
90{
91        $BIN $CMD/openload.py $INPUT
92}
93
94briskfile()
95{
96        $BIN $CMD/briskfile.py $INPUT
97}
98
99echo INPUT $INPUT
100if [ "$TYPE" == "get" ];then
101        case $hoster in
102                ecostream) ecostream $INPUT;;
103                giga) giga $INPUT;;
104                vidup) vidup $INPUT;;
105                nosvideo) nosvideo $INPUT;;
106                allmyvideos) allmyvideos $INPUT;;
107                flashx) flashx $INPUT;;
108                openload) openload $INPUT;;
109                briskfile) briskfile $INPUT;;
110        esac
111fi
Note: See TracBrowser for help on using the repository browser.