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

Last change on this file since 39001 was 39001, checked in by obi, 4 years ago

localhoster add sh4 python stuff

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