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

Last change on this file since 39387 was 39387, checked in by obi, 7 years ago

fix goldesel

  • Property svn:executable set to *
File size: 8.3 KB
RevLine 
[39133]1#!/bin/sh
2# first sh box parser for titannit mfg obi
3
4. /tmp/localhoster/hoster.sh
5
6SRC=$1
7INPUT=$2
[39153]8PAGE=$3
[39133]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{
[39183]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
[39133]49        echo "$TMP/$PARSER.$INPUT.list"
50}
51
[39387]52#
53#  <form id="challenge-form" action="/cdn-cgi/l/chk_jschl" method="get">
54#    <input type="hidden" name="jschl_vc" value="528818834f8ad23629ea5d31c3a5390c"/>
55#    <input type="hidden" name="pass" value="1479475035.975-uJ99NUZ87d"/>
56#    <input type="hidden" id="jschl-answer" name="jschl_answer"/>
57#  </form>
58
59#http://goldesel.to/cdn-cgi/l/chk_jschl?jschl_vc=f29b5aecef651bc1df9cad068c58848c&pass=1479474954.758-6i1RP0vPFz&jschl_answer=2914582
60#
61
[39183]62new()
63{
64        if [ -e "$TMP/$PARSER.$INPUT.list" ] ; then
65                rm $TMP/$PARSER.$INPUT.list
66        fi
67
[39387]68#       $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$INPUT.0
69
70#       DATA=`cat $TMP/cache.$PARSER.$INPUT.0 | sed 's/ \+/ /g' | sed 's/<form id=/\nfound=/g' | grep ^found=`
71
72#       actionpath=`cat $TMP/cache.$PARSER.$INPUT.0 | tr '\n' ' ' | sed 's/ \+/ /g' | sed 's/<form id=/\nfound=/g' | grep ^found= | sed 's/action=/\naction=/g' | grep ^action= | cut -d'"' -f2`
73#       jschlvc=`cat $TMP/cache.$PARSER.$INPUT.0 | tr '\n' ' ' | sed 's/ \+/ /g' | sed 's/<form id=/\nfound=/g' | grep ^found= | sed 's/"jschl_vc"/\njschl_vc=/g' | grep ^jschl_vc= | cut -d'"' -f2`
74#       pass=`cat $TMP/cache.$PARSER.$INPUT.0 | tr '\n' ' ' | sed 's/ \+/ /g' | sed 's/<form id=/\nfound=/g' | grep ^found= | sed 's/"pass"/\npass=/g' | grep ^pass= | cut -d'"' -f2`
75#       jschlanswer=2914582
76        #`cat $TMP/cache.$PARSER.$INPUT.0 | tr '\n' ' ' | sed 's/ \+/ /g' | sed 's/<form id=/\nfound=/g' | grep ^found= | sed 's/"jschl-answer"/\njschl-answer=/g' | grep ^jschl-answer= | cut -d'"' -f2`
77
78#echo actionpath $actionpath
79#echo jschlvc $jschlvc
80#echo pass $pass
81#echo jschlanswer $jschlanswer
82
83#echo 222 "$URL"/"$actionpath"?jschl_vc="$jschlvc"&pass="$pass"&jschl_answer="$jschlanswer"
84
85#       $curlbin "$URL/$actionpath?jschl_vc=$jschlvc&pass=$pass&jschl_answer=$jschlanswer" -o $TMP/cache.$PARSER.$INPUT.00
86#echo $TMP/cache.$PARSER.$INPUT.00
87#exit
88
89#       $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$INPUT.1
90
91        /tmp/localhoster/hoster.sh get $URL/$PAGE > $TMP/cache.$PARSER.$INPUT.1
92
[39183]93        piccount=0
94
95        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
96
97        while read -u 3 ROUND; do
98                TITLE=`echo $ROUND | sed 's/title=/\ntitle=/' | grep ^"title=" | cut -d '"' -f2 | tr '~' ' ' | sed 's/#/%/'`
99                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'`
100                PIC=$URL/`echo $ROUND | sed s'!<img~src=!\nsrc=!' | grep ^"src=" | cut -d '"' -f2 | tr '~' ' '`
101                NEWPAGE=`echo $ROUND | sed 's/<a~href=/\nhref=/' | grep ^"href=" | cut -d '"' -f2`
102       
103                if [ -z "$PIC" ] || [ "$PIC" = "$URL/" ]; then 
104                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
105                fi
106
107                if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then
108                        if [ `cat $TMP/$PARSER.$INPUT.list | grep ^"$NEWPAGE" | wc -l` -eq 0 ];then
109                                if [ ! -e $TMP/$PARSER.$INPUT.list ];then
110                                        touch $TMP/$PARSER.$INPUT.list
111                                fi
112                                piccount=`expr $piccount + 1`
113                                LINE="$TITLE#$SRC $SRC hosterlist $NEWPAGE#$PIC#$PARSER.$FILENAME.$NEXT.$piccount.jpg#$NAME#0"
114
115                                echo "$LINE" >> $TMP/$PARSER.$INPUT.list
116                        fi
117                fi
118        done 3<$TMP/cache.$PARSER.$INPUT.2
[39387]119#       rm $TMP/cache.* > /dev/null 2>&1
[39183]120
121        echo "$TMP/$PARSER.$INPUT.list"
122}
123
[39133]124page()
125{
[39153]126        if [ -e "$TMP/$PARSER.$INPUT.list" ] ; then
127                rm $TMP/$PARSER.$INPUT.list
128        fi
[39387]129#       $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$INPUT.1
130        /tmp/localhoster/hoster.sh get $URL/$PAGE > $TMP/cache.$PARSER.$INPUT.1
[39133]131
[39153]132        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
[39133]133
[39153]134        while read -u 3 ROUND; do
135                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/#/%/'`
136                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'`
137                PIC=$URL/`echo $ROUND | sed s'/data-original=/\ndata-original=/' | grep ^'data-original=' | cut -d '"' -f2 | sed 's/\/mini\//\/poster\//g'`
138                NEWPAGE=`echo $ROUND | cut -d '"' -f2`
139       
140                if [ "$PIC" == "$URL/" ] ; then
141                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
142                        TMPPIC="default.jpg"
143                else
144                        TMPPIC=goldesel_`echo $PIC | cut -d '/' -f6`
145                fi
[39133]146
[39153]147                if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ] ; then
148                        LINE="$TITLE#$SRC $SRC hosterlist $NEWPAGE#$PIC#$TMPPIC.jpg#$NAME#0"
149                        echo "$LINE" >> $TMP/$PARSER.$INPUT.list
150                fi
151        done 3<$TMP/cache.$PARSER.$INPUT.2
152        rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
153        echo "$TMP/$PARSER.$INPUT.list"
[39133]154}
155
156hosterlist()
157{
[39153]158        if [ -e "$TMP/$PARSER.$INPUT.list" ] ; then
159                rm $TMP/$PARSER.$INPUT.list
160        fi
[39387]161#       $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$INPUT.1
162        /tmp/localhoster/hoster.sh get $URL/$PAGE > $TMP/cache.$PARSER.$INPUT.1
163
[39153]164        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
[39133]165
166        while read -u 3 ROUND; do
167                NEWPAGE="data=`echo $ROUND | cut -d '"' -f2 | sed 's/;/%3B/g'`"
168                TITLE=`echo $ROUND | cut -d ';' -f5 | cut -d '.' -f1`
169                if [ ! -z "$TITLE" ] && [ "$TITLE" != " " ] && [ ! -z "$NEWPAGE" ];then
170                        PIC=`echo $TITLE | tr [A-Z] [a-z]`
[39153]171                        LINE="$TITLE#$SRC $SRC hoster $NEWPAGE '--referer $URL/$PAGE'#http://atemio.dyndns.tv/mediathek/menu/$PIC.jpg#$PIC.jpg#$NAME#111"
172                        echo "$LINE" >> $TMP/$PARSER.$INPUT.list
[39133]173                fi
[39153]174        done 3<$TMP/cache.$PARSER.$INPUT.2
175        rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
176        echo "$TMP/$PARSER.$INPUT.list"
[39133]177}
178
179hoster()
180{
[39184]181        rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
182        $curlbin $URL/res/links -X POST --data "$PAGE" -o $TMP/cache.$PARSER.$INPUT.1
183        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'`
184#       rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
[39133]185        echo $STREAMURL
186}
187
188case $INPUT in
189        init) $INPUT;;
190        mainmenu) $INPUT;;
191        category) $INPUT;;
[39183]192        new) $INPUT;;
[39133]193        page) $INPUT;;
194        hosterlist) $INPUT;;
195        hoster) $INPUT;;
196esac
Note: See TracBrowser for help on using the repository browser.