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

Last change on this file since 39023 was 39023, checked in by obi, 7 years ago

fix

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