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

Last change on this file since 39028 was 39028, checked in by obi, 6 years ago

fix

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