[18060] | 1 | #ifndef KINOX_H |
---|
| 2 | #define KINOX_H |
---|
| 3 | |
---|
| 4 | // flag 1 = putlocker/sockshare |
---|
| 5 | // flag 2 = filenuke |
---|
| 6 | |
---|
[24251] | 7 | char* kinox(char* link) |
---|
[18060] | 8 | { |
---|
[24251] | 9 | debug(99, "link: %s", link); |
---|
[24396] | 10 | char* streamurl = NULL; |
---|
[18060] | 11 | |
---|
[24396] | 12 | streamurl = hoster(link); |
---|
[40117] | 13 | // debug(99, "streamurl1: %s", streamurl); |
---|
[18060] | 14 | |
---|
[40117] | 15 | // streamurl = string_replace_all("amp;", "", streamurl, 1); |
---|
| 16 | // debug(99, "streamurl2: %s", streamurl); |
---|
[18060] | 17 | |
---|
| 18 | return streamurl; |
---|
| 19 | } |
---|
| 20 | |
---|
[20836] | 21 | int kinox_search(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag) |
---|
[18060] | 22 | { |
---|
[18398] | 23 | int ret = 1; |
---|
[24237] | 24 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
[20837] | 25 | |
---|
[18398] | 26 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
| 27 | return ret; |
---|
| 28 | |
---|
[20102] | 29 | char* search = NULL; |
---|
[20836] | 30 | if(flag == 0) |
---|
| 31 | { |
---|
| 32 | if(searchstr == NULL) |
---|
[27270] | 33 | search = textinputhist(_("Search"), " ", "searchhist"); |
---|
[20836] | 34 | else |
---|
[27270] | 35 | search = textinputhist(_("Search"), searchstr, "searchhist"); |
---|
[20836] | 36 | } |
---|
[20102] | 37 | else |
---|
[20836] | 38 | search = ostrcat(link, NULL, 0, 0); |
---|
| 39 | |
---|
[18060] | 40 | if(search != NULL) |
---|
| 41 | { |
---|
| 42 | drawscreen(load, 0, 0); |
---|
| 43 | char* tmpstr = NULL; |
---|
| 44 | char* tmpstr1 = NULL; |
---|
| 45 | char* line = NULL; |
---|
| 46 | char* pic = NULL; |
---|
| 47 | char* title = NULL; |
---|
| 48 | char* lang = NULL; |
---|
| 49 | char* langck = NULL; |
---|
| 50 | char* from = NULL; |
---|
| 51 | char* url = NULL; |
---|
| 52 | char* ip = NULL; |
---|
| 53 | char* path = NULL; |
---|
[18069] | 54 | char* menu = NULL; |
---|
[18060] | 55 | |
---|
[24319] | 56 | search = strstrip(search); |
---|
| 57 | search = stringreplacechar(search, ' ', '+'); |
---|
| 58 | debug(99, "search: %s", search); |
---|
| 59 | |
---|
[30871] | 60 | ip = ostrcat("kinox.me", NULL, 0, 0); |
---|
[20836] | 61 | if(flag == 0) |
---|
| 62 | path = ostrcat("Search.html?q=", search, 0, 0); |
---|
| 63 | else |
---|
[30871] | 64 | path = string_replace_all("http://kinox.me/", "", search, 0); |
---|
[20836] | 65 | |
---|
[19884] | 66 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
[18060] | 67 | tmpstr = string_resub("<div id=\"beep\" class=\"beep\"></div>", "</table>", tmpstr, 0); |
---|
| 68 | |
---|
[28962] | 69 | titheklog(debuglevel, "/tmp/kinox1_tmpstr", NULL, NULL, NULL, tmpstr); |
---|
[24237] | 70 | |
---|
[18060] | 71 | int count = 0; |
---|
| 72 | int incount = 0; |
---|
| 73 | int i = 0; |
---|
| 74 | struct splitstr* ret1 = NULL; |
---|
| 75 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
| 76 | |
---|
| 77 | if(ret1 != NULL) |
---|
| 78 | { |
---|
| 79 | int max = count; |
---|
| 80 | for(i = 0; i < max; i++) |
---|
| 81 | { |
---|
| 82 | if(oregex(".*src=\"/gr/sys/lng/(.*)\" alt=\"language\"></td>.*", ret1[i].part) != NULL) |
---|
| 83 | { |
---|
| 84 | free(langck), langck = NULL; |
---|
| 85 | langck = oregex(".*src=\"/gr/sys/lng/(.*)\" alt=\"language\"></td>.*", ret1[i].part); |
---|
| 86 | } |
---|
| 87 | |
---|
| 88 | if(oregex(".*<td class=\"Title\"><a href=\"(.*)\" onclick=.*", ret1[i].part) != NULL) |
---|
| 89 | { |
---|
[22339] | 90 | int rcret = waitrc(NULL, 10, 0); |
---|
| 91 | if(rcret == getrcconfigint("rcexit", NULL)) break; |
---|
[18060] | 92 | free(path), path = NULL; |
---|
| 93 | path = oregex(".*<td class=\"Title\"><a href=\"(.*)\" onclick=.*", ret1[i].part); |
---|
| 94 | |
---|
| 95 | if(ostrstr(langck, "1.png") != NULL) |
---|
| 96 | lang = ostrcat(lang, " (de)", 1, 0); |
---|
| 97 | else if(ostrstr(langck, "2.png") != NULL) |
---|
| 98 | lang = ostrcat(lang, " (en)", 1, 0); |
---|
| 99 | else |
---|
| 100 | lang = ostrcat(lang, " (\?\?)", 1, 0); |
---|
| 101 | |
---|
[30871] | 102 | tmpstr1 = gethttp("kinox.me", path, 80, NULL, NULL, 10000, NULL, 0); |
---|
[18060] | 103 | |
---|
| 104 | from = ostrcat("<div class=\"Grahpics\"><a href=\"", path, 0, 0); |
---|
| 105 | from = ostrcat(from, "\"><img src=\"", 1, 0); |
---|
| 106 | |
---|
[18065] | 107 | pic = string_resub(from, "\" alt=\"", tmpstr1, 0); |
---|
[18060] | 108 | |
---|
| 109 | if(pic == NULL) |
---|
| 110 | pic = ostrcat("dummy", NULL, 0, 0); |
---|
| 111 | |
---|
| 112 | title = ostrcat(path, NULL, 0, 0); |
---|
| 113 | title = string_replace_all("/Stream/", "", title, 1); |
---|
| 114 | title = string_replace_all(".html", "", title, 1); |
---|
| 115 | title = stringreplacechar(title, '_', ' '); |
---|
| 116 | title = ostrcat(title , lang, 1, 0); |
---|
| 117 | |
---|
[30871] | 118 | url = ostrcat("http://kinox.me", path, 0, 0); |
---|
[18060] | 119 | |
---|
| 120 | debug(99, "---------------------------"); |
---|
| 121 | debug(99, "langck: %s", langck); |
---|
| 122 | debug(99, "pic: %s", pic); |
---|
| 123 | debug(99, "title: %s", title); |
---|
| 124 | debug(99, "url: %s", url); |
---|
| 125 | debug(99, "---------------------------"); |
---|
| 126 | |
---|
| 127 | if(url != NULL) |
---|
| 128 | { |
---|
| 129 | incount += 1; |
---|
| 130 | line = ostrcat(line, title, 1, 0); |
---|
| 131 | line = ostrcat(line, "#", 1, 0); |
---|
| 132 | line = ostrcat(line, url, 1, 0); |
---|
[32294] | 133 | line = ostrcat(line, "#http://kinox.me/", 1, 0); |
---|
[18060] | 134 | line = ostrcat(line, pic, 1, 0); |
---|
| 135 | line = ostrcat(line, "#kinox_search_", 1, 0); |
---|
[20483] | 136 | line = ostrcat(line, oitoa(incount + time(NULL)), 1, 1); |
---|
[18060] | 137 | line = ostrcat(line, ".jpg#KinoX - Search#22\n", 1, 0); |
---|
| 138 | } |
---|
| 139 | free(url), url = NULL; |
---|
| 140 | free(path), path = NULL; |
---|
| 141 | free(title), title = NULL; |
---|
| 142 | free(pic), pic = NULL; |
---|
| 143 | free(from), from = NULL; |
---|
[18065] | 144 | free(tmpstr1), tmpstr1 = NULL; |
---|
[18060] | 145 | free(lang), lang = NULL; |
---|
| 146 | free(langck), langck = NULL; |
---|
| 147 | } |
---|
| 148 | } |
---|
| 149 | free(ret1), ret1 = NULL; |
---|
| 150 | if(line != NULL) |
---|
| 151 | { |
---|
[25161] | 152 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
[27691] | 153 | menu = ostrcat("/tmp/tithek/kinox.search.", oitoa(time(NULL)), 0, 1); |
---|
| 154 | menu = ostrcat(menu, ".list", 1, 0); |
---|
| 155 | |
---|
[18069] | 156 | writesys(menu, line, 0); |
---|
[19535] | 157 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
| 158 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
[18398] | 159 | ret = 0; |
---|
[18060] | 160 | } |
---|
| 161 | |
---|
| 162 | } |
---|
| 163 | free(tmpstr), tmpstr = NULL; |
---|
| 164 | free(ip), ip = NULL; |
---|
| 165 | } |
---|
| 166 | free(search), search = NULL; |
---|
[18398] | 167 | return ret; |
---|
[18060] | 168 | } |
---|
| 169 | |
---|
[25158] | 170 | int kinox_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag) |
---|
| 171 | { |
---|
| 172 | char* tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *menu = NULL, *search = NULL; |
---|
| 173 | int ret = 1, count = 0, i = 0; |
---|
| 174 | |
---|
| 175 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
| 176 | return ret; |
---|
| 177 | |
---|
| 178 | if(searchstr == NULL) |
---|
[27270] | 179 | search = textinputhist(_("Search"), " ", "searchhist"); |
---|
[25158] | 180 | else |
---|
[27270] | 181 | search = textinputhist(_("Search"), searchstr, "searchhist"); |
---|
[25158] | 182 | |
---|
| 183 | if(search != NULL) |
---|
| 184 | { |
---|
| 185 | drawscreen(load, 0, 0); |
---|
| 186 | |
---|
| 187 | strstrip(search); |
---|
| 188 | string_tolower(search); |
---|
| 189 | |
---|
| 190 | tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/kinox/streams/kinox.all-sorted.list", 80, NULL, HTTPAUTH, 5000, NULL, 0); |
---|
| 191 | |
---|
| 192 | struct splitstr* ret1 = NULL; |
---|
| 193 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
| 194 | |
---|
| 195 | if(ret1 != NULL) |
---|
| 196 | { |
---|
| 197 | int max = count; |
---|
| 198 | for(i = 0; i < max; i++) |
---|
| 199 | { |
---|
| 200 | |
---|
| 201 | tmpstr1 = ostrcat(ret1[i].part, NULL, 0, 0); |
---|
| 202 | tmpstr1 = stringreplacecharonce(tmpstr1, '#', '\0'); |
---|
| 203 | string_tolower(tmpstr1); |
---|
| 204 | |
---|
| 205 | if(ostrstr(tmpstr1, search) != NULL) |
---|
| 206 | { |
---|
| 207 | printf("found: %s\n", ret1[i].part); |
---|
| 208 | int rcret = waitrc(NULL, 10, 0); |
---|
| 209 | if(rcret == getrcconfigint("rcexit", NULL)) break; |
---|
| 210 | |
---|
| 211 | line = ostrcat(line, ret1[i].part, 1, 0); |
---|
| 212 | line = ostrcat(line, "\n", 0, 0); |
---|
| 213 | } |
---|
| 214 | free(tmpstr1), tmpstr1 = NULL; |
---|
| 215 | } |
---|
| 216 | free(ret1), ret1 = NULL; |
---|
| 217 | |
---|
| 218 | if(line != NULL) |
---|
| 219 | { |
---|
[25161] | 220 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
[27691] | 221 | menu = ostrcat("/tmp/tithek/kinox.search.", oitoa(time(NULL)), 0, 1); |
---|
| 222 | menu = ostrcat(menu, ".list", 1, 0); |
---|
| 223 | |
---|
[25158] | 224 | writesys(menu, line, 0); |
---|
| 225 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
| 226 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
| 227 | ret = 0; |
---|
| 228 | } |
---|
| 229 | } |
---|
| 230 | free(tmpstr), tmpstr = NULL; |
---|
| 231 | } |
---|
| 232 | free(search), search = NULL; |
---|
| 233 | return ret; |
---|
| 234 | } |
---|
| 235 | |
---|
[18398] | 236 | int kinox_hoster(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title) |
---|
[18060] | 237 | { |
---|
| 238 | debug(99, "link: %s", link); |
---|
[24237] | 239 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
[18399] | 240 | int ret = 1, series = 0; |
---|
[24396] | 241 | char* ip = NULL, *pos = NULL, *path = NULL, *tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *tmpstr3 = NULL, *pichname = NULL; |
---|
| 242 | char* tmpstr4 = NULL, *tmpstr5 = NULL, *line = NULL, *url = NULL, *url2 = NULL, *url3 = NULL, *url4 = NULL, *pathnew = NULL, *extra = NULL; |
---|
[18398] | 243 | |
---|
| 244 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
| 245 | return ret; |
---|
| 246 | |
---|
[18060] | 247 | ip = string_replace("http://", "", (char*)link, 0); |
---|
| 248 | |
---|
| 249 | if(ip != NULL) |
---|
| 250 | pos = strchr(ip, '/'); |
---|
| 251 | if(pos != NULL) |
---|
| 252 | { |
---|
| 253 | pos[0] = '\0'; |
---|
| 254 | path = pos + 1; |
---|
| 255 | } |
---|
| 256 | |
---|
[19884] | 257 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
[28962] | 258 | titheklog(debuglevel, "/tmp/kinox2_tmpstr", NULL, NULL, NULL, tmpstr); |
---|
[18070] | 259 | |
---|
| 260 | if(tmpstr != NULL) |
---|
[18060] | 261 | { |
---|
[18070] | 262 | drawscreen(load, 0, 0); |
---|
| 263 | if(ostrstr(tmpstr, "SeriesID") != NULL) |
---|
[18060] | 264 | { |
---|
[18070] | 265 | char* pos1 = NULL; |
---|
| 266 | char* from = NULL; |
---|
| 267 | char* folgen = NULL; |
---|
| 268 | int i; |
---|
[18399] | 269 | |
---|
| 270 | series = 1; |
---|
[19951] | 271 | |
---|
[18070] | 272 | for(i = 1; i < 30; i++) |
---|
| 273 | { |
---|
| 274 | from = ostrcat(from, "<option value=\"", 1, 0); |
---|
| 275 | from = ostrcat(from, oitoa(i), 1, 0); |
---|
| 276 | from = ostrcat(from, "\" rel=", 1, 0); |
---|
| 277 | |
---|
| 278 | pos1 = ostrstr(tmpstr, from); |
---|
| 279 | folgen = getxmlentry(ostrstr(tmpstr, from), "rel="); |
---|
[21361] | 280 | printf("Season %d folgen: %s\n",i , folgen); |
---|
[20837] | 281 | |
---|
[18070] | 282 | if(folgen != NULL) |
---|
[18060] | 283 | { |
---|
[18070] | 284 | int count = 0; |
---|
| 285 | int incount = 0; |
---|
| 286 | int j; |
---|
| 287 | struct splitstr* ret1 = NULL; |
---|
| 288 | ret1 = strsplit(folgen, ",", &count); |
---|
| 289 | |
---|
| 290 | if(ret1 != NULL && count > 0) |
---|
| 291 | { |
---|
| 292 | int max = count + 1; |
---|
| 293 | for(j = 1; j < max; j++) |
---|
| 294 | { |
---|
| 295 | incount += 1; |
---|
[21361] | 296 | line = ostrcat(line, _("Season"), 1, 0); |
---|
[18070] | 297 | line = ostrcat(line, " ", 1, 0); |
---|
| 298 | line = ostrcat(line, oitoa(i), 1, 0); |
---|
| 299 | line = ostrcat(line, " ", 1, 0); |
---|
| 300 | line = ostrcat(line, _("Episode"), 1, 0); |
---|
| 301 | line = ostrcat(line, " ", 1, 0); |
---|
| 302 | line = ostrcat(line, oitoa(j), 1, 0); |
---|
| 303 | line = ostrcat(line, "#", 1, 0); |
---|
| 304 | line = ostrcat(line, link, 1, 0); |
---|
| 305 | line = ostrcat(line, ";", 1, 0); |
---|
| 306 | line = ostrcat(line, oitoa(i), 1, 0); |
---|
| 307 | line = ostrcat(line, ";", 1, 0); |
---|
| 308 | line = ostrcat(line, oitoa(j), 1, 0); |
---|
| 309 | line = ostrcat(line, "#", 1, 0); |
---|
| 310 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/s", 1, 0); |
---|
| 311 | line = ostrcat(line, oitoa(i), 1, 0); |
---|
| 312 | line = ostrcat(line, "e", 1, 0); |
---|
| 313 | line = ostrcat(line, oitoa(j), 1, 0); |
---|
| 314 | line = ostrcat(line, ".jpg", 1, 0); |
---|
[22216] | 315 | line = ostrcat(line, "#kinox_search_", 1, 0); |
---|
[18070] | 316 | line = ostrcat(line, oitoa(i), 1, 0); |
---|
| 317 | line = ostrcat(line, "e", 1, 0); |
---|
| 318 | line = ostrcat(line, oitoa(j), 1, 0); |
---|
| 319 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
| 320 | line = ostrcat(line, title, 1, 0); |
---|
| 321 | line = ostrcat(line, "#23\n", 1, 0); |
---|
| 322 | } |
---|
[18060] | 323 | } |
---|
[18070] | 324 | free(ret1), ret1 = NULL; |
---|
| 325 | } |
---|
| 326 | free(from), from = NULL; |
---|
| 327 | free(folgen), folgen = NULL; |
---|
| 328 | } |
---|
[18060] | 329 | } |
---|
[18070] | 330 | else |
---|
[18060] | 331 | { |
---|
[18070] | 332 | tmpstr = string_resub("<ul id=\"HosterList\" class=\"Sortable\">", "</ul>", tmpstr, 0); |
---|
[28962] | 333 | titheklog(debuglevel, "/tmp/kinox3_tmpstr", NULL, NULL, NULL, tmpstr); |
---|
[18070] | 334 | |
---|
[24251] | 335 | int type = 14; |
---|
[18070] | 336 | int count = 0; |
---|
| 337 | int incount = 0; |
---|
| 338 | int i; |
---|
| 339 | struct splitstr* ret1 = NULL; |
---|
| 340 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
| 341 | |
---|
| 342 | char* hname = NULL; |
---|
| 343 | char* hnr = NULL; |
---|
| 344 | char* hlink = NULL; |
---|
[24396] | 345 | |
---|
[18070] | 346 | if(ret1 != NULL && count > 0) |
---|
[18060] | 347 | { |
---|
[18070] | 348 | int max = count; |
---|
| 349 | for(i = 0; i < max; i++) |
---|
[18060] | 350 | { |
---|
[40861] | 351 | char *mirrormaxtmp = NULL; |
---|
| 352 | char *pathnewtmp = NULL; |
---|
[40864] | 353 | int mirrormax = 1; |
---|
| 354 | int j = 0; |
---|
| 355 | |
---|
[40861] | 356 | mirrormaxtmp = oregex("<b>Mirror</b>: .*/(.*)<br/>.*", ret1[i].part); |
---|
| 357 | |
---|
[40864] | 358 | if(mirrormaxtmp != NULL) |
---|
| 359 | mirrormax = atoi(mirrormaxtmp); |
---|
[40861] | 360 | |
---|
[40864] | 361 | for(j = 1; j < mirrormax + 1; j++) |
---|
| 362 | { |
---|
| 363 | debug(99, "(%d/%d) (%d/%d) ret1[i].part: %s",i ,max ,j ,mirrormax, ret1[i].part); |
---|
[40861] | 364 | |
---|
[40864] | 365 | hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0); |
---|
[40861] | 366 | |
---|
[40864] | 367 | hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0); |
---|
| 368 | hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); |
---|
| 369 | hlink = ostrcat(hlink, "Mirror=", 0, 0); |
---|
[40861] | 370 | |
---|
[40864] | 371 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
| 372 | pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
[40861] | 373 | |
---|
| 374 | pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1); |
---|
[40864] | 375 | debug(99, "(%d/%d) (%d/%d)hnr: %s hlink: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,hname ,pathnewtmp); |
---|
[40861] | 376 | free(pathnewtmp), pathnewtmp= NULL; |
---|
[24396] | 377 | |
---|
[40861] | 378 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
| 379 | string_tolower(pichname); |
---|
| 380 | pichname = stringreplacecharonce(pichname, '.', '\0'); |
---|
[19951] | 381 | |
---|
[40861] | 382 | extra = string_resub("<b>Vom</b>: ", "</div>", ret1[i].part, 0); |
---|
[39362] | 383 | |
---|
[40861] | 384 | titheklog(debuglevel, "/tmp/kinox4_pathnew1", hname, NULL, NULL, pathnew); |
---|
[40864] | 385 | |
---|
[40861] | 386 | tmpstr1 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
| 387 | if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL) |
---|
| 388 | { |
---|
| 389 | sleep(1); |
---|
| 390 | tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
| 391 | } |
---|
| 392 | if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL) |
---|
| 393 | { |
---|
| 394 | sleep(1); |
---|
| 395 | tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
| 396 | } |
---|
| 397 | if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL) |
---|
| 398 | { |
---|
| 399 | sleep(1); |
---|
| 400 | tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
| 401 | } |
---|
| 402 | if(ostrstr(tmpstr1, "503 Service Temporarily Unavailable") != NULL) |
---|
| 403 | { |
---|
| 404 | sleep(1); |
---|
| 405 | tmpstr1 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
| 406 | } |
---|
| 407 | free(pathnew), pathnew = NULL; |
---|
[19951] | 408 | |
---|
[40861] | 409 | titheklog(debuglevel, "/tmp/kinox5_tmpstr1", hname, NULL, NULL, tmpstr1); |
---|
[19951] | 410 | |
---|
[40861] | 411 | tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); |
---|
| 412 | if(ostrstr(tmpstr1, "iframe src") != NULL) |
---|
| 413 | url = string_resub("<iframe src=\"", "\"", tmpstr1, 0); |
---|
| 414 | else |
---|
| 415 | url = string_resub("<a href=\"", "\"", tmpstr1, 0); |
---|
[19951] | 416 | |
---|
[40861] | 417 | //url = ostrcat(tmpstr1, NULL, 0, 0); |
---|
| 418 | //////////////// |
---|
| 419 | /* |
---|
| 420 | free(pathnew), pathnew = NULL; |
---|
| 421 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
| 422 | pathnew = ostrcat(pathnew, "&Part=2", 1, 0); |
---|
| 423 | |
---|
| 424 | titheklog(debuglevel, "/tmp/kinox6_pathnew2", hname, NULL, NULL, pathnew); |
---|
[20846] | 425 | |
---|
[40861] | 426 | tmpstr3 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
| 427 | if(ostrstr(tmpstr3, "503 Service Temporarily Unavailable") != NULL) |
---|
| 428 | { |
---|
| 429 | sleep(1); |
---|
| 430 | tmpstr3 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
| 431 | } |
---|
| 432 | free(pathnew), pathnew = NULL; |
---|
[20846] | 433 | |
---|
[40861] | 434 | titheklog(debuglevel, "/tmp/kinox7_tmpstr3", hname, NULL, NULL, tmpstr3); |
---|
[20846] | 435 | |
---|
[40861] | 436 | tmpstr3 = string_replace_all("\\", "", tmpstr3, 1); |
---|
| 437 | if(ostrstr(tmpstr3, "iframe src") != NULL) |
---|
| 438 | url2 = string_resub("<iframe src=\"", "\"", tmpstr3, 0); |
---|
| 439 | else |
---|
| 440 | url2 = string_resub("<a href=\"", "\"", tmpstr3, 0); |
---|
| 441 | // url2 = ostrcat(tmpstr3, NULL, 0, 0); |
---|
| 442 | //////////////// |
---|
| 443 | free(pathnew), pathnew = NULL; |
---|
| 444 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
| 445 | pathnew = ostrcat(pathnew, "&Part=3", 1, 0); |
---|
[20846] | 446 | |
---|
[40861] | 447 | titheklog(debuglevel, "/tmp/kinox6_pathnew3", hname, NULL, NULL, pathnew); |
---|
[20846] | 448 | |
---|
[40861] | 449 | tmpstr4 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
| 450 | if(ostrstr(tmpstr4, "503 Service Temporarily Unavailable") != NULL) |
---|
| 451 | { |
---|
| 452 | sleep(1); |
---|
| 453 | tmpstr4 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
| 454 | } |
---|
| 455 | free(pathnew), pathnew = NULL; |
---|
[20846] | 456 | |
---|
[40861] | 457 | titheklog(debuglevel, "/tmp/kinox7_tmpstr4", hname, NULL, NULL, tmpstr4); |
---|
[20846] | 458 | |
---|
[40861] | 459 | tmpstr4 = string_replace_all("\\", "", tmpstr4, 1); |
---|
| 460 | if(ostrstr(tmpstr4, "iframe src") != NULL) |
---|
| 461 | url3 = string_resub("<iframe src=\"", "\"", tmpstr4, 0); |
---|
| 462 | else |
---|
| 463 | url3 = string_resub("<a href=\"", "\"", tmpstr4, 0); |
---|
| 464 | // url3 = ostrcat(tmpstr4, NULL, 0, 0); |
---|
| 465 | //////////////// |
---|
| 466 | free(pathnew), pathnew = NULL; |
---|
| 467 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
| 468 | pathnew = ostrcat(pathnew, "&Part=4", 1, 0); |
---|
[24251] | 469 | |
---|
[40861] | 470 | titheklog(debuglevel, "/tmp/kinox6_pathnew4", hname, NULL, NULL, pathnew); |
---|
[39365] | 471 | |
---|
[40861] | 472 | tmpstr5 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
| 473 | if(ostrstr(tmpstr5, "503 Service Temporarily Unavailable") != NULL) |
---|
| 474 | { |
---|
| 475 | sleep(1); |
---|
| 476 | tmpstr5 = gethttp("kinox.to", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
| 477 | } |
---|
| 478 | free(pathnew), pathnew = NULL; |
---|
[19951] | 479 | |
---|
[40861] | 480 | titheklog(debuglevel, "/tmp/kinox7_tmpstr5", hname, NULL, NULL, tmpstr5); |
---|
[24396] | 481 | |
---|
[40861] | 482 | tmpstr5 = string_replace_all("\\", "", tmpstr5, 1); |
---|
| 483 | if(ostrstr(tmpstr5, "iframe src") != NULL) |
---|
| 484 | url4 = string_resub("<iframe src=\"", "\"", tmpstr5, 0); |
---|
| 485 | else |
---|
| 486 | url4 = string_resub("<a href=\"", "\"", tmpstr5, 0); |
---|
| 487 | // url4 = ostrcat(tmpstr5, NULL, 0, 0); |
---|
| 488 | //////////////// |
---|
| 489 | */ |
---|
[24251] | 490 | type = 14; |
---|
| 491 | |
---|
[19951] | 492 | debug(99, "-------------------------------"); |
---|
[40861] | 493 | if(ostrcmp(url, url2) != 0) |
---|
| 494 | { |
---|
[40864] | 495 | debug(99, "(%d/%d) (%d/%d) %s (Part1) url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra); |
---|
[40861] | 496 | } |
---|
| 497 | else |
---|
| 498 | { |
---|
[40864] | 499 | debug(99, "(%d/%d) (%d/%d) %s url: %s extra: %s",i ,max ,j ,mirrormax ,hname ,url ,extra); |
---|
[40861] | 500 | } |
---|
[24396] | 501 | |
---|
[19951] | 502 | incount += 1; |
---|
| 503 | line = ostrcat(line, hname, 1, 0); |
---|
[40861] | 504 | |
---|
| 505 | if(url == NULL) |
---|
| 506 | line = ostrcat(line, " (Error)", 1, 0); |
---|
| 507 | |
---|
| 508 | if(url2 != NULL && ostrcmp(url, url2) != 0) |
---|
| 509 | line = ostrcat(line, " (Part1)", 1, 0); |
---|
[24396] | 510 | if(extra != NULL) |
---|
| 511 | { |
---|
| 512 | line = ostrcat(line, " (", 1, 0); |
---|
| 513 | line = ostrcat(line, extra, 1, 0); |
---|
| 514 | line = ostrcat(line, ")", 1, 0); |
---|
| 515 | } |
---|
[40861] | 516 | |
---|
| 517 | line = ostrcat(line, " (Mirror ", 1, 0); |
---|
[40864] | 518 | line = ostrcat(line, oitoa(j), 1, 1); |
---|
[40861] | 519 | line = ostrcat(line, "/", 1, 0); |
---|
[40864] | 520 | line = ostrcat(line, oitoa(mirrormax), 1, 1); |
---|
[40861] | 521 | line = ostrcat(line, ")", 1, 0); |
---|
| 522 | |
---|
| 523 | |
---|
[19951] | 524 | line = ostrcat(line, "#", 1, 0); |
---|
[40861] | 525 | line = ostrcat(line, url, 1, 0); |
---|
[19951] | 526 | line = ostrcat(line, "#", 1, 0); |
---|
| 527 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
[24396] | 528 | line = ostrcat(line, pichname, 1, 0); |
---|
[19951] | 529 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
[24396] | 530 | line = ostrcat(line, pichname, 1, 0); |
---|
[19951] | 531 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
| 532 | line = ostrcat(line, title, 1, 0); |
---|
| 533 | line = ostrcat(line, "#", 1, 0); |
---|
| 534 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
| 535 | line = ostrcat(line, "\n", 1, 0); |
---|
[40861] | 536 | /* |
---|
| 537 | if((url != NULL && url2 != NULL) && ostrcmp(url, url2) != 0) |
---|
| 538 | { |
---|
| 539 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 540 | free(hname), hname = NULL; |
---|
| 541 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
| 542 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
| 543 | string_tolower(pichname); |
---|
| 544 | pichname = stringreplacecharonce(pichname, '\n', '\0'); |
---|
[19951] | 545 | |
---|
[40861] | 546 | type = 14; |
---|
[24251] | 547 | |
---|
[40861] | 548 | debug(99, "-------------------------------"); |
---|
| 549 | debug(99, "(%d/%d) %s (Part2) url: %s extra: %s",i ,max, hname, url2, extra); |
---|
| 550 | |
---|
| 551 | incount += 1; |
---|
| 552 | line = ostrcat(line, hname, 1, 0); |
---|
| 553 | line = ostrcat(line, " (Part2)", 1, 0); |
---|
| 554 | if(extra != NULL) |
---|
| 555 | { |
---|
| 556 | line = ostrcat(line, " (", 1, 0); |
---|
| 557 | line = ostrcat(line, extra, 1, 0); |
---|
| 558 | line = ostrcat(line, ")", 1, 0); |
---|
| 559 | } |
---|
| 560 | line = ostrcat(line, "#", 1, 0); |
---|
| 561 | line = ostrcat(line, url2, 1, 0); |
---|
| 562 | line = ostrcat(line, "#", 1, 0); |
---|
| 563 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
| 564 | line = ostrcat(line, pichname, 1, 0); |
---|
| 565 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
| 566 | line = ostrcat(line, pichname, 1, 0); |
---|
| 567 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
| 568 | line = ostrcat(line, title, 1, 0); |
---|
| 569 | line = ostrcat(line, "#", 1, 0); |
---|
| 570 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
| 571 | line = ostrcat(line, "\n", 1, 0); |
---|
| 572 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 573 | } |
---|
| 574 | |
---|
| 575 | if((url != NULL && url3 != NULL) && ostrcmp(url, url3) != 0 && ostrcmp(url2, url3) != 0) |
---|
| 576 | { |
---|
| 577 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 578 | free(hname), hname = NULL; |
---|
| 579 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
| 580 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
| 581 | string_tolower(pichname); |
---|
| 582 | pichname = stringreplacecharonce(pichname, '\n', '\0'); |
---|
| 583 | type = 14; |
---|
| 584 | |
---|
| 585 | debug(99, "-------------------------------"); |
---|
| 586 | debug(99, "(%d/%d) %s (Part3) url: %s extra: %s",i ,max , hname, url3, extra); |
---|
[20846] | 587 | |
---|
[40861] | 588 | incount += 1; |
---|
| 589 | line = ostrcat(line, hname, 1, 0); |
---|
| 590 | if(extra != NULL) |
---|
| 591 | line = ostrcat(line, " (Part3)", 1, 0); |
---|
| 592 | if(extra != NULL) |
---|
| 593 | { |
---|
| 594 | line = ostrcat(line, " (", 1, 0); |
---|
| 595 | line = ostrcat(line, extra, 1, 0); |
---|
| 596 | line = ostrcat(line, ")", 1, 0); |
---|
| 597 | } |
---|
| 598 | line = ostrcat(line, "#", 1, 0); |
---|
| 599 | line = ostrcat(line, url3, 1, 0); |
---|
| 600 | line = ostrcat(line, "#", 1, 0); |
---|
| 601 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
| 602 | line = ostrcat(line, pichname, 1, 0); |
---|
| 603 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
| 604 | line = ostrcat(line, pichname, 1, 0); |
---|
| 605 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
| 606 | line = ostrcat(line, title, 1, 0); |
---|
| 607 | line = ostrcat(line, "#", 1, 0); |
---|
| 608 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
| 609 | line = ostrcat(line, "\n", 1, 0); |
---|
| 610 | free(tmpstr2), tmpstr2 = NULL; |
---|
[24396] | 611 | } |
---|
[20846] | 612 | |
---|
[40861] | 613 | if((url != NULL && url4 != NULL) && ostrcmp(url, url4) != 0 && ostrcmp(url2, url4) != 0 && ostrcmp(url3, url4) != 0) |
---|
| 614 | { |
---|
| 615 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 616 | free(hname), hname = NULL; |
---|
| 617 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
| 618 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
| 619 | string_tolower(pichname); |
---|
| 620 | pichname = stringreplacecharonce(pichname, '\n', '\0'); |
---|
| 621 | type = 14; |
---|
[24251] | 622 | |
---|
[40861] | 623 | debug(99, "-------------------------------"); |
---|
| 624 | debug(99, "(%d/%d) %s (Part4) url: %s extra: %s",i ,max , hname, url4, extra); |
---|
[24396] | 625 | |
---|
[40861] | 626 | incount += 1; |
---|
| 627 | line = ostrcat(line, hname, 1, 0); |
---|
| 628 | line = ostrcat(line, " (Part4)", 1, 0); |
---|
| 629 | if(extra != NULL) |
---|
| 630 | { |
---|
| 631 | line = ostrcat(line, " (", 1, 0); |
---|
| 632 | line = ostrcat(line, extra, 1, 0); |
---|
| 633 | line = ostrcat(line, ")", 1, 0); |
---|
| 634 | } |
---|
| 635 | line = ostrcat(line, "#", 1, 0); |
---|
| 636 | line = ostrcat(line, url4, 1, 0); |
---|
| 637 | line = ostrcat(line, "#", 1, 0); |
---|
| 638 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
| 639 | line = ostrcat(line, pichname, 1, 0); |
---|
| 640 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
| 641 | line = ostrcat(line, pichname, 1, 0); |
---|
| 642 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
| 643 | line = ostrcat(line, title, 1, 0); |
---|
| 644 | line = ostrcat(line, "#", 1, 0); |
---|
| 645 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
| 646 | line = ostrcat(line, "\n", 1, 0); |
---|
| 647 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 648 | } |
---|
| 649 | */ |
---|
| 650 | free(tmpstr1), tmpstr1 = NULL; |
---|
[20846] | 651 | free(tmpstr2), tmpstr2 = NULL; |
---|
[40861] | 652 | free(tmpstr3), tmpstr3 = NULL; |
---|
| 653 | free(tmpstr4), tmpstr4 = NULL; |
---|
| 654 | free(tmpstr5), tmpstr5 = NULL; |
---|
| 655 | free(hname), hname = NULL; |
---|
| 656 | free(hnr), hnr = NULL; |
---|
| 657 | free(hlink), hlink = NULL; |
---|
| 658 | free(url), url = NULL; |
---|
| 659 | free(url2), url2 = NULL; |
---|
| 660 | free(url3), url3 = NULL; |
---|
| 661 | free(url4), url4 = NULL; |
---|
| 662 | free(pathnew), pathnew = NULL; |
---|
| 663 | free(pichname), pichname = NULL; |
---|
| 664 | free(extra), extra = NULL; |
---|
[20846] | 665 | } |
---|
[18060] | 666 | } |
---|
| 667 | } |
---|
[18070] | 668 | free(ret1), ret1 = NULL; |
---|
[18060] | 669 | } |
---|
| 670 | } |
---|
[18070] | 671 | free(tmpstr), tmpstr = NULL; |
---|
[18060] | 672 | |
---|
| 673 | if(line != NULL) |
---|
| 674 | { |
---|
[25161] | 675 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
[18399] | 676 | if(series == 0) |
---|
[27691] | 677 | { |
---|
| 678 | tmpstr = ostrcat("/tmp/tithek/kinox.hoster.", oitoa(time(NULL)), 0, 1); |
---|
| 679 | tmpstr = ostrcat(tmpstr, ".list", 1, 0); |
---|
| 680 | } |
---|
[18399] | 681 | else |
---|
[27691] | 682 | { |
---|
| 683 | tmpstr = ostrcat("/tmp/tithek/kinox.hoster.ser.", oitoa(time(NULL)), 0, 1); |
---|
| 684 | tmpstr = ostrcat(tmpstr, ".list", 1, 0); |
---|
| 685 | } |
---|
[18069] | 686 | writesys(tmpstr, line, 0); |
---|
[19951] | 687 | |
---|
[28962] | 688 | titheklog(debuglevel, "/tmp/kinox8_line", NULL, NULL, NULL, line); |
---|
[19951] | 689 | |
---|
[19535] | 690 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
| 691 | createtithek(tnode, tnode->title, tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
[18398] | 692 | ret = 0; |
---|
| 693 | } |
---|
| 694 | |
---|
| 695 | return ret; |
---|
[18060] | 696 | } |
---|
| 697 | |
---|
[18398] | 698 | int kinox_hoster_series(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title) |
---|
[18065] | 699 | { |
---|
| 700 | debug(99, "link: %s", link); |
---|
[24237] | 701 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
[18398] | 702 | int ret = 1; |
---|
[18065] | 703 | char* ip = NULL, *pathnew = NULL, *seriesid = NULL, *searchname = NULL, *url = NULL, *session = NULL, *episode = NULL, *pos = NULL, *path = NULL, *tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *line = NULL; |
---|
[24396] | 704 | char* pichname = NULL, *extra= NULL; |
---|
[18398] | 705 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
| 706 | return ret; |
---|
| 707 | |
---|
[18065] | 708 | int count0 = 0; |
---|
| 709 | struct splitstr* ret0 = NULL; |
---|
| 710 | ret0 = strsplit(link, ";", &count0); |
---|
| 711 | if(ret0 != NULL && count0 >= 3) |
---|
| 712 | { |
---|
| 713 | url = ostrcat(url, ret0[0].part, 1, 0); |
---|
| 714 | debug(99, "url: %s", url); |
---|
| 715 | |
---|
| 716 | session = ostrcat(session, ret0[1].part, 1, 0); |
---|
[21361] | 717 | debug(99, "Season: %s", session); |
---|
[18065] | 718 | |
---|
| 719 | episode = ostrcat(episode, ret0[2].part, 1, 0); |
---|
| 720 | debug(99, "episode: %s", episode); |
---|
| 721 | |
---|
| 722 | searchname = ostrcat(searchname, ret0[0].part, 1, 0); |
---|
[30871] | 723 | searchname = string_replace("http://kinox.me//Stream/", "", searchname, 0); |
---|
| 724 | searchname = string_replace("http://kinox.me/Stream/", "", searchname, 0); |
---|
[18065] | 725 | searchname = string_replace(".html", "", searchname, 0); |
---|
| 726 | debug(99, "searchname: %s", searchname); |
---|
| 727 | } |
---|
| 728 | free(ret0), ret0 = NULL; |
---|
| 729 | |
---|
| 730 | ip = string_replace("http://", "", url, 0); |
---|
| 731 | |
---|
| 732 | if(ip != NULL) |
---|
| 733 | pos = strchr(ip, '/'); |
---|
| 734 | if(pos != NULL) |
---|
| 735 | { |
---|
| 736 | pos[0] = '\0'; |
---|
| 737 | path = pos + 1; |
---|
| 738 | } |
---|
| 739 | |
---|
[19884] | 740 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
[18065] | 741 | |
---|
| 742 | if(tmpstr != NULL) |
---|
| 743 | { |
---|
[18070] | 744 | drawscreen(load, 0, 0); |
---|
| 745 | |
---|
| 746 | seriesid = string_resub("SeriesID=", "\"", tmpstr, 0); |
---|
| 747 | debug(99, "seriesid: %s", seriesid); |
---|
| 748 | |
---|
| 749 | pathnew = ostrcat("/aGET/MirrorByEpisode/&?Addr=", searchname, 0, 0); |
---|
| 750 | pathnew = ostrcat(pathnew, "&SeriesID=", 1, 0); |
---|
| 751 | pathnew = ostrcat(pathnew, seriesid, 1, 0); |
---|
| 752 | pathnew = ostrcat(pathnew, "&Season=", 1, 0); |
---|
| 753 | pathnew = ostrcat(pathnew, session, 1, 0); |
---|
| 754 | pathnew = ostrcat(pathnew, "&Episode=", 1, 0); |
---|
| 755 | pathnew = ostrcat(pathnew, episode, 1, 0); |
---|
| 756 | debug(99, "pathnew: %s", pathnew); |
---|
[18065] | 757 | |
---|
[18070] | 758 | free(tmpstr), tmpstr = NULL; |
---|
[30871] | 759 | tmpstr = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
[18070] | 760 | free(pathnew), pathnew = NULL; |
---|
[18065] | 761 | |
---|
[18070] | 762 | if(tmpstr != NULL) |
---|
| 763 | { |
---|
| 764 | tmpstr = string_resub("<ul id=\"HosterList\" class=\"Sortable\">", "</ul>", tmpstr, 0); |
---|
[18065] | 765 | |
---|
[24251] | 766 | int type = 14; |
---|
[18070] | 767 | int count = 0; |
---|
| 768 | int incount = 0; |
---|
| 769 | int i; |
---|
| 770 | struct splitstr* ret1 = NULL; |
---|
| 771 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
| 772 | |
---|
| 773 | char* hname = NULL; |
---|
| 774 | char* hnr = NULL; |
---|
| 775 | char* hlink = NULL; |
---|
| 776 | |
---|
| 777 | if(ret1 != NULL && count > 0) |
---|
[18065] | 778 | { |
---|
[18070] | 779 | int max = count; |
---|
| 780 | for(i = 0; i < max; i++) |
---|
| 781 | { |
---|
[40861] | 782 | char *mirrormaxtmp = NULL; |
---|
| 783 | char *pathnewtmp = NULL; |
---|
| 784 | char *season = NULL; |
---|
[40864] | 785 | int mirrormax = 1; |
---|
| 786 | int j = 0; |
---|
| 787 | |
---|
[40861] | 788 | mirrormaxtmp = oregex("<b>Mirror</b>: .*/(.*)<br.*", ret1[i].part); |
---|
[40864] | 789 | |
---|
| 790 | if(mirrormaxtmp != NULL) |
---|
| 791 | mirrormax = atoi(mirrormaxtmp); |
---|
| 792 | free(mirrormaxtmp), mirrormaxtmp= NULL; |
---|
[24396] | 793 | |
---|
[40861] | 794 | for(j = 1; j < mirrormax + 1; j++) |
---|
| 795 | { |
---|
[40864] | 796 | debug(99, "(%d/%d) (%d/%d) ret1[i].part: %s",i ,max ,j ,mirrormax, ret1[i].part); |
---|
[40861] | 797 | |
---|
| 798 | hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0); |
---|
| 799 | |
---|
| 800 | hlink = string_resub("rel=\"", "amp;Mirror", ret1[i].part, 0); |
---|
| 801 | hlink = string_replace_all("amp;Hoster", "Hoster", hlink, 1); |
---|
| 802 | hlink = ostrcat(hlink, "Mirror=", 0, 0); |
---|
| 803 | |
---|
| 804 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
| 805 | pathnewtmp = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
| 806 | |
---|
| 807 | season = string_resub("&Season=", "\">", ret1[i].part, 0); |
---|
| 808 | season = string_replace_all("amp;", "", season, 1); |
---|
| 809 | |
---|
[40864] | 810 | pathnew = ostrcat(pathnewtmp, oitoa(j), 0, 1); |
---|
| 811 | pathnew = ostrcat(pathnew, "&Season=", 1, 0); |
---|
| 812 | pathnew = ostrcat(pathnew, season, 1, 0); |
---|
[40861] | 813 | |
---|
[40864] | 814 | debug(99, "(%d/%d) (%d/%d) hnr: %s hlink: %s season: %s hname: %s pathnewtmp: %s",i ,max ,j ,mirrormax ,hnr ,hlink ,season ,hname ,pathnewtmp); |
---|
| 815 | |
---|
| 816 | free(season), season= NULL; |
---|
| 817 | free(pathnewtmp), pathnewtmp= NULL; |
---|
[40861] | 818 | |
---|
| 819 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
| 820 | string_tolower(pichname); |
---|
| 821 | pichname = stringreplacecharonce(pichname, '.', '\0'); |
---|
| 822 | |
---|
| 823 | extra = string_resub("<b>Vom</b>: ", "</div>", ret1[i].part, 0); |
---|
[24396] | 824 | |
---|
[40861] | 825 | hlink = string_replace("http://kinox.me//Stream/", "", hlink, 1); |
---|
| 826 | hlink = string_replace("http://kinox.me/Stream/", "", hlink, 1); |
---|
[18654] | 827 | |
---|
[40864] | 828 | debug(99, "pathnew: %s", pathnew); |
---|
[40861] | 829 | tmpstr1 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
[40864] | 830 | debug(99, "tmpstr1 1: %s", tmpstr1); |
---|
[40819] | 831 | |
---|
| 832 | tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); |
---|
[40861] | 833 | debug(99, "tmpstr1 2: %s", tmpstr1); |
---|
[40819] | 834 | |
---|
| 835 | if(ostrstr(tmpstr1, "<iframe src=") != NULL) |
---|
| 836 | { |
---|
| 837 | url = string_resub("<iframe src=\"", "\"", tmpstr1, 0); |
---|
[40861] | 838 | debug(99, "iframe1.1 url: %s", url); |
---|
[40819] | 839 | } |
---|
[40861] | 840 | else if(ostrstr(tmpstr1, "/iframe>") != NULL) |
---|
| 841 | { |
---|
| 842 | free(pathnew), pathnew = NULL; |
---|
| 843 | pathnew = ostrcat("kinox.me/aGET/Mirror/", hlink, 0, 0); |
---|
| 844 | debug(99, "iframe2.1 pathnew: %s", pathnew); |
---|
| 845 | free(tmpstr1), tmpstr1 = NULL; |
---|
| 846 | tmpstr1 = gethttps(pathnew, NULL, NULL, NULL, NULL, NULL, 1); |
---|
| 847 | debug(99, "iframe2.2 tmpstr1: %s", tmpstr1); |
---|
| 848 | tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); |
---|
| 849 | debug(99, "iframe2.3 tmpstr1: %s", tmpstr1); |
---|
| 850 | |
---|
| 851 | if(ostrstr(tmpstr1, "<iframe src=") != NULL) |
---|
| 852 | { |
---|
| 853 | url = string_resub("<iframe src=\"", "\"", tmpstr1, 0); |
---|
| 854 | debug(99, "iframe2.4 url: %s", url); |
---|
| 855 | } |
---|
| 856 | } |
---|
| 857 | else |
---|
| 858 | { |
---|
| 859 | tmpstr1 = string_resub("<a href=\"", "\"", tmpstr1, 0); |
---|
| 860 | debug(99, "tmpstr1 3: %s", tmpstr1); |
---|
| 861 | url = ostrcat(tmpstr1, NULL, 0, 0); |
---|
| 862 | } |
---|
[18070] | 863 | |
---|
[40861] | 864 | type = 14; |
---|
[24396] | 865 | |
---|
[40861] | 866 | debug(99, "-------------------------------"); |
---|
[40864] | 867 | debug(99, "(%d/%d) (%d/%d) %s url: %s extra: %s", i, max, j, mirrormax, hname, url, extra); |
---|
[24396] | 868 | |
---|
[40861] | 869 | incount += 1; |
---|
[40819] | 870 | |
---|
[40861] | 871 | line = ostrcat(line, hname, 1, 0); |
---|
[40819] | 872 | |
---|
[40861] | 873 | if(url == NULL) |
---|
| 874 | line = ostrcat(line, " (Error)", 1, 0); |
---|
[40819] | 875 | |
---|
[40861] | 876 | if(extra != NULL) |
---|
| 877 | { |
---|
| 878 | line = ostrcat(line, " (", 1, 0); |
---|
| 879 | line = ostrcat(line, extra, 1, 0); |
---|
| 880 | line = ostrcat(line, ")", 1, 0); |
---|
| 881 | } |
---|
| 882 | |
---|
| 883 | line = ostrcat(line, " (Mirror ", 1, 0); |
---|
[40864] | 884 | line = ostrcat(line, oitoa(j), 1, 1); |
---|
[40861] | 885 | line = ostrcat(line, "/", 1, 0); |
---|
[40864] | 886 | line = ostrcat(line, oitoa(mirrormax), 1, 1); |
---|
[40861] | 887 | line = ostrcat(line, ")", 1, 0); |
---|
| 888 | |
---|
| 889 | |
---|
| 890 | line = ostrcat(line, "#", 1, 0); |
---|
| 891 | line = ostrcat(line, url, 1, 0); |
---|
| 892 | line = ostrcat(line, "#", 1, 0); |
---|
| 893 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
| 894 | line = ostrcat(line, pichname, 1, 0); |
---|
| 895 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
| 896 | line = ostrcat(line, pichname, 1, 0); |
---|
| 897 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
| 898 | line = ostrcat(line, title, 1, 0); |
---|
| 899 | line = ostrcat(line, "#", 1, 0); |
---|
| 900 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
| 901 | line = ostrcat(line, "\n", 1, 0); |
---|
| 902 | |
---|
| 903 | free(tmpstr1), tmpstr1 = NULL; |
---|
| 904 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 905 | free(hname), hname = NULL; |
---|
| 906 | free(hnr), hnr = NULL; |
---|
| 907 | free(hlink), hlink = NULL; |
---|
| 908 | free(url), url = NULL; |
---|
| 909 | free(pathnew), pathnew = NULL; |
---|
| 910 | free(pichname), pichname = NULL; |
---|
| 911 | free(extra), extra = NULL; |
---|
[24396] | 912 | } |
---|
[18065] | 913 | } |
---|
| 914 | } |
---|
[18070] | 915 | free(ret1), ret1 = NULL; |
---|
[18065] | 916 | } |
---|
| 917 | } |
---|
| 918 | |
---|
| 919 | free(tmpstr), tmpstr = NULL; |
---|
| 920 | if(line != NULL) |
---|
| 921 | { |
---|
[25161] | 922 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
[27691] | 923 | tmpstr = ostrcat("/tmp/tithek/kinox.hoster.series.", oitoa(time(NULL)), 0, 1); |
---|
| 924 | tmpstr = ostrcat(tmpstr, ".list", 1, 0); |
---|
| 925 | |
---|
[18069] | 926 | writesys(tmpstr, line, 0); |
---|
[19951] | 927 | |
---|
[28962] | 928 | titheklog(debuglevel, "/tmp/kinox9_line", NULL, NULL, NULL, line); |
---|
[19951] | 929 | |
---|
[19535] | 930 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
| 931 | createtithek(tnode, tnode->title, tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
[18398] | 932 | ret = 0; |
---|
| 933 | } |
---|
| 934 | |
---|
| 935 | return ret; |
---|
[18065] | 936 | } |
---|
| 937 | |
---|
[20836] | 938 | int kinox_search_cast(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr) |
---|
| 939 | { |
---|
[28962] | 940 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
[20836] | 941 | int ret = 1; |
---|
| 942 | |
---|
| 943 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
| 944 | return ret; |
---|
| 945 | |
---|
| 946 | char* search = NULL; |
---|
| 947 | if(searchstr == NULL) |
---|
[27270] | 948 | search = textinputhist(_("Search"), " ", "searchhist"); |
---|
[20836] | 949 | else |
---|
[27270] | 950 | search = textinputhist(_("Search"), searchstr, "searchhist"); |
---|
[20836] | 951 | |
---|
| 952 | if(search != NULL) |
---|
| 953 | { |
---|
| 954 | drawscreen(load, 0, 0); |
---|
[24319] | 955 | search = strstrip(search); |
---|
[20836] | 956 | search = stringreplacechar(search, ' ', '+'); |
---|
[24319] | 957 | debug(99, "search: %s", search); |
---|
[20836] | 958 | |
---|
| 959 | char* tmpstr = NULL; |
---|
| 960 | char* tmpstr1 = NULL; |
---|
| 961 | char* ip = NULL; |
---|
| 962 | char* path = NULL; |
---|
| 963 | |
---|
| 964 | char* line = NULL; |
---|
| 965 | char* menu = NULL; |
---|
| 966 | |
---|
| 967 | ip = ostrcat("www.imdb.com", NULL, 0, 0); |
---|
| 968 | path = ostrcat("find?q=", search, 0, 0); |
---|
| 969 | path = ostrcat(path, "&s=nm", 1, 0); |
---|
[20837] | 970 | |
---|
[20836] | 971 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
[28962] | 972 | titheklog(debuglevel, "/tmp/kinox10_cast_tmpstr1", NULL, NULL, NULL, tmpstr); |
---|
[20836] | 973 | tmpstr = string_replace_all("<td class=\"primary_photo\"> <a href=\"/name/", "\nfound=\"", tmpstr, 1); |
---|
[28962] | 974 | titheklog(debuglevel, "/tmp/kinox10_cast_tmpstr2", NULL, NULL, NULL, tmpstr); |
---|
[20836] | 975 | |
---|
| 976 | tmpstr1 = string_resub("<table class=\"findList\">", "</div>", tmpstr, 0); |
---|
[28962] | 977 | titheklog(debuglevel, "/tmp/kinox10_cast_tmpstr3", NULL, NULL, NULL, tmpstr1); |
---|
| 978 | free(tmpstr), tmpstr = NULL; |
---|
[20836] | 979 | |
---|
| 980 | int count = 0; |
---|
| 981 | int incount = 0; |
---|
| 982 | int i; |
---|
| 983 | struct splitstr* ret1 = NULL; |
---|
| 984 | ret1 = strsplit(tmpstr1, "\n", &count); |
---|
| 985 | |
---|
| 986 | char* url = NULL; |
---|
| 987 | char* pic = NULL; |
---|
| 988 | char* name = NULL; |
---|
| 989 | |
---|
| 990 | if(ret1 != NULL && count > 0) |
---|
| 991 | { |
---|
| 992 | int max = count; |
---|
| 993 | for(i = 0; i < max; i++) |
---|
| 994 | { |
---|
| 995 | url = string_resub("found=\"", "/", ret1[i].part, 0); |
---|
| 996 | pic = string_resub("<img src=\"", "\"", ret1[i].part, 0); |
---|
| 997 | |
---|
| 998 | tmpstr = string_resub("found=\"", "<small>", ret1[i].part, 0); |
---|
[22216] | 999 | // name = oregex(".*<a href=\"/name/nm.*\ >(.*)</a>", tmpstr); |
---|
| 1000 | name = oregex(".*<a href=\"/name/nm.* >(.*)</a>", tmpstr); |
---|
[20836] | 1001 | |
---|
[20837] | 1002 | debug(99, "(%d/%d) name: %s url: %s pic: %s\n",i, count, name, url, pic); |
---|
| 1003 | debug(99, "-------------------------------"); |
---|
| 1004 | |
---|
[20836] | 1005 | pic = string_replace_all(",", "%2C", pic, 1); |
---|
| 1006 | |
---|
| 1007 | if(url != NULL) |
---|
| 1008 | { |
---|
[27691] | 1009 | incount++; |
---|
[20836] | 1010 | line = ostrcat(line, name, 1, 0); |
---|
[30871] | 1011 | line = ostrcat(line, "#http://kinox.me/People/", 1, 0); |
---|
[20836] | 1012 | line = ostrcat(line, url, 1, 0); |
---|
| 1013 | line = ostrcat(line, "#", 1, 0); |
---|
| 1014 | line = ostrcat(line, pic, 1, 0); |
---|
| 1015 | line = ostrcat(line, "#kinox_search_", 1, 0); |
---|
| 1016 | line = ostrcat(line, oitoa(incount + time(NULL)), 1, 1); |
---|
[20840] | 1017 | line = ostrcat(line, ".jpg#KinoX - Cast Search#32\n", 1, 0); |
---|
[20836] | 1018 | } |
---|
| 1019 | |
---|
| 1020 | free(url), url = NULL; |
---|
| 1021 | free(pic), pic = NULL; |
---|
| 1022 | free(name), name = NULL; |
---|
| 1023 | free(tmpstr), tmpstr = NULL; |
---|
| 1024 | } |
---|
| 1025 | |
---|
| 1026 | free(ret1), ret1 = NULL; |
---|
| 1027 | if(line != NULL) |
---|
| 1028 | { |
---|
[25161] | 1029 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
[27691] | 1030 | menu = ostrcat("/tmp/tithek/kinox.search.cast.", oitoa(time(NULL)), 0, 1); |
---|
| 1031 | menu = ostrcat(menu, ".list", 1, 0); |
---|
| 1032 | |
---|
[20836] | 1033 | writesys(menu, line, 0); |
---|
| 1034 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
| 1035 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
| 1036 | ret = 0; |
---|
| 1037 | } |
---|
| 1038 | |
---|
| 1039 | } |
---|
| 1040 | free(tmpstr), tmpstr = NULL; |
---|
| 1041 | free(ip), ip = NULL; |
---|
| 1042 | } |
---|
| 1043 | free(search), search = NULL; |
---|
| 1044 | return ret; |
---|
| 1045 | } |
---|
| 1046 | |
---|
[40819] | 1047 | #endif |
---|