Changeset 40299 for titan/mediathek/localparser_free/clipfish.sh
- Timestamp:
- 04/15/17 02:46:03 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/mediathek/localparser_free/clipfish.sh
r40297 r40299 8 8 PAGE=$3 9 9 NEXT=$4 10 PAGE2=$5 10 11 PARSER=`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'` 11 12 12 FILENAME="`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'` $INPUT $PAGE $NEXT "13 FILENAME="`echo $SRC | tr '/' '\n' | tail -n1 | sed 's/.sh//'` $INPUT $PAGE $NEXT $PAGE2" 13 14 FILENAME="`echo $FILENAME | sed -e 's/\&\+/./g' -e 's#\/\+#.#g' -e 's/\?\+/./g' -e 's/;\+/./g' -e 's/=\+/./g' -e 's/ \+/./g' -e 's/\.\+/./g'`" 14 15 PICNAME=`echo $FILENAME` … … 41 42 mainmenu() 42 43 { 43 echo "Suchen#$SRC $SRC search 'devmobileapp/searchvideos/%search%/mostrecent/1/16' 1#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >$TMP/$FILENAME.list 44 echo "$TMP/$FILENAME.list" 45 } 46 47 search() 44 echo "Kategorien#$SRC $SRC category '/devmobileapp/metachannels' 1#http://atemio.dyndns.tv/mediathek/menu/category.jpg#category.jpg#$NAME#0" >$TMP/$FILENAME.list 45 echo "Suchen#$SRC $SRC search '/devmobileapp/searchvideos/%search%/mostrecent/' 1 '/16'#http://atemio.dyndns.tv/mediathek/menu/search.jpg#search.jpg#$NAME#112" >>$TMP/$FILENAME.list 46 echo "$TMP/$FILENAME.list" 47 } 48 49 category() 48 50 { 49 51 # if [ ! -e "$TMP/$FILENAME.list" ]; then 50 $curlbin -o - $URL /$PAGE | sed 's/{"video_id":/\n{"video_id":/g' | awk -v SRC=$SRC -v NAME=$NAME -v PICNAME=$PICNAME -v INPUT=$INPUT -v PAGE=$PAGE -v NEXT=$NEXT \52 $curlbin -o - $URL$PAGE | sed -e 's!</html>\[{"id"!</html>\[{"id"\nfound={"id"!g' -e 's/}],/\nfound=/g' | awk -v SRC=$SRC -v NAME=$NAME -v PICNAME=$PICNAME -v INPUT=$INPUT -v PAGE=$PAGE -v NEXT=$NEXT \ 51 53 ' 52 54 # BEGIN variable setzen … … 57 59 pages = "1" 58 60 } 59 /"video_id"/ \ 60 { 61 # print "1111111" $0 61 /"id"/ \ 62 { 63 i = index($0, "\"id\":\"") + 6 64 j = index(substr($0, i), "\",\"") - 1 65 id = substr($0, i, j) 66 67 i = index($0, "\"specials\":\"") + 9 68 j = index(substr($0, i), "\",\"") - 1 69 title1 = substr($0, i, j) 70 62 71 i = index($0, "\"title\":\"") + 9 63 72 j = index(substr($0, i), "\",\"") - 1 64 73 title = substr($0, i, j) 65 # print "title: " title66 67 74 68 75 i = index($0, "\"media_length\":\"") + 16 69 76 j = index(substr($0, i), "\",\"") - 1 70 77 duration = substr($0, i, j) 71 # print "duration: " duration 72 73 74 i = index($0, "\"pubDate\":\"") + 11 75 j = index(substr($0, i), "\",\"") - 1 76 extra = substr($0, i, j) 77 # print "extra: " extra 78 79 i = index($0, "\"video_url_edge_quality\":\"") + 26 78 79 i = index($0, "\"id\":\"") + 6 80 80 j = index(substr($0, i), "\"") - 1 81 81 newpage = substr($0, i, j) 82 82 83 if (newpage == "")84 {85 i = index($0, "\"video_url_wifi_quality\":\"") + 2686 j = index(substr($0, i), "\"") - 187 newpage = substr($0, i, j)88 }89 if (newpage == "")90 {91 i = index($0, "\"media_videourl_hls\":\"") + 2292 j = index(substr($0, i), "\"") - 193 newpage = substr($0, i, j)94 }95 83 gsub(/\\/, "", newpage, newpage) 96 84 97 # print "newpage: " newpage 98 99 i = index($0, "\"media_content_thumbnail_large\":\"") + 33 100 j = index(substr($0, i), "\"") - 1 101 pic = substr($0, i, j) 102 gsub(/\\/, "", pic, pic) 103 # print "pic: " pic 85 pic = "http://atemio.dyndns.tv/mediathek/menu/" 104 86 105 87 piccount += 1 106 if ( pic == "" ) 107 { 108 pic = "http://atemio.dyndns.tv/mediathek/menu/default.jpg" 109 } 110 # print title " (" extra ")#" SRC " " SRC " hoster \x27" newpage "\x27#" pic "#" PICNAME "." piccount ".jpg#" NAME "#111" 111 print title " (" duration "s) (" extra ")#" newpage "#" pic "#" PICNAME "." piccount ".jpg#" NAME "#2" 88 print title "#" SRC " " SRC " submenu \x27/devmobileapp/metachannels\x27" newpage "#" pic tolower(title) ".jpg#" PICNAME "." piccount ".jpg#" NAME "#2" 112 89 113 90 next … … 125 102 } 126 103 104 submenu() 105 { 106 # if [ ! -e "$TMP/$FILENAME.list" ]; then 107 # $curlbin -o - $URL$PAGE | sed -e 's!</html>\[{"id"!</html>\[{"id"\nfound1={"id"!g' -e 's/}],/\nfound1=/g' | grep \"id\":\"$NEXT\" | sed -e 's/:\[{/\nfound=}/g' -e 's/},{/\nfound=},{/g' | grep found= > /tmp/localparser/777 108 echo URL $URL 109 echo PAGE $PAGE 110 111 echo NEXT $NEXT 112 echo PAGE2 $PAGE2 113 $curlbin -o - $URL$PAGE | sed -e 's!</html>\[{"id"!</html>\[{"id"\nfound1={"id"!g' -e 's/}],/\nfound1=/g' | grep \"id\":\"$NEXT\" | sed -e 's/:\[{/\nfound=}/g' -e 's/},{/\nfound=},{/g' | grep found= | awk -v SRC=$SRC -v NAME=$NAME -v PICNAME=$PICNAME -v INPUT=$INPUT -v PAGE=$PAGE -v NEXT=$NEXT \ 114 ' 115 # BEGIN variable setzen 116 BEGIN 117 { 118 # setzt suchvariable auf 0 vor dem start 119 piccount = 0 120 pages = "1" 121 # print "000000" $0 122 } 123 /"id"/ \ 124 { 125 i = index($0, "\"id\":\"") + 6 126 j = index(substr($0, i), "\",\"") - 1 127 id = substr($0, i, j) 128 129 if(id == "=},{") 130 { 131 i = index($0, "\"id\":") + 5 132 j = index(substr($0, i), ",\"") - 1 133 id = substr($0, i, j) 134 } 135 # print "id: " id 136 137 i = index($0, "\"title\":\"") + 9 138 j = index(substr($0, i), "\",\"") - 1 139 title = substr($0, i, j) 140 # print "title: " title 141 142 i = index($0, "\"id\":\"") + 6 143 j = index(substr($0, i), "\"") - 1 144 newpage = substr($0, i, j) 145 146 if(newpage == "=},{") 147 { 148 i = index($0, "\"id\":") + 5 149 j = index(substr($0, i), ",\"") - 1 150 newpage = substr($0, i, j) 151 } 152 153 gsub(/\\/, "", newpage, newpage) 154 155 # print "newpage: " newpage 156 157 i = index($0, "\"img_thumbnail\":\"") + 17 158 j = index(substr($0, i), "\"") - 1 159 pic = substr($0, i, j) 160 gsub(/\\/, "", pic, pic) 161 162 piccount += 1 163 if ( pic == "" ) 164 { 165 # pic = "http://atemio.dyndns.tv/mediathek/menu/default.jpg" 166 pic = "http://atemio.dyndns.tv/mediathek/menu/" tolower(title) ".jpg#" 167 } 168 print title "#" SRC " " SRC " search \x27/devmobileapp/specialvideos/" newpage "/mostrecent/\x27 1 \x27/16\x27#" pic "#" PICNAME "." piccount ".jpg#" NAME "#2" 169 170 next 171 } 172 END 173 { 174 # if (curpage != pages) 175 # print "Page (" NEXT + 1 "/" pages ")#" SRC " " SRC " " INPUT " \x27" PAGE "\x27 " NEXT + 1 "#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#" NAME "#0" 176 } 177 # schreibe alles in die list datei 178 ' >$TMP/$FILENAME.list 179 # fi 180 # gebe titan den list namen mit pfad zurueck 181 echo "$TMP/$FILENAME.list" 182 } 183 184 search() 185 { 186 # if [ ! -e "$TMP/$FILENAME.list" ]; then 187 #$curlbin -o - $URL/$PAGE > /tmp/localparser/888 188 #$curlbin -o - $URL$PAGE > /tmp/localparser/888 189 190 $curlbin -o - $URL$PAGE$NEXT$PAGE2 | sed 's/{"video_id":/\n{"video_id":/g' | awk -v SRC=$SRC -v NAME=$NAME -v PICNAME=$PICNAME -v INPUT=$INPUT -v PAGE=$PAGE -v NEXT=$NEXT \ 191 ' 192 # BEGIN variable setzen 193 BEGIN 194 { 195 # setzt suchvariable auf 0 vor dem start 196 piccount = 0 197 pages = "1" 198 } 199 /"video_id"/ \ 200 { 201 # print "1111111" $0 202 i = index($0, "\"title\":\"") + 9 203 j = index(substr($0, i), "\",\"") - 1 204 title = substr($0, i, j) 205 # print "title: " title 206 207 208 i = index($0, "\"media_length\":\"") + 16 209 j = index(substr($0, i), "\",\"") - 1 210 duration = substr($0, i, j) 211 # print "duration: " duration 212 213 214 i = index($0, "\"pubDate\":\"") + 11 215 j = index(substr($0, i), "\",\"") - 1 216 extra = substr($0, i, j) 217 # print "extra: " extra 218 219 i = index($0, "\"video_url_edge_quality\":\"") + 26 220 j = index(substr($0, i), "\"") - 1 221 newpage = substr($0, i, j) 222 223 if (newpage == "") 224 { 225 i = index($0, "\"video_url_wifi_quality\":\"") + 26 226 j = index(substr($0, i), "\"") - 1 227 newpage = substr($0, i, j) 228 } 229 if (newpage == "") 230 { 231 i = index($0, "\"media_videourl_hls\":\"") + 22 232 j = index(substr($0, i), "\"") - 1 233 newpage = substr($0, i, j) 234 } 235 gsub(/\\/, "", newpage, newpage) 236 237 # print "newpage: " newpage 238 239 i = index($0, "\"media_content_thumbnail_large\":\"") + 33 240 j = index(substr($0, i), "\"") - 1 241 pic = substr($0, i, j) 242 gsub(/\\/, "", pic, pic) 243 # print "pic: " pic 244 245 piccount += 1 246 if ( pic == "" ) 247 { 248 pic = "http://atemio.dyndns.tv/mediathek/menu/default.jpg" 249 } 250 # print title " (" extra ")#" SRC " " SRC " hoster \x27" newpage "\x27#" pic "#" PICNAME "." piccount ".jpg#" NAME "#111" 251 print title " (" duration "s) (" extra ")#" newpage "#" pic "#" PICNAME "." piccount ".jpg#" NAME "#2" 252 253 next 254 } 255 END 256 { 257 # if (curpage != pages) 258 # print "Page (" NEXT + 1 "/" pages ")#" SRC " " SRC " " INPUT " \x27" PAGE "\x27 " NEXT + 1 "#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#" NAME "#0" 259 print "Page (" NEXT + 1 "/" pages ")#" SRC " " SRC " " INPUT " \x27" PAGE "\x27 " NEXT + 1 " \x27/16\x27#http://atemio.dyndns.tv/mediathek/menu/next.jpg#next.jpg#" NAME "#0" 260 261 262 } 263 # schreibe alles in die list datei 264 ' >$TMP/$FILENAME.list 265 # fi 266 # gebe titan den list namen mit pfad zurueck 267 echo "$TMP/$FILENAME.list" 268 } 269 127 270 case $INPUT in 128 271 init) $INPUT;; 129 272 mainmenu) $INPUT;; 130 273 search) $INPUT;; 274 category) $INPUT;; 275 submenu) $INPUT;; 131 276 esac
Note: See TracChangeset
for help on using the changeset viewer.