source: titan/mediathek/localparser_secret/pornhub.sh @ 40138

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

tithek add pornhub

  • Property svn:executable set to *
File size: 5.7 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
9NEXT=$4
10PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
11
12FILENAME="$PARSER $INPUT $PAGE $NEXT"
13FILENAME=`echo $FILENAME | tr '&' '.' | tr '/' '.' | tr '?' '.' | tr ';' '.' | tr '=' '.' | sed 's/ \+/./g' | sed 's/\.\+/./g'`
14
15if [ -z "$FILENAME" ]; then
16        FILENAME=none
17fi
18
19URL=http://www.pornhub.com
20NAME="Pornhub"
21
22mkdir $TMP > /dev/null 2>&1
23
24if [ `echo $SRC | grep ^"/mnt/parser" | wc -l` -gt 0 ];then
25        TYPE="$SRC - Shell script"
26elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then
27        TYPE="Swap - Shell script"
28elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then
29        TYPE="Mnt - Shell script"
30else
31        TYPE="Flash - Shell script"
32fi
33
34init()
35{
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#1000"
38}
39
40mainmenu()
41{
42        echo "Genre#$SRC $SRC genre 'categories'#http://atemio.dyndns.tv/mediathek/menu/Movies.genre.jpg#Movies.genre.jpg#$NAME#0" >$TMP/$FILENAME.list
43        echo "$TMP/$FILENAME.list"
44}
45
46genre()
47{
48        if [ ! -e "$TMP/$FILENAME.list" ]; then
49                piccount=0
50                $curlbin $URL/$PAGE -o $TMP/cache.$FILENAME.1
51                cat $TMP/cache.$FILENAME.1 | tr '\n' ' ' | sed 's/<a href=/\n\n\nfound=/g' | grep ^found= | grep "/video?c=" | tr '\t' ' ' | sed 's/ \+/ /g' | grep "img src" | grep ".jpg" >$TMP/cache.$FILENAME.2
52               
53                while read -u 3 ROUND; do
54                        PIC=`echo $ROUND | sed 's!<img src=!\npic=!g' | grep ^pic= | cut -d'"' -f2 | tail -n1`
55                        TITLE=`echo $ROUND | sed 's!data-mxptext=!\ntitle=!g' | grep ^title= | cut -d'"' -f2`
56                        NEWPAGE=`echo $ROUND | cut -d'"' -f2 | head -n1`
57       
58                        if [ -z "$PIC" ]; then
59                                PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
60                        fi
61       
62                        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'`
63       
64                        if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then
65                                if [ ! -e $TMP/$FILENAME.list ];then
66                                        touch $TMP/$FILENAME.list
67                                fi
68                                piccount=`expr $piccount + 1`
69       
70                                if [ `cat $TMP/$FILENAME.list | grep "#$NEWPAGE#" | wc -l` -eq 0 ];then
71                                        LINE="$TITLE#$SRC $SRC search '$NEWPAGE&page=' 1#$PIC#$FILENAME.$FILENAME.$NEXT.$piccount.jpg#$NAME#0"
72                                fi
73                                echo "$LINE" >> $TMP/$FILENAME.list
74                        fi
75       
76                done 3<$TMP/cache.$FILENAME.2
77                rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
78        fi
79        echo "$TMP/$FILENAME.list"
80}
81
82search()
83{
84        if [ -z "$NEXT" ]; then NEXT="search"; fi
85
86        if [ -e "$TMP/$FILENAME.list" ] ; then
87                rm $TMP/$FILENAME.list
88        fi
89
90        if [ ! -e "$TMP/$FILENAME.list" ]; then
91                piccount=0
92
93                $curlbin $URL/$PAGE$NEXT -o $TMP/cache.$FILENAME.1
94                cat $TMP/cache.$FILENAME.1 | tr '\n' ' ' | sed 's/<a href=/\n\n\nfound=/g' | grep ^found= | grep "/view_video.php?viewkey=p" | tr '\t' ' ' | sed 's/ \+/ /g' | grep "img src" >$TMP/cache.$FILENAME.2
95       
96#               <li class="page_next_set"><a class="greyButton" href="/video?c=95&amp;page=10">10</a></li>
97                pages=`cat $TMP/cache.$FILENAME.1 | grep "&amp;page" | grep "page_next_set" | sed 's/&amp;page=/\nfound="/g' | grep ^found= | cut -d'"' -f2 | tail -n1`
98
99                while read -u 3 ROUND; do
100                        PIC=`echo $ROUND | sed 's!data-mediumthumb=!\npic=!g' | grep ^pic= | cut -d'"' -f2 | tail -n1`
101                        TITLE=`echo $ROUND | sed 's!title=!\ntitle=!g' | grep ^title= | cut -d'"' -f2`
102                        NEWPAGE=`echo $ROUND | cut -d'"' -f2`   
103                        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'`
104       
105                        if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ] && [ ! -z "$PIC" ];then
106                                if [ ! -e $TMP/$FILENAME.list ];then
107                                        touch $TMP/$FILENAME.list
108                                fi
109                                piccount=`expr $piccount + 1`
110
111                                if [ `cat $TMP/$FILENAME.list | grep "#$NEWPAGE#" | wc -l` -eq 0 ];then
112                                        LINE="$TITLE#$SRC $SRC hoster '$NEWPAGE'#$PIC#$FILENAME.$FILENAME.$NEXT.$piccount.jpg#$NAME#111"
113                                fi
114                                echo "$LINE" >> $TMP/$FILENAME.list
115                        fi
116       
117                done 3<$TMP/cache.$FILENAME.2
118
119                if [ "$NEXT" -lt "$pages" ]; then
120                        NEXTPAGE=`expr $NEXT + 1`
121                        LINE="Page ($NEXTPAGE/$pages)#$SRC $SRC search '$PAGE' $NEXTPAGE#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#$NAME#0"
122                        echo "$LINE" >> $TMP/$FILENAME.list
123                fi
124                rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
125        fi
126        echo "$TMP/$FILENAME.list"
127}
128
129hoster()
130{
131        rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
132        /tmp/localhoster/hoster.sh youtube_dl $URL$PAGE > $TMP/cache.$PARSER.$INPUT.1
133        STREAMURL=`cat $TMP/cache.$PARSER.$INPUT.1`
134        echo $STREAMURL
135}
136
137case $INPUT in
138        init) $INPUT;;
139        mainmenu) $INPUT;;
140        hoster) $INPUT;;
141        search) $INPUT;;
142        genre) $INPUT;;
143esac
Note: See TracBrowser for help on using the repository browser.