Changeset 41990 for titan/mediathek


Ignore:
Timestamp:
Mar 10, 2018, 10:15:59 PM (21 months ago)
Author:
obi
Message:

fix tvnow

File:
1 edited

Legend:

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

    r41989 r41990  
    1111PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'`
    1212
     13## start filename work, filename to long
     14LIST="5B 1896 500 page Id 7B 22 5D 7D filter containsNotIn Disabled maxPerPage v3 formats? fields= id, title, station, title, titleGroup, seoUrl, icon, hasFreeEpisodes, hasPayEpisodes, categoryId, searchAliasName, genres fields= formatTabs. formatTabPages. container. annualNavigation"
     15TMPPAGE="$PAGE"
     16for ROUND in $LIST; do
     17        TMPPAGE=$(echo $TMPPAGE | sed "s/$ROUND/./g")
     18done
     19TMPPAGE=`echo $TMPPAGE | tr ':' '.' | tr '*' '.' | tr ',' '.' | tr '-' '.' | tr '%' '.' | tr '&' '.' | tr '/' '.' | tr '?' '.'  | tr '=' '.' | sed 's/ \+/./g' | sed 's/\.\+/./g'`
     20## done
     21
    1322#FILENAME="$PARSER $INPUT $PAGE $NEXT $PAGE2"
    14 FILENAME="$PARSER $INPUT $NEXT $PAGE2"
     23FILENAME="$PARSER $INPUT $TMPPAGE $NEXT $PAGE2"
    1524FILENAME=`echo $FILENAME | tr '&' '.' | tr '/' '.' | tr '?' '.'  | tr '=' '.' | sed 's/ \+/./g' | sed 's/\.\+/./g'`
    1625
     
    6372mainmenu()
    6473{
    65         echo "Rtl#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station rtl#http://atemio.dyndns.tv/mediathek/menu/rtl.jpg#rtl.jpg#$NAME#0" > $TMP/$PARSER.$INPUT.list
    66         echo "Vox#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station vox#http://atemio.dyndns.tv/mediathek/menu/vox.jpg#vox.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
    67         echo "Rtl2#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station rtl2#http://atemio.dyndns.tv/mediathek/menu/rtl2.jpg#rtl2.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
    68         echo "Nitro#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station nitro#http://atemio.dyndns.tv/mediathek/menu/nitro.jpg#nitro.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
    69         echo "N-Tv#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station ntv#http://atemio.dyndns.tv/mediathek/menu/ntv.jpg#ntv.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
    70         echo "RTLplus#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station rtlplus#http://atemio.dyndns.tv/mediathek/menu/rtlplus.jpg#rtlplus.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
    71         echo "Super RTL#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station superrtl#http://atemio.dyndns.tv/mediathek/menu/superrtl.jpg#superrtl.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
    72         echo "WatchBox#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station watchbox#http://atemio.dyndns.tv/mediathek/menu/watchbox.jpg#watchbox.jpg#$NAME#0" >> $TMP/$PARSER.$INPUT.list
    73 
    74         if [ -e "$TMP/$PARSER.new.list" ] ; then
    75                 rm $TMP/$PARSER.new.list
    76         fi
    77         if [ -e "$TMP/$PARSER.page.list" ] ; then
    78                 rm $TMP/$PARSER.page.list
    79         fi
    80 
    81         echo "$TMP/$PARSER.$INPUT.list"
     74        echo "Rtl#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station rtl#http://atemio.dyndns.tv/mediathek/menu/rtl.jpg#rtl.jpg#$NAME#0" > $TMP/$FILENAME.list
     75        echo "Vox#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station vox#http://atemio.dyndns.tv/mediathek/menu/vox.jpg#vox.jpg#$NAME#0" >> $TMP/$FILENAME.list
     76        echo "Rtl2#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station rtl2#http://atemio.dyndns.tv/mediathek/menu/rtl2.jpg#rtl2.jpg#$NAME#0" >> $TMP/$FILENAME.list
     77        echo "Nitro#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station nitro#http://atemio.dyndns.tv/mediathek/menu/nitro.jpg#nitro.jpg#$NAME#0" >> $TMP/$FILENAME.list
     78        echo "N-Tv#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station ntv#http://atemio.dyndns.tv/mediathek/menu/ntv.jpg#ntv.jpg#$NAME#0" >> $TMP/$FILENAME.list
     79        echo "RTLplus#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station rtlplus#http://atemio.dyndns.tv/mediathek/menu/rtlplus.jpg#rtlplus.jpg#$NAME#0" >> $TMP/$FILENAME.list
     80        echo "Super RTL#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station superrtl#http://atemio.dyndns.tv/mediathek/menu/superrtl.jpg#superrtl.jpg#$NAME#0" >> $TMP/$FILENAME.list
     81        echo "WatchBox#$SRC $SRC new 'v3/formats?fields=id,title,station,title,titleGroup,seoUrl,icon,hasFreeEpisodes,hasPayEpisodes,categoryId,searchAliasName,genres&filter=%7B%22Id%22:%7B%22containsNotIn%22:%5B%221896%22%5D%7D,%22Disabled%22:0%7D&maxPerPage=500&page=1' station watchbox#http://atemio.dyndns.tv/mediathek/menu/watchbox.jpg#watchbox.jpg#$NAME#0" >> $TMP/$FILENAME.list
     82        echo "$TMP/$FILENAME.list"
    8283}
    8384
    8485new()
    8586{
    86         if [ ! -e "$TMP/$PARSER.$INPUT.sorted.list" ] ; then
    87                 $curlbin "$URL/$PAGE&page=1" > $TMP/cache.$PARSER.$INPUT.1
    88                 $curlbin "$URL/$PAGE&page=2" >> $TMP/cache.$PARSER.$INPUT.1
    89                 $curlbin "$URL/$PAGE&page=3" >> $TMP/cache.$PARSER.$INPUT.1
    90                 $curlbin "$URL/$PAGE&page=4" >> $TMP/cache.$PARSER.$INPUT.1
    91                 cat $TMP/cache.$PARSER.$INPUT.1  | sed 's/{"id":/\n{"id":/g' | grep ^'{"id":' | grep "\"$NEXT\":\"$PAGE2\"" > /$TMP/cache.$PARSER.$INPUT.2
     87        if [ ! -e "$TMP/$FILENAME.sorted.list" ] ; then
     88                $curlbin "$URL/$PAGE&page=1" > $TMP/cache.$FILENAME.1
     89                $curlbin "$URL/$PAGE&page=2" >> $TMP/cache.$FILENAME.1
     90                $curlbin "$URL/$PAGE&page=3" >> $TMP/cache.$FILENAME.1
     91                $curlbin "$URL/$PAGE&page=4" >> $TMP/cache.$FILENAME.1
     92                cat $TMP/cache.$FILENAME.1  | sed 's/{"id":/\n{"id":/g' | grep ^'{"id":' | grep "\"$NEXT\":\"$PAGE2\"" > /$TMP/cache.$FILENAME.2
    9293
    9394                while read -u 3 ROUND; do
     
    105106
    106107                        if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then
    107                                 if [ `cat $TMP/$PARSER.$INPUT.list | grep ^"$NEWPAGE" | wc -l` -eq 0 ];then
    108                                         if [ ! -e $TMP/$PARSER.$INPUT.list ];then
    109                                                 touch $TMP/$PARSER.$INPUT.list
     108                                if [ `cat $TMP/$FILENAME.list | grep ^"$NEWPAGE" | wc -l` -eq 0 ];then
     109                                        if [ ! -e $TMP/$FILENAME.list ];then
     110                                                touch $TMP/$FILENAME.list
    110111                                        fi
    111112                                        LINE="$TITLE#$SRC $SRC videos '$NEWPAGE'#$PIC#$TMPPIC#$NAME#0"
    112                                         echo "$LINE" >> $TMP/$PARSER.$INPUT.list
     113                                        echo "$LINE" >> $TMP/$FILENAME.list
    113114                                fi
    114115                        fi
    115                 done 3<$TMP/cache.$PARSER.$INPUT.2
    116                 rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
     116                done 3<$TMP/cache.$FILENAME.2
     117                rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
    117118        fi
    118119
    119         cat $TMP/$PARSER.$INPUT.list | sort -u > $TMP/$PARSER.$INPUT.sorted.list
    120 
    121         if [ -e "$TMP/$PARSER.hosterlist.list" ] ; then
    122                 rm $TMP/$PARSER.hosterlist.list
     120        cat $TMP/$FILENAME.list | sort -u > $TMP/$FILENAME.sorted.list
     121        if [ -e $TMP/$FILENAME.list ];then
     122                rm $TMP/$FILENAME.list
    123123        fi
    124124
    125 #       echo "$TMP/$PARSER.$INPUT.list"
    126         echo "$TMP/$PARSER.$INPUT.sorted.list"
     125#       echo "$TMP/$FILENAME.list"
     126        echo "$TMP/$FILENAME.sorted.list"
    127127}
    128128
    129129videos()
    130130{
    131         if [ ! -e "$TMP/$PARSER.$INPUT.list" ] ; then
    132                 $curlbin "$URL/$PAGE" > $TMP/cache.$PARSER.$INPUT.1
    133                 cat $TMP/cache.$PARSER.$INPUT.1 | sed -nr 's/.*"id":([^,]+).*/\1/p' > /$TMP/cache.$PARSER.$INPUT.2
    134                 ID=`cat $TMP/cache.$PARSER.$INPUT.2`
     131        if [ ! -e "$TMP/$FILENAME.list" ] ; then
     132                $curlbin "$URL/$PAGE" > $TMP/cache.$FILENAME.1
     133                cat $TMP/cache.$FILENAME.1 | sed -nr 's/.*"id":([^,]+).*/\1/p' > /$TMP/cache.$FILENAME.2
     134                ID=`cat $TMP/cache.$FILENAME.2`
    135135                NEWPAGE="v3/containers/$ID/movies?fields=*,format.*,paymentPaytypes.*,livestreamEvent.*,pictures,trailers,packages,annualNavigation&maxPerPage=500&order=OrderWeight+asc,+BroadcastStartDate+desc&page=1"
    136136
    137                 $curlbin "$URL/$NEWPAGE" > $TMP/cache.$PARSER.$INPUT.3
    138                 cat $TMP/cache.$PARSER.$INPUT.3  | sed 's/orderWeight/\norderWeight/g' | grep ^orderWeight > /$TMP/cache.$PARSER.$INPUT.4
     137                $curlbin "$URL/$NEWPAGE" > $TMP/cache.$FILENAME.3
     138                cat $TMP/cache.$FILENAME.3  | sed 's/orderWeight/\norderWeight/g' | grep ^orderWeight > /$TMP/cache.$FILENAME.4
    139139
    140140                while read -u 3 ROUND; do
     
    162162
    163163                        if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then
    164                                 if [ `cat $TMP/$PARSER.$INPUT.list | grep ^"$NEWPAGE" | wc -l` -eq 0 ];then
    165                                         if [ ! -e $TMP/$PARSER.$INPUT.list ];then
    166                                                 touch $TMP/$PARSER.$INPUT.list
     164                                if [ `cat $TMP/$FILENAME.list | grep ^"$NEWPAGE" | wc -l` -eq 0 ];then
     165                                        if [ ! -e $TMP/$FILENAME.list ];then
     166                                                touch $TMP/$FILENAME.list
    167167                                        fi
    168168                                        LINE="$TITLE#$NEWPAGE#$PIC#$TMPPIC#$NAME#2"
    169                                         echo "$LINE" >> $TMP/$PARSER.$INPUT.list
     169                                        echo "$LINE" >> $TMP/$FILENAME.list
    170170                                fi
    171171                        fi
    172                 done 3<$TMP/cache.$PARSER.$INPUT.4
    173                 rm $TMP/cache.$PARSER.$INPUT.* > /dev/null 2>&1
     172                done 3<$TMP/cache.$FILENAME.4
     173                rm $TMP/cache.$FILENAME.* > /dev/null 2>&1
    174174        fi
    175175
    176         if [ -e "$TMP/$PARSER.hosterlist.list" ] ; then
    177                 rm $TMP/$PARSER.hosterlist.list
    178         fi
    179 
    180         echo "$TMP/$PARSER.$INPUT.list"
     176        echo "$TMP/$FILENAME.list"
    181177}
    182178
Note: See TracChangeset for help on using the changeset viewer.