Changeset 39612
- Timestamp:
- 01/02/17 17:35:19 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/mediathek/localparser_secret/kkiste.sh
r37526 r39612 1 1 #!/bin/bash 2 2 # box parser for titannit 3 4 . /tmp/localhoster/hoster.sh 3 5 4 6 SRC=$1 … … 6 8 PARAM=$3 7 9 PAGE=$4 10 8 11 URL="http://kkiste.to/" 9 12 PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'` 10 13 NAME=`echo -n ${PARSER:0:2} | tr '[a-z]' '[A-Z]'`${PARSER:2} 11 curlbin="curl -k -s"12 TMP=/tmp/parser13 14 14 15 rm -rf $TMP > /dev/null 2>&1 … … 32 33 mainmenu() 33 34 { 34 echo "Neue Filme#$SRC $SRC videos neue-filme/?page= 1#http://atemio.dyndns.tv/mediathek/menu/all-newfirst.jpg#all-newfirst.jpg#$NAME#0" >/tmp/tithek/$PARSER.list 35 echo "Kinofilme#$SRC $SRC videos aktuelle-kinofilme/?page= 1#http://atemio.dyndns.tv/mediathek/menu/all-newfirst.jpg#all-newfirst.jpg#$NAME#0" >>/tmp/tithek/$PARSER.list 36 # echo "Serien#$SRC $SRC videos serien/?page= 1#http://atemio.dyndns.tv/mediathek/menu/all-newfirst.jpg#all-newfirst.jpg#$NAME#0" >>/tmp/tithek/$PARSER.list 37 # echo "Popular Tags#$SRC $SRC tags popular#http://atemio.dyndns.tv/mediathek/menu/category.jpg#category.jpg#$NAME#0" >>/tmp/tithek/$PARSER.list 38 # echo "All Tags#$SRC $SRC tags nonpopular#http://atemio.dyndns.tv/mediathek/menu/category.jpg#category.jpg#$NAME#0" >>/tmp/tithek/$PARSER.list 39 # echo "Long Videos#$SRC $SRC videos tag/0/pc?tag=long+videos#http://atemio.dyndns.tv/mediathek/menu/category.jpg#category.jpg#$NAME#0" >>/tmp/tithek/$PARSER.list 40 # echo "Search#$SRC $SRC videos index/search/0/pc?query=#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >>/tmp/tithek/$PARSER.list 41 echo "/tmp/tithek/$PARSER.list" 35 echo "Neue Filme#$SRC $SRC videos neue-filme/?page= 1#http://atemio.dyndns.tv/mediathek/menu/all-newfirst.jpg#all-newfirst.jpg#$NAME#0" >$TMP/$PARSER.$INPUT.list 36 echo "Kinofilme#$SRC $SRC videos aktuelle-kinofilme/?page= 1#http://atemio.dyndns.tv/mediathek/menu/all-newfirst.jpg#all-newfirst.jpg#$NAME#0" >>$TMP/$PARSER.$INPUT.list 37 echo "Search#$SRC $SRC search 'search/?q=%search%'#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >>$TMP/$PARSER.$INPUT.list 38 echo "$TMP/$PARSER.$INPUT.list" 39 } 40 41 search() 42 { 43 rm $TMP/$PARSER.$INPUT.list > /dev/null 2>&1 44 if [ -e "$TMP/$PARSER.$INPUT.list" ] ; then 45 rm $TMP/$PARSER.$INPUT.list 46 fi 47 48 piccount=0 49 $curlbin "$URL/$PARAM" -o "$TMP/cache.$PARSER.$INPUT.1" 50 cat $TMP/cache.$PARSER.$INPUT.1 | tr '\n' '\r' | tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed 's/ \+/ /g' | sed 's!<li class="mbox list"!\nfound=!g' | sed 's!<div class="clear">!\n<div class="clear">!g' | grep ^"found=" >$TMP/cache.$PARSER.$INPUT.2 51 52 while read -u 3 ROUND; do 53 ID=`echo $ROUND | cut -d'"' -f1 | tail -n1` 54 PIC=`echo $ROUND | sed 's!"url": !\nurl=!g' | grep ^url= | cut -d'"' -f2 | tail -n1` 55 TITLE=`echo $ROUND | sed 's!class="title">!\ntitle=<!g' | grep ^title= | cut -d'<' -f2` 56 NEWPAGE=`echo $ROUND | sed 's!<a href=!\nfound=!g' | grep ^found= | cut -d'"' -f2 | tail -n1` 57 58 PIC=`$curlbin "$URL/$NEWPAGE" | tr '\n' '\r' | tr '\r' ' ' | tr '\n' ' ' | tr '\t' ' ' | sed 's/ \+/ /g' | sed 's!<img src=!\nfound=!g' | grep ^found= | cut -d'"' -f2 | tail -n1` 59 60 61 if [ -z "$PIC" ]; then 62 PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg" 63 fi 64 65 TITLE=`echo $TITLE | sed -e 's/&/&/g' -e 's/&/und/g' -e 's/"/"/g' -e 's/</\</g' -e 's/"/\"/g' -e 's/'/\"/g' -e 's/#034;/\"/g' -e 's/#039;/\"/g' -e 's/ß/Ãx/g' -e 's/–/-/g' -e 's/Ä/à 66 /g' -e 's/Ü/ÃS/g' -e 's/Ö/Ã/g' -e 's/ä/ä/g' -e 's/ü/ü/g' -e 's/ö/ö/g' -e 's/é/é/g' -e 's/è/è/g' -e 's/%F6/ö/g' -e 's/%FC/ü/g' -e 's/%E4/ä/g' -e 's/%26/&/g' -e 's/%C4/à 67 /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 "$NEWPAGE" ];then 70 if [ ! -e $TMP/$PARSER.$INPUT.$FILENAME.list ];then 71 touch $TMP/$PARSER.$INPUT.$FILENAME.list 72 fi 73 piccount=$[$piccount+1] 74 LINE="$TITLE $LANG#$SRC $SRC parts $NEWPAGE#$PIC#$PARSER_$piccount.jpg#$NAME#111" 75 76 echo "$LINE" >> $TMP/$PARSER.$INPUT.list 77 fi 78 79 done 3<$TMP/cache.$PARSER.$INPUT.2 80 rm $TMP/cache.* > /dev/null 2>&1 81 82 echo "$TMP/$PARSER.$INPUT.list" 42 83 } 43 84 … … 123 164 { 124 165 i=`expr $PAGE \* 2` 125 data=`$curlbin -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies"$URL$PARAM" | grep "data-det=" | cut -d'"' -f4`166 data=`$curlbin "$URL$PARAM" | grep "data-det=" | cut -d'"' -f4` 126 167 if [ ! -z "$data" ];then 127 id=`$curlbin - L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies --header "Content-Type: application/json" -H "X-Requested-With: XMLHttpRequest" -X POST --data "$data" --referer $URL$PARAM http://kkiste.to/xhr/link/ | cut -d'"' -f$i`168 id=`$curlbin --header "Content-Type: application/json" -H "X-Requested-With: XMLHttpRequest" -X POST --data "$data" --referer $URL$PARAM http://kkiste.to/xhr/link/ | cut -d'"' -f$i` 128 169 fi 129 170 if [ -z "$id" ];then 130 id=`$curlbin -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies"$URL$PARAM" | grep "http://www.ecostream.tv/stream" | sed 's#http://www.ecostream.tv/stream/#\nlink=.#g' | cut -d"." -f2`171 id=`$curlbin "$URL$PARAM" | grep "http://www.ecostream.tv/stream" | sed 's#http://www.ecostream.tv/stream/#\nlink=.#g' | cut -d"." -f2` 131 172 fi 132 173 echo "http://www.ecostream.tv/stream/$id.html" 133 }134 135 136 tags()137 {138 $curlbin -o - ${URL}index/main/0/pc | sed -e 's/{DATA_MARKERS}/data=pc.XX/g' -e 's/{/{\n/g' -e 's/,/,\n/g' -e 's/\[/\[\n/g' -e 's/\}/\n\}/g' -e 's/\]/\n\]/g' | awk -v PARAM=$PARAM -v SRC=$SRC -v NAME=$NAME '139 BEGIN { table = ""140 }141 /\"/ { m = 1142 while (m == 1) {143 s = $0144 i = gsub("[\"]", "x", s)145 m = i % 2146 if (m == 1) {147 getline l148 $0 = $0 l149 }150 }151 }152 /^\{/ { next153 }154 /\[$/ { split($0, a, "\"")155 table = a[2]156 next157 }158 /^\}/ { next159 }160 /^\]/ { table = ""161 next162 }163 { if (table == PARAM) {164 split($0, a, "\"")165 title = a[2]166 tag = title167 gsub(/ /, "%20", tag)168 print title "#" SRC " " SRC " videos index/tag/0/pc?tag=" tag "#http://atemio.dyndns.tv/mediathek/menu/" tag ".jpg#" tag ".jpg#" NAME "#0"169 }170 }171 ' >/tmp/tithek/$PARSER.list172 echo "/tmp/tithek/$PARSER.list"173 174 } 174 175 … … 180 181 serien) $INPUT;; 181 182 hoster) $INPUT;; 182 tags) $INPUT;;183 search) $INPUT;; 183 184 page) $INPUT;; 184 185 esac
Note: See TracChangeset
for help on using the changeset viewer.