source: titan/mediathek/localparser_secret/cricfree.sh @ 42464

Last change on this file since 42464 was 42464, checked in by obi, 2 years ago

tithek testfix speedup init localhoster

  • Property svn:executable set to *
File size: 6.9 KB
Line 
1#!/bin/sh
2# first sh box parser for titannit mfg obi
3
4case $2 in
5        init) echo skip load hoster.sh;;
6        *) . /tmp/localhoster/hoster.sh;;
7esac
8
9SRC=$1
10INPUT=$2
11PAGE=$3
12
13URL=http://cricfree.sc/
14PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
15NAME=CricFree
16FILENAME="$PARSER $INPUT $PAGE"
17FILENAME=`echo $FILENAME | tr '&' '.' | tr '/' '.' | tr '?' '.'  | tr '=' '.' | sed 's/ \+/./g' | sed 's/\.\+/./g'`
18
19#rm -rf $TMP > /dev/null 2>&1
20mkdir $TMP > /dev/null 2>&1
21
22if [ `echo $SRC | grep ^"/mnt/parser" | wc -l` -gt 0 ];then
23        TYPE="$SRC - Shell script"
24elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then
25        TYPE="Swap - Shell script"
26elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then
27        TYPE="Mnt - Shell script"
28else
29        TYPE="Flash - Shell script"
30fi
31
32init()
33{
34#       if [ "$ARCH" != "sh4" ] || [ -e /etc/.beta ];then
35                rm -f /mnt/network/cookies > /dev/null 2>&1
36                rm -rf $TMP > /dev/null 2>&1
37                echo "$NAME ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0"
38#       fi
39}
40
41mainmenu()
42{
43        echo "Channels#$SRC $SRC search /#http://atemio.dyndns.tv/mediathek/menu/category.jpg#category.jpg#$NAME#0" > $TMP/$FILENAME.list
44        echo "$TMP/$FILENAME.list"
45}
46
47search()
48{
49        rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
50        rm $TMP/$FILENAME.* > /dev/null 2>&1
51
52        if [ ! -e "$TMP/$FILENAME.list" ]; then
53                piccount=0
54
55                $curlbin $URL/$PAGE -o $TMP/cache.$FILENAME.1
56                cat $TMP/cache.$FILENAME.1 | tr '\n' '\r' |  tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed 's/ \+/ /g' | sed 's!<li class="has-sub">!\n<li class="has-sub">!g' | grep ^'<li class="has-sub">' | sed 's!href=!\n<a href=!g' | grep ^'<a href=' | grep "http://cricfree.sc" | grep -v "/watch/live/" | cut -d '"' -f2 >$TMP/cache.$FILENAME.2
57
58                while read -u 3 ROUND; do
59                        NEWPAGE=`echo $ROUND | cut -d'"' -f1 | sed "s#$URL##"`
60#echo NEWPAGE $NEWPAGE
61#echo URL $URL
62#exit
63                        TITLE=`echo $ROUND | sed 's!http://cricfree.sc/!!' | sed 's!watch/live/!!' | sed 's!-live-stream-2!!' | sed 's!-live-stream!!' | sed 's!-in-streaming!!' | sed 's!-live-streaming-2!!' | sed 's!-live-streaming!!'`
64                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
65
66                        TITLE=`echo $TITLE | sed 's/-/ /g' | sed 's/_/ /g'`
67                        TITLE=`echo $TITLE | sed -e 's/&#038;/&/g' -e 's/&amp;/und/g' -e 's/&quot;/"/g' -e 's/&lt;/\</g' -e 's/&#034;/\"/g' -e 's/&#039;/\"/g' -e 's/#034;/\"/g' -e 's/#039;/\"/g' -e 's/&szlig;/Ãx/g' -e 's/&ndash;/-/g' -e 's/&Auml;/Ã/g' -e 's/&Uuml;/ÃS/g' -e 's/&Ouml;/Ã/g' -e 's/&auml;/ä/g' -e 's/&uuml;/ü/g' -e 's/&ouml;/ö/g' -e 's/&eacute;/é/g' -e 's/&egrave;/è/g' -e 's/%F6/ö/g' -e 's/%FC/ü/g' -e 's/%E4/ä/g' -e 's/%26/&/g' -e 's/%C4/Ã/g' -e 's/%D6/Ã/g' -e 's/%DC/ÃS/g' -e 's/%28/(/g' -e 's/%29/)/g' -e 's/%3A/:/g' -e 's/%40/@/g' -e 's/%2B/&/g' -e 's/%C3/A/g' -e 's/%B1/&/g' -e 's/%5B//g' -e 's/%5D//g' -e 's!%2F!/!g' -e 's/|/ /g' -e 's/(/ /g' -e 's/)/ /g' -e 's/+/ /g' -e 's/\//-/g' -e 's/,/ /g' -e 's/;/ /g' -e 's/:/ /g' -e 's/\.\+/./g'`
68
69                        if [ ! -z "$TITLE" ] && [ ! -z "$URL" ];then
70                                if [ ! -e $TMP/$FILENAME.list ];then
71                                        touch $TMP/$FILENAME.list
72                                fi
73                                piccount=$[$piccount+1]
74#                               LINE="$TITLE#$URL#$PIC#$PARSER_$piccount.jpg#$NAME#92"
75#                               LINE="$TITLE#$SRC $SRC play '$NEWPAGE'#$PIC#$FILENAME.$piccount.jpg#$NAME#111"
76                                LINE="$TITLE#$SRC $SRC play '$NEWPAGE'#$PIC#$FILENAME.$piccount.jpg#$NAME#111"
77
78                                echo "$LINE" >> $TMP/$FILENAME.list
79                        fi
80
81                done 3<$TMP/cache.$FILENAME.2
82#               rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
83        fi
84        echo "$TMP/$FILENAME.list"
85}
86
87play()
88{
89        /tmp/localhoster/hoster.sh get $URL/$PAGE
90}
91
92playold()
93{
94        rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
95        rm $TMP/$FILENAME.* > /dev/null 2>&1
96
97        if [ ! -e "$TMP/$FILENAME.list" ]; then
98                piccount=0
99
100                $curlbin $URL/$PAGE -o $TMP/cache.$FILENAME.1
101                # <iframe frameborder="0" marginheight="0" allowfullscreen="true" marginwidth="0" height="555" src="http://cricfree.sc/update/skys4.php" id="iframe" name="iframe_a" scrolling="no" width="620">Your Browser Do not Support Iframe</iframe>
102                NEWPAGE=`cat $TMP/cache.$FILENAME.1 | grep iframe | grep http | grep allowfullscreen | sed 's/src=/\nfound=/' | grep ^found= | cut -d'"' -f2`
103
104                $curlbin $NEWPAGE -o $TMP/cache.$FILENAME.2
105#               <script type='text/javascript'>id='ss4new'; width='620'; height='490';</script><script type='text/javascript' src='http://soccerschedule.online/livegamecr.js'></script>
106                NEWPAGE=`cat $TMP/cache.$FILENAME.2 | grep javascript | grep id= | sed 's/src=/\nfound=/' | grep ^found= | cut -d"'" -f2`
107                ID=`cat $TMP/cache.$FILENAME.2 | grep javascript | grep id= | sed 's/id=/\nfound=/' | grep ^found= | cut -d"'" -f2`
108                WIDTH=`cat $TMP/cache.$FILENAME.2 | grep javascript | grep id= | sed 's/width=/\nfound=/' | grep ^found= | cut -d"'" -f2`
109                HEIGHT=`cat $TMP/cache.$FILENAME.2 | grep javascript | grep id= | sed 's/height=/\nfound=/' | grep ^found= | cut -d"'" -f2`
110
111#echo NEWPAGE $NEWPAGE
112#echo ID $ID
113#echo WIDTH $WIDTH
114#echo HEIGHT $HEIGHT
115
116                $curlbin --referer $URL/$PAGE $NEWPAGE -o $TMP/cache.$FILENAME.3
117                data="text1=`cat $TMP/cache.$FILENAME.3`"
118
119#echo data $data
120#               $curlbin http://ddecode.com/hexdecoder/ -o $TMP/cache.$FILENAME.3
121                $curlbin -X POST --data "$data" http://ddecode.com/hexdecoder/ -o $TMP/cache.$FILENAME.4
122
123#               "http://soccerschedule.online/cricyes.php?id=ss4new&width=620&height=490&stretching="
124                NEWPAGE="http://soccerschedule.online/cricyes.php?id=$ID&width=$WIDTH&height=$HEIGHT&stretching="
125                $curlbin --referer  $URL/$PAGE $NEWPAGE -o $TMP/cache.$FILENAME.5
126                REFERER=$NEWPAGE
127
128
129#               <script type='text/javascript'>id='241497'; width='100%'; height='100%'; stretching='';</script><script type='text/javascript' src='http://playstream.club/cricyesplayer.js'></script>
130                NEWPAGE=`cat $TMP/cache.$FILENAME.5 | grep javascript | grep id= | sed 's/src=/\nfound=/' | grep ^found= | cut -d"'" -f2`
131                ID=`cat $TMP/cache.$FILENAME.5 | grep javascript | grep id= | sed 's/id=/\nfound=/' | grep ^found= | cut -d"'" -f2`
132                WIDTH=`cat $TMP/cache.$FILENAME.5 | grep javascript | grep id= | sed 's/width=/\nfound=/' | grep ^found= | cut -d"'" -f2`
133                HEIGHT=`cat $TMP/cache.$FILENAME.5 | grep javascript | grep id= | sed 's/height=/\nfound=/' | grep ^found= | cut -d"'" -f2`
134                $curlbin --referer $URL/$PAGE $NEWPAGE -o $TMP/cache.$FILENAME.6
135
136#echo NEWPAGE $NEWPAGE
137#echo ID $ID
138#echo WIDTH $WIDTH
139#echo HEIGHT $HEIGHT
140
141                data="text1=`cat $TMP/cache.$FILENAME.6`"
142
143
144#               echo data $data
145                $curlbin -X POST --data "$data" http://ddecode.com/hexdecoder/ -o $TMP/cache.$FILENAME.7
146
147                NEWPAGE="http://playstream.club/cricyesplayer.php?id=$ID&width=$WIDTH&height=$HEIGHT&stretching="
148                $curlbin --referer  $REFERER $NEWPAGE -o $TMP/cache.$FILENAME.8
149
150
151#       source: "http://178.159.36.7/live/241497.m3u8?wmsAuthSign=c2VydmVyX3RpbWU9Mi8yMi8yMDE3IDU6MDU6MTUgUE0maGFzaF92YWx1ZT1VdUhuZFlKc3N6ZU80czZmSUJ1NEd3PT0mdmFsaWRtaW51dGVzPTI4ODA=&wmsAuthSign2=NTgzZGIxMWJjMGMxOQ==",
152                STREAMURL=`cat $TMP/cache.$FILENAME.8 | grep "source:" | cut -d'"' -f2`
153
154#               rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
155        fi
156        echo "$STREAMURL"
157}
158
159
160case $INPUT in
161        init) $INPUT;;
162        mainmenu) $INPUT;;
163        play) $INPUT;;
164        search) $INPUT;;
165esac
Note: See TracBrowser for help on using the repository browser.