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

Last change on this file since 38989 was 38985, checked in by obi, 8 years ago

localhoster add allmyvideos

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