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

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

fix giga

  • Property svn:executable set to *
File size: 2.1 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
13
14hoster=`echo $INPUT | tr 'A-Z' 'a-z' | sed 's!http://!!' | sed 's!https://!!' | cut -d'/' -f1 | sed 's/www.//' | tr '.' '\n' | head -n1`
15
16debuglevel=`cat /mnt/config/titan.cfg | grep debuglevel | cut -d"=" -f2`
17curlbin='curl -k -s -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies'
18if [ "$debuglevel" == "99" ]; then curlbin="$curlbin -v"; fi
19
20ecostream()
21{
22        hosterurl=http://www.ecostream.tv
23        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`"
24        streampage=`$curlbin $hosterurl/js/ecoss.js | grep "$.post('" | grep videos | cut -d"'" -f2`
25        streamurl=$hosterurl`$curlbin -H "X-Requested-With: XMLHttpRequest" -X POST --data "$data" --referer $INPUT $hosterurl/$streampage | cut -d'"' -f6`
26        if [ "$streamurl" != "$hosterurl" ];then
27                echo $streamurl
28        fi
29}
30
31giga()
32{
33        streampage=`$curlbin $INPUT | grep "<iframe src=" | cut -d'"' -f2 | head -n1`
34        streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 1080p`
35        if [ -z "$streamurl" ];then
36                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 720p`
37        fi
38        if [ -z "$streamurl" ];then
39                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 480p`
40        fi
41        if [ -z "$streamurl" ];then
42                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 360p`
43        fi
44        if [ -z "$streamurl" ];then
45                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 240p`
46        fi
47        if [ -z "$streamurl" ];then
48                streamurl=`$curlbin $streampage | grep '{file:' | cut -d'"' -f2 | grep 180p`
49        fi
50        echo $streamurl
51}
52
53if [ "$TYPE" == "get" ];then
54        case $hoster in
55                ecostream) ecostream $INPUT;;
56                giga) giga $INPUT;;
57        esac
58fi
Note: See TracBrowser for help on using the repository browser.