Changeset 37010


Ignore:
Timestamp:
01/31/16 06:03:27 (8 years ago)
Author:
obi
Message:

update nba

Location:
titan
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • titan/mediathek/localparser_secret/nbaondemand.sh

    r36952 r37010  
    77PAGE=$4
    88FILENAME=`echo $PAGE | tr '/' '.'`
     9if [ -z "$PAGE" ]; then
     10        FILENAME=none
     11fi
    912
    1013ARCH=`cat /etc/.arch`
    1114URL=http://livetv.sx
    1215PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
    13 NAME=NBA-On-Demand
    14 
     16NAME=MNT-NBA-On-Demand
     17
     18curlbin="curl -k -s -v -L --cookie /mnt/network/cookies --cookie-jar /mnt/network/cookies --user-agent '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'"
    1519wgetbin="wget -q -T2"
    1620TMP=/tmp/parser
     21#TMP=/mnt/parser/tmp
    1722#TMP=/var/usr/local/share/titan/plugins/tithek/parser/tmp
    1823
     
    2025mkdir $TMP > /dev/null 2>&1
    2126
    22 if [ "$SRC" = "/mnt/parser" ];then
     27if [ `echo $SRC | grep ^"/mnt/parser" | wc -l` -gt 0 ];then
    2328        TYPE="$SRC - Shell script"
    2429elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then
     
    4550category()
    4651{
    47         echo "Latest#$SRC $SRC listvideos latest en/videotourney/3#http://atemio.dyndns.tv/mediathek/menu/categoty.jpg#categoty.jpg#$NAME#0" > $TMP/$PARSER.$INPUT.list
    48 #       echo "Games#$SRC $SRC submenu games en/videotourney/3/#http://atemio.dyndns.tv/mediathek/menu/categoty.jpg#categoty.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
    49 #       echo "Highlights#$SRC $SRC submenu highlights en/videotourney/3/#http://atemio.dyndns.tv/mediathek/menu/categoty.jpg#categoty.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
     52        echo "Live#$SRC $SRC live init#http://atemio.dyndns.tv/mediathek/menu/categoty.jpg#categoty.jpg#$NAME#0" > $TMP/$PARSER.$INPUT.list
     53        echo "Latest#$SRC $SRC videos latest en/videotourney/3#http://atemio.dyndns.tv/mediathek/menu/categoty.jpg#categoty.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
    5054        echo "Teams#$SRC $SRC submenu teams en/leagueresults/3/#http://atemio.dyndns.tv/mediathek/menu/categoty.jpg#categoty.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
    5155        echo "$TMP/$PARSER.$INPUT.list"
    5256}
    5357
    54 listvideos()
    55 {
    56         if [ ! -e "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list" ]; then
    57                 touch $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
     58live()
     59{
     60        if [ ! -e "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list" ]; then
     61                piccount=0
     62                $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$FROM.$FILENAME.1     
     63
     64                cat $TMP/cache.$PARSER.$FROM.$FILENAME.1 | tr '\n' ' ' | sed 's!<img width=27!\nfound=!g' | grep '^found=' | grep nba.gif | grep -v nhl >$TMP/cache.$PARSER.$FROM.$FILENAME.2
     65
     66                while read -u 3 ROUND; do
     67                        URL=`echo $ROUND | sed 's!href=!\nurl=!g' | grep ^url= | cut -d'"' -f2 | head -n1`
     68                        TITLE=`echo $ROUND | sed "s!$URL\">!\ntitle=<!g" | grep ^title= | cut -d'<' -f2 | sed 's!&ndash;!-!g'`
     69                        SCORE=`echo $ROUND | sed 's!&nbsp; !\nscore=<!g' | grep ^score= | cut -d'<' -f2 | sed 's!&ndash;!-!g'`                 
     70                        EXTRA=`echo $ROUND | sed 's!<span class="evdesc">!\nextra=<!g' | grep ^extra= | cut -d'<' -f2 | sed 's!&ndash;!-!g'`                   
     71
     72                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
     73
     74                        if [ ! -z "$TITLE" ] && [ ! -z "$SCORE" ];then
     75                                TITLE="$TITLE ($SCORE)"
     76                        fi
     77
     78                        if [ ! -z "$TITLE" ] && [ ! -z "$EXTRA" ];then
     79                                TITLE="$TITLE $EXTRA"
     80                        fi
     81
     82                        TITLE=`echo $TITLE | sed 's/&nbsp;//g'`
     83                        TITLE=`echo $TITLE | sed 's/&ndash;/-/g'`
     84                        TITLE=`echo $TITLE | sed 's/\n//g'`
     85
     86                        if [ ! -z "$TITLE" ] && [ ! -z "$URL" ];then
     87                                if [ ! -e $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list ];then
     88                                        touch $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
     89                                fi
     90
     91                                piccount=`expr $piccount + 1`
     92
     93                                URL="$SRC $SRC hoster $FROM $URL"
     94
     95                                LINE="$TITLE#$URL#$PIC#$PARSER_$piccount.jpg#$NAME#0"
     96                                echo "$LINE" >> $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
     97                        fi
     98       
     99                done 3<$TMP/cache.$PARSER.$FROM.$FILENAME.2
     100                rm $TMP/cache.* > /dev/null 2>&1
     101        fi
     102        echo "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list"
     103}
     104
     105hoster()
     106{
     107        if [ ! -e "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list" ]; then
     108                piccount=0
     109                $curlbin $URL/$PAGE -o $TMP/cache.$PARSER.$FROM.$FILENAME.1     
     110               
     111                cat $TMP/cache.$PARSER.$FROM.$FILENAME.1 | tr '\n' ' ' | sed "s!show_webplayer('!\nfound=('!g" | sed 's!src="!\nsrc="!g' | grep '^found=' >$TMP/cache.$PARSER.$FROM.$FILENAME.2
     112
     113                while read -u 3 ROUND; do
     114                        URL=`echo $ROUND | sed 's!href=!\nurl=!g' | grep ^url= | cut -d'"' -f2 | head -n1`
     115                        TITLE=`echo $ROUND | cut -d"'" -f2`
     116                        EXTRA=`echo $ROUND | cut -d"'" -f4`                     
     117
     118                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
     119
     120                        if [ ! -z "$TITLE" ] && [ ! -z "$EXTRA" ];then
     121                                TITLE="$TITLE ($EXTRA)"
     122                        fi
     123
     124                        if [ ! -z "$TITLE" ] && [ ! -z "$URL" ];then
     125                                if [ ! -e $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list ];then
     126                                        touch $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
     127                                fi
     128                                piccount=`expr $piccount + 1`
     129
     130                                URL="$SRC $SRC videos $FROM $URL"
     131
     132                                LINE="$TITLE#$URL#$PIC#$PARSER_$piccount.jpg#$NAME#98"
     133                                echo "$LINE" >> $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
     134                        fi
     135       
     136                done 3<$TMP/cache.$PARSER.$FROM.$FILENAME.2
     137                rm $TMP/cache.* > /dev/null 2>&1
     138        fi
     139        echo "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list"
     140}
     141
     142videos()
     143{
     144        if [ ! -e "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list" ]; then
    58145                piccount=0
    59146                $wgetbin $URL/$PAGE -O $TMP/cache.$PARSER.$FROM.$FILENAME.1
    60147
    61                 cat $TMP/cache.$PARSER.$FROM.$FILENAME.1 | tr '\n' ' ' | sed 's!height=27!\nfound=!g' | grep '^found=' | grep -v LiveTV >$TMP/cache.$PARSER.$FROM.$FILENAME.2
     148                cat $TMP/cache.$PARSER.$FROM.$FILENAME.1 | tr '\n' ' ' | sed 's!height=27!\nfound=!g' | grep '^found=' >$TMP/cache.$PARSER.$FROM.$FILENAME.2
    62149
    63150                while read -u 3 ROUND; do
     
    92179
    93180                        if [ ! -z "$TITLE" ] && [ ! -z "$URL" ] && [ "$URL" != "http://xlivetv.sx" ] && [ `cat $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list | grep "#$URL#" | wc -l` -eq 0 ];then
    94                                 piccount=`expr $piccount + 1`
    95 
    96                                 URL="$SRC $SRC playvideos $FROM $URL"
     181                                if [ ! -e $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list ];then
     182                                        touch $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
     183                                fi
     184                                piccount=`expr $piccount + 1`
     185
     186                                URL="$SRC $SRC play $FROM $URL"
    97187
    98188                                LINE="$TITLE#$URL#$PIC#$PARSER_$piccount.jpg#$NAME#0"
     
    106196}
    107197
    108 playvideos()
    109 {
    110         if [ ! -e "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list" ]; then
    111                 touch $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
     198play()
     199{
     200        if [ ! -e "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list" ]; then
    112201                piccount=0
    113202                $wgetbin $URL/$PAGE -O $TMP/cache.$PARSER.$FROM.$FILENAME.1
     
    121210                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
    122211                        if [ ! -z "$TITLE" ] && [ ! -z "$URL" ] && [ "$URL" != "http://xlivetv.sx" ] && [ `cat $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list | grep "#$URL#" | wc -l` -eq 0 ];then
     212                                if [ ! -e $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list ];then
     213                                        touch $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
     214                                fi
     215
    123216                                piccount=`expr $piccount + 1`
    124217                                LINE="$TITLE#$URL#$PIC#$PARSER_$piccount.jpg#$NAME#98"
     
    135228{
    136229        if [ ! -e "$TMP/$PARSER.$INPUT.$FROM.$FILENAME.list" ]; then
    137                 touch $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
    138230                piccount=0
    139231
     
    143235
    144236                while read -u 3 ROUND; do
    145                         URL="$SRC $SRC listvideos $FROM `echo $ROUND | cut -d'"' -f2 | sed 's!/calendar/!/video/!g'`"
     237                        URL="$SRC $SRC videos $FROM `echo $ROUND | cut -d'"' -f2 | sed 's!/calendar/!/video/!g'`"
    146238                        TITLE=`echo $ROUND | sed 's!<b>!\ntitle=<!g' | grep ^title= | cut -d'<' -f2`
    147239                        PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg"
    148240       
    149241                        if [ ! -z "$TITLE" ] && [ ! -z "$URL" ];then
     242                                if [ ! -e $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list ];then
     243                                        touch $TMP/$PARSER.$INPUT.$FROM.$FILENAME.list
     244                                fi
    150245                                piccount=$[$piccount+1]
    151246                                LINE="$TITLE#$URL#$PIC#$PARSER_$piccount.jpg#$NAME#0"
     
    163258        mainmenu) $INPUT;;
    164259        category) $INPUT;;
    165         listvideos) $INPUT;;
    166         playvideos) $INPUT;;
     260        live) $INPUT;;
     261        hoster) $INPUT;;
     262        video) $INPUT;;
     263        play) $INPUT;;
    167264        submenu) $INPUT;;
    168265esac
  • titan/plugins/tithek/nbaondemand.h

    r37008 r37010  
    2424        titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/nbaondemand1_tmpstr", NULL, host, path, tmpstr);
    2525
    26 //<script src="//cdn.playwire.com/bolt/js/zeus/embed.js" data-config="//config.playwire.com/19004/videos/v2/4546546/zeus.json" data-width="600" data-height="343"  type="text/javascript" charset="utf-8"></script>
    27 //GET https://cdn.video.playwire.com/19004/videos/4546546/video-sd.mp4?hosting_id=19004 HTTP/1.1
    28 
    29         id = string_resub("config.playwire.com/19004/videos/v2/", "/zeus.json", tmpstr, 0);
    30         if(id != NULL)
     26        url = string_resub("scrolling='no'src=\"", "\"", tmpstr, 0);
     27        if(url != NULL)
    3128        {
    32             streamurl = ostrcat("https://cdn.video.playwire.com/19004/videos/", id, 0, 0);
    33         streamurl = ostrcat(streamurl, "/video-sd.mp4?hosting_id=19004", 1, 0);
    34     }
     29                free(tmpstr), tmpstr = NULL;
     30                host = string_resub("http://", "/", link, 0);
     31                tmpstr = gethttps(link, NULL, NULL, NULL, NULL, link, 1);
     32                host = string_resub("http://", "/", link, 0);
     33                path = string_replace_all(host, "", link, 0);
     34                path = string_replace_all("http://", "", path, 1);
     35                path = string_replace_all(" ", "%20", path, 1);
     36                titheklog(debuglevel, "/var/usr/local/share/titan/plugins/tithek/nbaondemand1a_tmpstr", NULL, host, path, tmpstr);
     37                streamurl = string_resub("video height='480' width='700' src='", "'", tmpstr, 0);
     38        }
     39        else if(ostrstr(tmpstr, "config.playwire.com/19004/videos/v2/") != NULL)
     40        {
     41                id = string_resub("config.playwire.com/19004/videos/v2/", "/zeus.json", tmpstr, 0);
     42                if(id != NULL)
     43                {
     44        //<script src="//cdn.playwire.com/bolt/js/zeus/embed.js" data-config="//config.playwire.com/19004/videos/v2/4546546/zeus.json" data-width="600" data-height="343"  type="text/javascript" charset="utf-8"></script>
     45        //GET https://cdn.video.playwire.com/19004/videos/4546546/video-sd.mp4?hosting_id=19004 HTTP/1.1
     46       
     47                    streamurl = ostrcat("https://cdn.video.playwire.com/19004/videos/", id, 0, 0);
     48                streamurl = ostrcat(streamurl, "/video-sd.mp4?hosting_id=19004", 1, 0);
     49            }
     50        }
    3551    else
    3652    {
Note: See TracChangeset for help on using the changeset viewer.