1 | #!/bin/sh |
---|
2 | # first sh box parser for titannit mfg obi |
---|
3 | |
---|
4 | . /tmp/localhoster/hoster.sh |
---|
5 | |
---|
6 | SRC=$1 |
---|
7 | INPUT=$2 |
---|
8 | PAGE=$3 |
---|
9 | NEXT=$4 |
---|
10 | PAGE2=$5 |
---|
11 | PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'` |
---|
12 | |
---|
13 | ## start filename work, filename to long |
---|
14 | LIST="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" |
---|
15 | TMPPAGE="$PAGE" |
---|
16 | for ROUND in $LIST; do |
---|
17 | TMPPAGE=$(echo $TMPPAGE | sed "s/$ROUND/./g") |
---|
18 | done |
---|
19 | TMPPAGE=`echo $TMPPAGE | tr ':' '.' | tr '*' '.' | tr ',' '.' | tr '-' '.' | tr '%' '.' | tr '&' '.' | tr '/' '.' | tr '?' '.' | tr '=' '.' | sed 's/ \+/./g' | sed 's/\.\+/./g'` |
---|
20 | ## done |
---|
21 | |
---|
22 | #FILENAME="$PARSER $INPUT $PAGE $NEXT $PAGE2" |
---|
23 | FILENAME="$PARSER $INPUT $TMPPAGE $NEXT $PAGE2" |
---|
24 | FILENAME=`echo $FILENAME | tr '&' '.' | tr '/' '.' | tr '?' '.' | tr '=' '.' | sed 's/ \+/./g' | sed 's/\.\+/./g'` |
---|
25 | |
---|
26 | if [ -z "$FILENAME" ]; then |
---|
27 | FILENAME=none |
---|
28 | fi |
---|
29 | |
---|
30 | URL=https://api.tvnow.de |
---|
31 | PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'` |
---|
32 | NAME="TvNow" |
---|
33 | |
---|
34 | mkdir $TMP > /dev/null 2>&1 |
---|
35 | #TMP=/tmp/localcache |
---|
36 | if [ `echo $SRC | grep ^"/mnt/parser" | wc -l` -gt 0 ];then |
---|
37 | TYPE="$SRC - Shell script" |
---|
38 | elif [ `echo $SRC | grep ^"/var/swap" | wc -l` -gt 0 ];then |
---|
39 | TYPE="Swap - Shell script" |
---|
40 | elif [ `echo $SRC | grep ^"/mnt/swapextensions" | wc -l` -gt 0 ];then |
---|
41 | TYPE="Mnt - Shell script" |
---|
42 | else |
---|
43 | TYPE="Flash - Shell script" |
---|
44 | fi |
---|
45 | |
---|
46 | init() |
---|
47 | { |
---|
48 | rm -rf $TMP > /dev/null 2>&1 |
---|
49 | echo "$NAME ($TYPE)#$SRC $SRC mainmenu#http://atemio.dyndns.tv/mediathek/menu/$PARSER.jpg#$PARSER.jpg#TiThek#0" |
---|
50 | } |
---|
51 | |
---|
52 | |
---|
53 | #nitro page=1 |
---|
54 | #https://api.tvnow.de/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&page=1 |
---|
55 | |
---|
56 | #nitro page=4 |
---|
57 | #https://api.tvnow.de/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&page=4 |
---|
58 | #36: |
---|
59 | #id 2500 |
---|
60 | #title "Matlock" |
---|
61 | #station "nitro" |
---|
62 | #titleGroup "M" |
---|
63 | #seoUrl "matlock" |
---|
64 | |
---|
65 | #matlock |
---|
66 | #https://api.tvnow.de/v3/formats/seo?fields=*,.*,formatTabs.*,formatTabs.formatTabPages.*,formatTabs.formatTabPages.container.*,annualNavigation.*&name=matlock.php&station=nitro |
---|
67 | #alle folgen |
---|
68 | #https://api.tvnow.de/v3/containers/141431/movies?fields=*,format.*,paymentPaytypes.*,livestreamEvent.*,pictures,trailers,packages,annualNavigation&maxPerPage=500&order=OrderWeight+asc,+BroadcastStartDate+desc&page=1 |
---|
69 | #einzel folge |
---|
70 | #https://api.tvnow.de/v3/movies/matlock/der-alptraum?fields=*,format,files,manifest,breakpoints,paymentPaytypes,trailers,packages&station=nitro |
---|
71 | |
---|
72 | mainmenu() |
---|
73 | { |
---|
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" |
---|
83 | } |
---|
84 | |
---|
85 | new() |
---|
86 | { |
---|
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 |
---|
93 | |
---|
94 | while read -u 3 ROUND; do |
---|
95 | TITLE=`echo $ROUND | sed -nr 's/.*"title":"([^"]+).*/\1/p'` |
---|
96 | seoUrl=`echo $ROUND | sed -nr 's/.*"seoUrl":"([^"]+).*/\1/p'` |
---|
97 | titleGroup=`echo $ROUND | sed -nr 's/.*"titleGroup":"([^"]+).*/\1/p'` |
---|
98 | PIC=`echo $ROUND | sed 's!data-original=!\nsrc=!' | grep ^"src=" | cut -d '"' -f2` |
---|
99 | NEWPAGE="v3/formats/seo?fields=*,.*,formatTabs.*,formatTabs.formatTabPages.*,formatTabs.formatTabPages.container.*,annualNavigation.*&name=$seoUrl.php&station=$PAGE2" |
---|
100 | if [ -z "$PIC" ]; then |
---|
101 | PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg" |
---|
102 | TMPPIC="default.jpg" |
---|
103 | else |
---|
104 | TMPPIC=nowtv_`echo $PIC | tr '/' '\n' | tail -n1` |
---|
105 | fi |
---|
106 | |
---|
107 | if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then |
---|
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 |
---|
111 | fi |
---|
112 | LINE="$TITLE#$SRC $SRC videos '$NEWPAGE'#$PIC#$TMPPIC#$NAME#0" |
---|
113 | echo "$LINE" >> $TMP/$FILENAME.list |
---|
114 | fi |
---|
115 | fi |
---|
116 | done 3<$TMP/cache.$FILENAME.2 |
---|
117 | rm $TMP/cache.$FILENAME.* > /dev/null 2>&1 |
---|
118 | |
---|
119 | cat $TMP/$FILENAME.list | sort -u > $TMP/$FILENAME.sorted.list |
---|
120 | if [ -e $TMP/$FILENAME.list ];then |
---|
121 | rm $TMP/$FILENAME.list |
---|
122 | fi |
---|
123 | fi |
---|
124 | |
---|
125 | # echo "$TMP/$FILENAME.list" |
---|
126 | echo "$TMP/$FILENAME.sorted.list" |
---|
127 | } |
---|
128 | |
---|
129 | videos() |
---|
130 | { |
---|
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` |
---|
135 | NEWPAGE="v3/containers/$ID/movies?fields=*,format.*,paymentPaytypes.*,livestreamEvent.*,pictures,trailers,packages,annualNavigation&maxPerPage=500&order=OrderWeight+asc,+BroadcastStartDate+desc&page=1" |
---|
136 | |
---|
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 |
---|
139 | |
---|
140 | while read -u 3 ROUND; do |
---|
141 | TITLE=`echo $ROUND | sed 's/"title":/\ntitle=/g' | grep ^title= | head -n1 | cut -d'"' -f2` |
---|
142 | PIC=`echo $ROUND | sed -nr 's/.*"defaultDvdImage":"([^"]+).*/\1/p'` |
---|
143 | # dash working on sh4 libeplayer mipsel/arm need dash patch |
---|
144 | # NEWPAGE=`echo $ROUND | sed -nr 's/.*"dash":"([^"]+).*/\1/p'` |
---|
145 | NEWPAGE=`echo $ROUND | sed -nr 's/.*"hlsclear":"([^"]+).*/\1/p'` |
---|
146 | |
---|
147 | #NEWPAGE="https://vodnowusohls-a.akamaihd.net/proxy/clear/manifest/tvnow/417382-1-17915.ism/fairplay.m3u8?filter=(type%3d%3d%22audio%22)%7c%7c(type%3d%3d%22video%22%26%26systemBitrate%3c1550000)" |
---|
148 | PART1=$(echo "$NEWPAGE" | sed 's!fairplay.m3u8!\n!' | grep ^http) |
---|
149 | PART2=$(echo "$NEWPAGE" | sed -nr 's!.*/tvnow/([^.ism/]+).*!\1!p') |
---|
150 | #echo PART1 $PART1 |
---|
151 | #echo PART2 $PART2 |
---|
152 | |
---|
153 | #https://vodnowusohls.secure.footprint.net/proxy/clear/manifest/tvnow/417382-1-17915.ism/417382-1-17915-audio=128000-video=1400000.m3u8 |
---|
154 | NEWPAGE=$PART1$PART2-audio=128000-video=1400000.m3u8 |
---|
155 | |
---|
156 | if [ -z "$PIC" ]; then |
---|
157 | PIC="http://atemio.dyndns.tv/mediathek/menu/default.jpg" |
---|
158 | TMPPIC="default.jpg" |
---|
159 | else |
---|
160 | TMPPIC=nowtv_`echo $PIC | tr '/' '\n' | tail -n1` |
---|
161 | fi |
---|
162 | |
---|
163 | if [ ! -z "$TITLE" ] && [ ! -z "$NEWPAGE" ];then |
---|
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 |
---|
167 | fi |
---|
168 | LINE="$TITLE#$NEWPAGE#$PIC#$TMPPIC#$NAME#2" |
---|
169 | echo "$LINE" >> $TMP/$FILENAME.list |
---|
170 | fi |
---|
171 | fi |
---|
172 | done 3<$TMP/cache.$FILENAME.4 |
---|
173 | rm $TMP/cache.$FILENAME.* > /dev/null 2>&1 |
---|
174 | fi |
---|
175 | |
---|
176 | echo "$TMP/$FILENAME.list" |
---|
177 | } |
---|
178 | |
---|
179 | case $INPUT in |
---|
180 | init) $INPUT;; |
---|
181 | mainmenu) $INPUT;; |
---|
182 | new) $INPUT;; |
---|
183 | videos) $INPUT;; |
---|
184 | esac |
---|