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

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

fix streamlive

  • Property svn:executable set to *
File size: 3.7 KB
Line 
1#!/bin/sh
2# first sh box parser for titannit mfg obi
3
4SRC=$1
5INPUT=$2
6FROM=$3
7PAGE=$4
8FILENAME=`echo $PAGE | tr '/' '.'`
9if [ -z "$PAGE" ]; then
10        FILENAME=none
11fi
12
13ARCH=`cat /etc/.arch`
14URL=http://cricfree.sx/
15PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
16NAME=CricFree
17
18curlbin='curl -k -s -v -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies'
19#useragent="Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Maxthon/4.4.7.3000 Chrome/30.0.1599.101 Safari/537.36"
20
21wgetbin="wget -q -T2"
22TMP=/tmp/parser
23#TMP=/mnt/parser/tmp
24#TMP=/var/usr/local/share/titan/plugins/tithek/parser/tmp
25
26#rm -rf $TMP > /dev/null 2>&1
27mkdir $TMP > /dev/null 2>&1
28
29if [ `echo $SRC | grep ^"/mnt/parser" | wc -l` -gt 0 ];then
30        TYPE="$SRC - Shell script"
31elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then
32        TYPE="Swap - Shell script"
33elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then
34        TYPE="Mnt - Shell script"
35else
36        TYPE="Flash - Shell script"
37fi
38
39init()
40{
41        if [ "$ARCH" != "sh4" ];then
42                rm -f /mnt/network/cookies > /dev/null 2>&1
43                rm -rf $TMP > /dev/null 2>&1
44                echo "$NAME ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0"
45        fi
46}
47
48mainmenu()
49{
50        echo "Category#$SRC $SRC category#http://atemio.dyndns.tv/mediathek/menu/categoty.jpg#categoty.jpg#$NAME#0" > $TMP/$PARSER.$INPUT.list
51        echo "$TMP/$PARSER.$INPUT.list"
52}
53
54category()
55{
56        echo "Channels#$SRC $SRC list channels /#http://atemio.dyndns.tv/mediathek/menu/categoty.jpg#categoty.jpg#$NAME#0" > $TMP/$PARSER.$INPUT.list
57        echo "$TMP/$PARSER.$INPUT.list"
58}
59
60list()
61{
62        if [ ! -e "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list" ]; then
63                piccount=0
64
65                $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$FROM.$FILENAME.1
66                cat $TMP/cache.$PARSER.$FROM.$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.sx" | grep -v "/watch/live/" | cut -d '"' -f2 >$TMP/cache.$PARSER.$FROM.$FILENAME.2
67
68                while read -u 3 ROUND; do
69
70                        URL=`echo $ROUND | cut -d'"' -f1`
71                        TITLE=`echo $ROUND | sed 's!http://cricfree.sx/!!' | 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!!'`
72                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
73               
74                        TITLE=`echo $TITLE | sed 's/-/ /g' | sed 's/_/ /g'`
75                        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'`
76
77                        if [ ! -z "$TITLE" ] && [ ! -z "$URL" ];then
78                                if [ ! -e $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list ];then
79                                        touch $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
80                                fi
81                                piccount=$[$piccount+1]
82                                LINE="$TITLE#$URL#$PIC#$PARSER_$piccount.jpg#$NAME#92"
83                                echo "$LINE" >> $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
84                        fi
85       
86                done 3<$TMP/cache.$PARSER.$FROM.$FILENAME.2
87                rm $TMP/cache.* > /dev/null 2>&1
88        fi
89        echo "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list"
90}
91
92case $INPUT in
93        init) $INPUT;;
94        mainmenu) $INPUT;;
95        category) $INPUT;;
96        list) $INPUT;;
97esac
Note: See TracBrowser for help on using the repository browser.