source: titan/mediathek/localparser_secret/goldesel.sh @ 39231

Last change on this file since 39231 was 39184, checked in by obi, 8 years ago

next

  • Property svn:executable set to *
File size: 6.4 KB
Line 
1#!/bin/sh
2# first sh box parser for titannit mfg obi
3
4. /tmp/localhoster/hoster.sh
5
6SRC=$1
7INPUT=$2
8PAGE=$3
9
10FILENAME=`echo $PAGE | tr '/' '.'`
11FILENAME=`echo $FILENAME | tr '&' '.'`
12
13if [ -z "$PAGE" ]; then
14        FILENAME=none
15fi
16
17URL=http://goldesel.to
18PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
19NAME=Goldesel
20
21mkdir $TMP > /dev/null 2>&1
22
23if [ `echo $SRC | grep ^"/mnt/parser" | wc -l` -gt 0 ];then
24        TYPE="$SRC - Shell script"
25elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then
26        TYPE="Swap - Shell script"
27elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then
28        TYPE="Mnt - Shell script"
29else
30        TYPE="Flash - Shell script"
31fi
32
33init()
34{
35        rm -rf $TMP > /dev/null 2>&1
36        echo "$NAME ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0"
37}
38
39mainmenu()
40{
41        echo "Category#$SRC $SRC category#http://atemio.dyndns.tv/mediathek/menu/category.jpg#category.jpg#$NAME#0" > $TMP/$PARSER.$INPUT.list
42        echo "$TMP/$PARSER.$INPUT.list"
43}
44
45category()
46{
47    echo "Kinofilme#$SRC $SRC new '/'#http://atemio.dyndns.tv/mediathek/menu/all-newfirst.jpg#all-newfirst.jpg#$NAME#0" > $TMP/$PARSER.$INPUT.list
48    echo "Filme#$SRC $SRC page 'filme'#http://atemio.dyndns.tv/mediathek/menu/Movies.jpg#Movies.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
49        echo "$TMP/$PARSER.$INPUT.list"
50}
51
52new()
53{
54        if [ -e "$TMP/$PARSER.$INPUT.list" ] ; then
55                rm $TMP/$PARSER.$INPUT.list
56        fi
57        $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$INPUT.1
58
59        piccount=0
60
61        cat $TMP/cache.$PARSER.$INPUT.1 | sed 's/<div class/\n<div class/g' | sed 's/<a href="/\n<a href="/g' | grep ^'<a href="film' | grep title= | sed 's/ /~/g' >$TMP/cache.$PARSER.$INPUT.2
62
63        while read -u 3 ROUND; do
64                TITLE=`echo $ROUND | sed 's/title=/\ntitle=/' | grep ^"title=" | cut -d '"' -f2 | tr '~' ' ' | sed 's/#/%/'`
65                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/|/ /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'`
66                PIC=$URL/`echo $ROUND | sed s'!<img~src=!\nsrc=!' | grep ^"src=" | cut -d '"' -f2 | tr '~' ' '`
67                NEWPAGE=`echo $ROUND | sed 's/<a~href=/\nhref=/' | grep ^"href=" | cut -d '"' -f2`
68       
69                if [ -z "$PIC" ] || [ "$PIC" = "$URL/" ]; then 
70                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
71                fi
72
73                if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then
74                        if [ `cat $TMP/$PARSER.$INPUT.list | grep ^"$NEWPAGE" | wc -l` -eq 0 ];then
75                                if [ ! -e $TMP/$PARSER.$INPUT.list ];then
76                                        touch $TMP/$PARSER.$INPUT.list
77                                fi
78                                piccount=`expr $piccount + 1`
79                                LINE="$TITLE#$SRC $SRC hosterlist $NEWPAGE#$PIC#$PARSER.$FILENAME.$NEXT.$piccount.jpg#$NAME#0"
80
81                                echo "$LINE" >> $TMP/$PARSER.$INPUT.list
82                        fi
83                fi
84        done 3<$TMP/cache.$PARSER.$INPUT.2
85        rm $TMP/cache.* > /dev/null 2>&1
86
87        echo "$TMP/$PARSER.$INPUT.list"
88}
89
90page()
91{
92        if [ -e "$TMP/$PARSER.$INPUT.list" ] ; then
93                rm $TMP/$PARSER.$INPUT.list
94        fi
95        $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$INPUT.1
96
97        cat $TMP/cache.$PARSER.$INPUT.1 | sed 's/<p><ul class="rls_table/\n<p><ul class=rls_table/g' | sed 's/<\/ul><\/u>/<\/ul><\/u>\n/g' | grep ^'<p><ul class=rls_table' | sed 's/<a href="/\n<a href="/g' | sed 's/<li step=/\n<li step=/g' | grep ^'<a href=' | grep 'tba">VID' | sed 's/ /~/g' >$TMP/cache.$PARSER.$INPUT.2
98
99        while read -u 3 ROUND; do
100                TITLE=`echo $ROUND |  sed -e 's/<div~class="tle">/\n<div~class="tle""/' -e 's/<b/"b/g' | grep ^'<div~class="tle""' | cut -d '"' -f4 | tr '~' ' ' | sed 's/#/%/'`
101                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/|/ /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'`
102                PIC=$URL/`echo $ROUND | sed s'/data-original=/\ndata-original=/' | grep ^'data-original=' | cut -d '"' -f2 | sed 's/\/mini\//\/poster\//g'`
103                NEWPAGE=`echo $ROUND | cut -d '"' -f2`
104       
105                if [ "$PIC" == "$URL/" ] ; then
106                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
107                        TMPPIC="default.jpg"
108                else
109                        TMPPIC=goldesel_`echo $PIC | cut -d '/' -f6`
110                fi
111
112                if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ] ; then
113                        LINE="$TITLE#$SRC $SRC hosterlist $NEWPAGE#$PIC#$TMPPIC.jpg#$NAME#0"
114                        echo "$LINE" >> $TMP/$PARSER.$INPUT.list
115                fi
116        done 3<$TMP/cache.$PARSER.$INPUT.2
117        rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
118        echo "$TMP/$PARSER.$INPUT.list"
119}
120
121hosterlist()
122{
123        if [ -e "$TMP/$PARSER.$INPUT.list" ] ; then
124                rm $TMP/$PARSER.$INPUT.list
125        fi
126        $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$INPUT.1
127        cat $TMP/cache.$PARSER.$INPUT.1 | sed 's!<h2>Stream-Links</h2>!\nfound=!g' | sed 's!<h2>Sample-Links</h2>!\nerror=!g' | grep ^found= | sed 's/<li data=/\ndata=/g' | grep ^data= >$TMP/cache.$PARSER.$INPUT.2
128
129        while read -u 3 ROUND; do
130                NEWPAGE="data=`echo $ROUND | cut -d '"' -f2 | sed 's/;/%3B/g'`"
131                TITLE=`echo $ROUND | cut -d ';' -f5 | cut -d '.' -f1`
132                if [ ! -z "$TITLE" ] && [ "$TITLE" != " " ] && [ ! -z "$NEWPAGE" ];then
133                        PIC=`echo $TITLE | tr [A-Z] [a-z]`
134                        LINE="$TITLE#$SRC $SRC hoster $NEWPAGE '--referer $URL/$PAGE'#http://atemio.dyndns.tv/mediathek/menu/$PIC.jpg#$PIC.jpg#$NAME#111"
135                        echo "$LINE" >> $TMP/$PARSER.$INPUT.list
136                fi
137        done 3<$TMP/cache.$PARSER.$INPUT.2
138        rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
139        echo "$TMP/$PARSER.$INPUT.list"
140}
141
142hoster()
143{
144        rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
145        $curlbin $URL/res/links -X POST --data "$PAGE" -o $TMP/cache.$PARSER.$INPUT.1
146        STREAMURL=`cat $TMP/cache.$PARSER.$INPUT.1 | sed 's!url="http://dref.me/?!\nstreamurl="!' | grep ^streamurl= | cut -d'"' -f2 | sed 's!%3A!:!g' | sed 's!%2F!/!g'`
147#       rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
148        echo $STREAMURL
149}
150
151case $INPUT in
152        init) $INPUT;;
153        mainmenu) $INPUT;;
154        category) $INPUT;;
155        new) $INPUT;;
156        page) $INPUT;;
157        hosterlist) $INPUT;;
158        hoster) $INPUT;;
159esac
Note: See TracBrowser for help on using the repository browser.