[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); |
---|
| 13 | debug(99, "streamurl1: %s", streamurl); |
---|
[18060] | 14 | |
---|
[24396] | 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); |
---|
| 133 | line = ostrcat(line, "#", 1, 0); |
---|
| 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 | { |
---|
[24396] | 351 | // printf("ret1[i].part: %s\n",ret1[i].part); |
---|
[18070] | 352 | hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0); |
---|
| 353 | hlink = string_resub("rel=\"", "\">", ret1[i].part, 0); |
---|
| 354 | hlink = string_replace_all("amp;", "", hlink, 1); |
---|
| 355 | |
---|
| 356 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
| 357 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
[19951] | 358 | |
---|
[24396] | 359 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
| 360 | string_tolower(pichname); |
---|
| 361 | pichname = stringreplacecharonce(pichname, '.', '\0'); |
---|
| 362 | |
---|
| 363 | extra = string_resub("<b>Vom</b>: ", "</div>", ret1[i].part, 0); |
---|
| 364 | |
---|
[28962] | 365 | titheklog(debuglevel, "/tmp/kinox4_pathnew1", hname, NULL, NULL, pathnew); |
---|
[19951] | 366 | |
---|
[30871] | 367 | tmpstr1 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
[18070] | 368 | free(pathnew), pathnew = NULL; |
---|
[19951] | 369 | |
---|
[28962] | 370 | titheklog(debuglevel, "/tmp/kinox5_tmpstr1", hname, NULL, NULL, tmpstr1); |
---|
[19951] | 371 | |
---|
[18070] | 372 | tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); |
---|
| 373 | tmpstr1 = string_resub("<a href=\"", "\"", tmpstr1, 0); |
---|
| 374 | |
---|
| 375 | url = ostrcat(tmpstr1, NULL, 0, 0); |
---|
[19951] | 376 | //////////////// |
---|
| 377 | free(pathnew), pathnew = NULL; |
---|
| 378 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
| 379 | pathnew = ostrcat(pathnew, "&Part=2", 1, 0); |
---|
| 380 | |
---|
[28962] | 381 | titheklog(debuglevel, "/tmp/kinox6_pathnew2", hname, NULL, NULL, pathnew); |
---|
[19951] | 382 | |
---|
[30871] | 383 | tmpstr3 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
[19951] | 384 | free(pathnew), pathnew = NULL; |
---|
| 385 | |
---|
[28962] | 386 | titheklog(debuglevel, "/tmp/kinox7_tmpstr3", hname, NULL, NULL, tmpstr3); |
---|
[19951] | 387 | |
---|
| 388 | tmpstr3 = string_replace_all("\\", "", tmpstr3, 1); |
---|
| 389 | tmpstr3 = string_resub("<a href=\"", "\"", tmpstr3, 0); |
---|
| 390 | |
---|
| 391 | url2 = ostrcat(tmpstr3, NULL, 0, 0); |
---|
| 392 | //////////////// |
---|
[20846] | 393 | free(pathnew), pathnew = NULL; |
---|
| 394 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
| 395 | pathnew = ostrcat(pathnew, "&Part=3", 1, 0); |
---|
[19951] | 396 | |
---|
[28962] | 397 | titheklog(debuglevel, "/tmp/kinox6_pathnew3", hname, NULL, NULL, pathnew); |
---|
[20846] | 398 | |
---|
[30871] | 399 | tmpstr4 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
[20846] | 400 | free(pathnew), pathnew = NULL; |
---|
| 401 | |
---|
[28962] | 402 | titheklog(debuglevel, "/tmp/kinox7_tmpstr4", hname, NULL, NULL, tmpstr4); |
---|
[20846] | 403 | |
---|
| 404 | tmpstr4 = string_replace_all("\\", "", tmpstr4, 1); |
---|
| 405 | tmpstr4 = string_resub("<a href=\"", "\"", tmpstr4, 0); |
---|
| 406 | |
---|
| 407 | url3 = ostrcat(tmpstr4, NULL, 0, 0); |
---|
| 408 | //////////////// |
---|
| 409 | free(pathnew), pathnew = NULL; |
---|
| 410 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
| 411 | pathnew = ostrcat(pathnew, "&Part=4", 1, 0); |
---|
| 412 | |
---|
[28962] | 413 | titheklog(debuglevel, "/tmp/kinox6_pathnew4", hname, NULL, NULL, pathnew); |
---|
[20846] | 414 | |
---|
[30871] | 415 | tmpstr5 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
[20846] | 416 | free(pathnew), pathnew = NULL; |
---|
| 417 | |
---|
[28962] | 418 | titheklog(debuglevel, "/tmp/kinox7_tmpstr5", hname, NULL, NULL, tmpstr5); |
---|
[20846] | 419 | |
---|
| 420 | tmpstr5 = string_replace_all("\\", "", tmpstr5, 1); |
---|
| 421 | tmpstr5 = string_resub("<a href=\"", "\"", tmpstr5, 0); |
---|
| 422 | |
---|
| 423 | url4 = ostrcat(tmpstr5, NULL, 0, 0); |
---|
| 424 | //////////////// |
---|
[24251] | 425 | type = 14; |
---|
| 426 | |
---|
[19951] | 427 | debug(99, "-------------------------------"); |
---|
| 428 | if(ostrcmp(url, url2) != 0) |
---|
| 429 | { |
---|
[24396] | 430 | debug(99, "(%d/%d) %s (Part1) url: %s extra: %s",i ,max , hname, url, extra); |
---|
[19951] | 431 | } |
---|
| 432 | else |
---|
| 433 | { |
---|
[24396] | 434 | debug(99, "(%d/%d) %s url: %s extra: %s",i ,max , hname, url, extra); |
---|
[19951] | 435 | } |
---|
| 436 | |
---|
[18070] | 437 | incount += 1; |
---|
| 438 | line = ostrcat(line, hname, 1, 0); |
---|
[19951] | 439 | if(ostrcmp(url, url2) != 0) |
---|
[24396] | 440 | line = ostrcat(line, " (Part1)", 1, 0); |
---|
| 441 | if(extra != NULL) |
---|
| 442 | { |
---|
| 443 | line = ostrcat(line, " (", 1, 0); |
---|
| 444 | line = ostrcat(line, extra, 1, 0); |
---|
| 445 | line = ostrcat(line, ")", 1, 0); |
---|
| 446 | } |
---|
[18070] | 447 | line = ostrcat(line, "#", 1, 0); |
---|
| 448 | line = ostrcat(line, url, 1, 0); |
---|
| 449 | line = ostrcat(line, "#", 1, 0); |
---|
| 450 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
[24396] | 451 | line = ostrcat(line, pichname, 1, 0); |
---|
[18070] | 452 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
[24396] | 453 | line = ostrcat(line, pichname, 1, 0); |
---|
[18070] | 454 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
| 455 | line = ostrcat(line, title, 1, 0); |
---|
| 456 | line = ostrcat(line, "#", 1, 0); |
---|
| 457 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
| 458 | line = ostrcat(line, "\n", 1, 0); |
---|
[19951] | 459 | |
---|
| 460 | if(ostrcmp(url, url2) != 0) |
---|
| 461 | { |
---|
| 462 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 463 | free(hname), hname = NULL; |
---|
| 464 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
[24396] | 465 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
| 466 | string_tolower(pichname); |
---|
| 467 | pichname = stringreplacecharonce(pichname, '\n', '\0'); |
---|
| 468 | |
---|
[24251] | 469 | type = 14; |
---|
| 470 | |
---|
[19951] | 471 | debug(99, "-------------------------------"); |
---|
[24396] | 472 | debug(99, "(%d/%d) %s (Part2) url: %s extra: %s",i ,max, hname, url2, extra); |
---|
| 473 | |
---|
[19951] | 474 | incount += 1; |
---|
| 475 | line = ostrcat(line, hname, 1, 0); |
---|
[24396] | 476 | line = ostrcat(line, " (Part2)", 1, 0); |
---|
| 477 | if(extra != NULL) |
---|
| 478 | { |
---|
| 479 | line = ostrcat(line, " (", 1, 0); |
---|
| 480 | line = ostrcat(line, extra, 1, 0); |
---|
| 481 | line = ostrcat(line, ")", 1, 0); |
---|
| 482 | } |
---|
[19951] | 483 | line = ostrcat(line, "#", 1, 0); |
---|
| 484 | line = ostrcat(line, url2, 1, 0); |
---|
| 485 | line = ostrcat(line, "#", 1, 0); |
---|
| 486 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
[24396] | 487 | line = ostrcat(line, pichname, 1, 0); |
---|
[19951] | 488 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
[24396] | 489 | line = ostrcat(line, pichname, 1, 0); |
---|
[19951] | 490 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
| 491 | line = ostrcat(line, title, 1, 0); |
---|
| 492 | line = ostrcat(line, "#", 1, 0); |
---|
| 493 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
| 494 | line = ostrcat(line, "\n", 1, 0); |
---|
| 495 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 496 | } |
---|
| 497 | |
---|
[20846] | 498 | if(ostrcmp(url, url3) != 0 && ostrcmp(url2, url3) != 0) |
---|
| 499 | { |
---|
| 500 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 501 | free(hname), hname = NULL; |
---|
| 502 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
[24396] | 503 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
| 504 | string_tolower(pichname); |
---|
| 505 | pichname = stringreplacecharonce(pichname, '\n', '\0'); |
---|
[24251] | 506 | type = 14; |
---|
| 507 | |
---|
[20846] | 508 | debug(99, "-------------------------------"); |
---|
[24396] | 509 | debug(99, "(%d/%d) %s (Part3) url: %s extra: %s",i ,max , hname, url3, extra); |
---|
[20846] | 510 | |
---|
| 511 | incount += 1; |
---|
| 512 | line = ostrcat(line, hname, 1, 0); |
---|
[24396] | 513 | if(extra != NULL) |
---|
[20846] | 514 | line = ostrcat(line, " (Part3)", 1, 0); |
---|
[24396] | 515 | if(extra != NULL) |
---|
| 516 | { |
---|
| 517 | line = ostrcat(line, " (", 1, 0); |
---|
| 518 | line = ostrcat(line, extra, 1, 0); |
---|
| 519 | line = ostrcat(line, ")", 1, 0); |
---|
| 520 | } |
---|
[20846] | 521 | line = ostrcat(line, "#", 1, 0); |
---|
| 522 | line = ostrcat(line, url3, 1, 0); |
---|
| 523 | line = ostrcat(line, "#", 1, 0); |
---|
| 524 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
[24396] | 525 | line = ostrcat(line, pichname, 1, 0); |
---|
[20846] | 526 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
[24396] | 527 | line = ostrcat(line, pichname, 1, 0); |
---|
[20846] | 528 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
| 529 | line = ostrcat(line, title, 1, 0); |
---|
| 530 | line = ostrcat(line, "#", 1, 0); |
---|
| 531 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
| 532 | line = ostrcat(line, "\n", 1, 0); |
---|
| 533 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 534 | } |
---|
| 535 | |
---|
| 536 | if(ostrcmp(url, url4) != 0 && ostrcmp(url2, url4) != 0 && ostrcmp(url3, url4) != 0) |
---|
| 537 | { |
---|
| 538 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 539 | free(hname), hname = NULL; |
---|
| 540 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
[24396] | 541 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
| 542 | string_tolower(pichname); |
---|
| 543 | pichname = stringreplacecharonce(pichname, '\n', '\0'); |
---|
[24251] | 544 | type = 14; |
---|
| 545 | |
---|
[20846] | 546 | debug(99, "-------------------------------"); |
---|
[24396] | 547 | debug(99, "(%d/%d) %s (Part4) url: %s extra: %s",i ,max , hname, url4, extra); |
---|
| 548 | |
---|
[20846] | 549 | incount += 1; |
---|
| 550 | line = ostrcat(line, hname, 1, 0); |
---|
[24396] | 551 | line = ostrcat(line, " (Part4)", 1, 0); |
---|
| 552 | if(extra != NULL) |
---|
| 553 | { |
---|
| 554 | line = ostrcat(line, " (", 1, 0); |
---|
| 555 | line = ostrcat(line, extra, 1, 0); |
---|
| 556 | line = ostrcat(line, ")", 1, 0); |
---|
| 557 | } |
---|
[20846] | 558 | line = ostrcat(line, "#", 1, 0); |
---|
| 559 | line = ostrcat(line, url4, 1, 0); |
---|
| 560 | line = ostrcat(line, "#", 1, 0); |
---|
| 561 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
[24396] | 562 | line = ostrcat(line, pichname, 1, 0); |
---|
[20846] | 563 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
[24396] | 564 | line = ostrcat(line, pichname, 1, 0); |
---|
[20846] | 565 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
| 566 | line = ostrcat(line, title, 1, 0); |
---|
| 567 | line = ostrcat(line, "#", 1, 0); |
---|
| 568 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
| 569 | line = ostrcat(line, "\n", 1, 0); |
---|
| 570 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 571 | } |
---|
| 572 | |
---|
[19951] | 573 | free(tmpstr1), tmpstr1 = NULL; |
---|
| 574 | free(tmpstr2), tmpstr2 = NULL; |
---|
| 575 | free(tmpstr3), tmpstr3 = NULL; |
---|
[20846] | 576 | free(tmpstr4), tmpstr4 = NULL; |
---|
| 577 | free(tmpstr5), tmpstr5 = NULL; |
---|
[18070] | 578 | free(hname), hname = NULL; |
---|
| 579 | free(hnr), hnr = NULL; |
---|
| 580 | free(hlink), hlink = NULL; |
---|
| 581 | free(url), url = NULL; |
---|
[19951] | 582 | free(url2), url2 = NULL; |
---|
[20846] | 583 | free(url3), url3 = NULL; |
---|
| 584 | free(url4), url4 = NULL; |
---|
[18070] | 585 | free(pathnew), pathnew = NULL; |
---|
[24396] | 586 | free(pichname), pichname = NULL; |
---|
| 587 | free(extra), extra = NULL; |
---|
[18060] | 588 | } |
---|
| 589 | } |
---|
[18070] | 590 | free(ret1), ret1 = NULL; |
---|
[18060] | 591 | } |
---|
| 592 | } |
---|
[18070] | 593 | free(tmpstr), tmpstr = NULL; |
---|
[18060] | 594 | |
---|
| 595 | if(line != NULL) |
---|
| 596 | { |
---|
[25161] | 597 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
[18399] | 598 | if(series == 0) |
---|
[27691] | 599 | { |
---|
| 600 | tmpstr = ostrcat("/tmp/tithek/kinox.hoster.", oitoa(time(NULL)), 0, 1); |
---|
| 601 | tmpstr = ostrcat(tmpstr, ".list", 1, 0); |
---|
| 602 | } |
---|
[18399] | 603 | else |
---|
[27691] | 604 | { |
---|
| 605 | tmpstr = ostrcat("/tmp/tithek/kinox.hoster.ser.", oitoa(time(NULL)), 0, 1); |
---|
| 606 | tmpstr = ostrcat(tmpstr, ".list", 1, 0); |
---|
| 607 | } |
---|
[18069] | 608 | writesys(tmpstr, line, 0); |
---|
[19951] | 609 | |
---|
[28962] | 610 | titheklog(debuglevel, "/tmp/kinox8_line", NULL, NULL, NULL, line); |
---|
[19951] | 611 | |
---|
[19535] | 612 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
| 613 | createtithek(tnode, tnode->title, tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
[18398] | 614 | ret = 0; |
---|
| 615 | } |
---|
| 616 | |
---|
| 617 | return ret; |
---|
[18060] | 618 | } |
---|
| 619 | |
---|
[18398] | 620 | int kinox_hoster_series(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title) |
---|
[18065] | 621 | { |
---|
| 622 | debug(99, "link: %s", link); |
---|
[24237] | 623 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
[18398] | 624 | int ret = 1; |
---|
[18065] | 625 | 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] | 626 | char* pichname = NULL, *extra= NULL; |
---|
[18398] | 627 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
| 628 | return ret; |
---|
| 629 | |
---|
[18065] | 630 | int count0 = 0; |
---|
| 631 | struct splitstr* ret0 = NULL; |
---|
| 632 | ret0 = strsplit(link, ";", &count0); |
---|
| 633 | if(ret0 != NULL && count0 >= 3) |
---|
| 634 | { |
---|
| 635 | url = ostrcat(url, ret0[0].part, 1, 0); |
---|
| 636 | debug(99, "url: %s", url); |
---|
| 637 | |
---|
| 638 | session = ostrcat(session, ret0[1].part, 1, 0); |
---|
[21361] | 639 | debug(99, "Season: %s", session); |
---|
[18065] | 640 | |
---|
| 641 | episode = ostrcat(episode, ret0[2].part, 1, 0); |
---|
| 642 | debug(99, "episode: %s", episode); |
---|
| 643 | |
---|
| 644 | searchname = ostrcat(searchname, ret0[0].part, 1, 0); |
---|
[30871] | 645 | searchname = string_replace("http://kinox.me//Stream/", "", searchname, 0); |
---|
| 646 | searchname = string_replace("http://kinox.me/Stream/", "", searchname, 0); |
---|
[18065] | 647 | searchname = string_replace(".html", "", searchname, 0); |
---|
| 648 | debug(99, "searchname: %s", searchname); |
---|
| 649 | } |
---|
| 650 | free(ret0), ret0 = NULL; |
---|
| 651 | |
---|
| 652 | ip = string_replace("http://", "", url, 0); |
---|
| 653 | |
---|
| 654 | if(ip != NULL) |
---|
| 655 | pos = strchr(ip, '/'); |
---|
| 656 | if(pos != NULL) |
---|
| 657 | { |
---|
| 658 | pos[0] = '\0'; |
---|
| 659 | path = pos + 1; |
---|
| 660 | } |
---|
| 661 | |
---|
[19884] | 662 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
[18065] | 663 | |
---|
| 664 | if(tmpstr != NULL) |
---|
| 665 | { |
---|
[18070] | 666 | drawscreen(load, 0, 0); |
---|
| 667 | |
---|
| 668 | seriesid = string_resub("SeriesID=", "\"", tmpstr, 0); |
---|
| 669 | debug(99, "seriesid: %s", seriesid); |
---|
| 670 | |
---|
| 671 | pathnew = ostrcat("/aGET/MirrorByEpisode/&?Addr=", searchname, 0, 0); |
---|
| 672 | pathnew = ostrcat(pathnew, "&SeriesID=", 1, 0); |
---|
| 673 | pathnew = ostrcat(pathnew, seriesid, 1, 0); |
---|
| 674 | pathnew = ostrcat(pathnew, "&Season=", 1, 0); |
---|
| 675 | pathnew = ostrcat(pathnew, session, 1, 0); |
---|
| 676 | pathnew = ostrcat(pathnew, "&Episode=", 1, 0); |
---|
| 677 | pathnew = ostrcat(pathnew, episode, 1, 0); |
---|
| 678 | debug(99, "pathnew: %s", pathnew); |
---|
[18065] | 679 | |
---|
[18070] | 680 | free(tmpstr), tmpstr = NULL; |
---|
[30871] | 681 | tmpstr = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
[18070] | 682 | free(pathnew), pathnew = NULL; |
---|
[18065] | 683 | |
---|
[18070] | 684 | if(tmpstr != NULL) |
---|
| 685 | { |
---|
| 686 | tmpstr = string_resub("<ul id=\"HosterList\" class=\"Sortable\">", "</ul>", tmpstr, 0); |
---|
[18065] | 687 | |
---|
[24251] | 688 | int type = 14; |
---|
[18070] | 689 | int count = 0; |
---|
| 690 | int incount = 0; |
---|
| 691 | int i; |
---|
| 692 | struct splitstr* ret1 = NULL; |
---|
| 693 | ret1 = strsplit(tmpstr, "\n", &count); |
---|
| 694 | |
---|
| 695 | char* hname = NULL; |
---|
| 696 | char* hnr = NULL; |
---|
| 697 | char* hlink = NULL; |
---|
| 698 | |
---|
| 699 | if(ret1 != NULL && count > 0) |
---|
[18065] | 700 | { |
---|
[18070] | 701 | int max = count; |
---|
| 702 | for(i = 0; i < max; i++) |
---|
| 703 | { |
---|
| 704 | hnr = string_resub("<li id=\"Hoster_", "\"", ret1[i].part, 0); |
---|
| 705 | hlink = string_resub("rel=\"", "\">", ret1[i].part, 0); |
---|
| 706 | hlink = string_replace_all("amp;", "", hlink, 1); |
---|
| 707 | hname = string_resub("<div class=\"Named\">", "</div>", ret1[i].part, 0); |
---|
[18654] | 708 | |
---|
[24396] | 709 | pichname = ostrcat(hname, NULL, 0, 0); |
---|
| 710 | string_tolower(pichname); |
---|
| 711 | pichname = stringreplacecharonce(pichname, '.', '\0'); |
---|
| 712 | |
---|
| 713 | extra = string_resub("<b>Vom</b>: ", "</div>", ret1[i].part, 0); |
---|
| 714 | |
---|
[30871] | 715 | hlink = string_replace("http://kinox.me//Stream/", "", hlink, 1); |
---|
| 716 | hlink = string_replace("http://kinox.me/Stream/", "", hlink, 1); |
---|
[18654] | 717 | |
---|
[18070] | 718 | pathnew = ostrcat("/aGET/Mirror/", hlink, 0, 0); |
---|
| 719 | debug(99, "pathnew: %s", pathnew); |
---|
[18065] | 720 | |
---|
[30871] | 721 | tmpstr1 = gethttp("kinox.me", pathnew, 80, NULL, NULL, 10000, NULL, 0); |
---|
[18070] | 722 | tmpstr1 = string_replace_all("\\", "", tmpstr1, 1); |
---|
| 723 | tmpstr1 = string_resub("<a href=\"", "\"", tmpstr1, 0); |
---|
| 724 | |
---|
| 725 | url = ostrcat(tmpstr1, NULL, 0, 0); |
---|
[24251] | 726 | |
---|
| 727 | type = 14; |
---|
[24396] | 728 | |
---|
[19951] | 729 | debug(99, "-------------------------------"); |
---|
[24396] | 730 | debug(99, "(%d/%d) %s url: %s extra: %s",i ,max , hname, url, extra); |
---|
| 731 | |
---|
[18070] | 732 | incount += 1; |
---|
| 733 | line = ostrcat(line, hname, 1, 0); |
---|
[24396] | 734 | if(extra != NULL) |
---|
| 735 | { |
---|
| 736 | line = ostrcat(line, " (", 1, 0); |
---|
| 737 | line = ostrcat(line, extra, 1, 0); |
---|
| 738 | line = ostrcat(line, ")", 1, 0); |
---|
| 739 | } |
---|
[18070] | 740 | line = ostrcat(line, "#", 1, 0); |
---|
| 741 | line = ostrcat(line, url, 1, 0); |
---|
| 742 | line = ostrcat(line, "#", 1, 0); |
---|
| 743 | line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0); |
---|
[24396] | 744 | line = ostrcat(line, pichname, 1, 0); |
---|
[18070] | 745 | line = ostrcat(line, ".jpg#kinox_", 1, 0); |
---|
[24396] | 746 | line = ostrcat(line, pichname, 1, 0); |
---|
[18070] | 747 | line = ostrcat(line, ".jpg#KinoX - ", 1, 0); |
---|
| 748 | line = ostrcat(line, title, 1, 0); |
---|
| 749 | line = ostrcat(line, "#", 1, 0); |
---|
| 750 | line = ostrcat(line, oitoa(type), 1, 0); |
---|
| 751 | line = ostrcat(line, "\n", 1, 0); |
---|
[19951] | 752 | |
---|
| 753 | free(tmpstr1), tmpstr1 = NULL; |
---|
| 754 | free(tmpstr2), tmpstr2 = NULL; |
---|
[18070] | 755 | free(hname), hname = NULL; |
---|
| 756 | free(hnr), hnr = NULL; |
---|
| 757 | free(hlink), hlink = NULL; |
---|
| 758 | free(url), url = NULL; |
---|
| 759 | free(pathnew), pathnew = NULL; |
---|
[24396] | 760 | free(pichname), pichname = NULL; |
---|
| 761 | free(extra), extra = NULL; |
---|
[18065] | 762 | } |
---|
| 763 | } |
---|
[18070] | 764 | free(ret1), ret1 = NULL; |
---|
[18065] | 765 | } |
---|
| 766 | } |
---|
| 767 | |
---|
| 768 | free(tmpstr), tmpstr = NULL; |
---|
| 769 | if(line != NULL) |
---|
| 770 | { |
---|
[25161] | 771 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
[27691] | 772 | tmpstr = ostrcat("/tmp/tithek/kinox.hoster.series.", oitoa(time(NULL)), 0, 1); |
---|
| 773 | tmpstr = ostrcat(tmpstr, ".list", 1, 0); |
---|
| 774 | |
---|
[18069] | 775 | writesys(tmpstr, line, 0); |
---|
[19951] | 776 | |
---|
[28962] | 777 | titheklog(debuglevel, "/tmp/kinox9_line", NULL, NULL, NULL, line); |
---|
[19951] | 778 | |
---|
[19535] | 779 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
| 780 | createtithek(tnode, tnode->title, tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
[18398] | 781 | ret = 0; |
---|
| 782 | } |
---|
| 783 | |
---|
| 784 | return ret; |
---|
[18065] | 785 | } |
---|
| 786 | |
---|
[20836] | 787 | int kinox_search_cast(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr) |
---|
| 788 | { |
---|
[28962] | 789 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
[20836] | 790 | int ret = 1; |
---|
| 791 | |
---|
| 792 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL) |
---|
| 793 | return ret; |
---|
| 794 | |
---|
| 795 | char* search = NULL; |
---|
| 796 | if(searchstr == NULL) |
---|
[27270] | 797 | search = textinputhist(_("Search"), " ", "searchhist"); |
---|
[20836] | 798 | else |
---|
[27270] | 799 | search = textinputhist(_("Search"), searchstr, "searchhist"); |
---|
[20836] | 800 | |
---|
| 801 | if(search != NULL) |
---|
| 802 | { |
---|
| 803 | drawscreen(load, 0, 0); |
---|
[24319] | 804 | search = strstrip(search); |
---|
[20836] | 805 | search = stringreplacechar(search, ' ', '+'); |
---|
[24319] | 806 | debug(99, "search: %s", search); |
---|
[20836] | 807 | |
---|
| 808 | char* tmpstr = NULL; |
---|
| 809 | char* tmpstr1 = NULL; |
---|
| 810 | char* ip = NULL; |
---|
| 811 | char* path = NULL; |
---|
| 812 | |
---|
| 813 | char* line = NULL; |
---|
| 814 | char* menu = NULL; |
---|
| 815 | |
---|
| 816 | ip = ostrcat("www.imdb.com", NULL, 0, 0); |
---|
| 817 | path = ostrcat("find?q=", search, 0, 0); |
---|
| 818 | path = ostrcat(path, "&s=nm", 1, 0); |
---|
[20837] | 819 | |
---|
[20836] | 820 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
[28962] | 821 | titheklog(debuglevel, "/tmp/kinox10_cast_tmpstr1", NULL, NULL, NULL, tmpstr); |
---|
[20836] | 822 | tmpstr = string_replace_all("<td class=\"primary_photo\"> <a href=\"/name/", "\nfound=\"", tmpstr, 1); |
---|
[28962] | 823 | titheklog(debuglevel, "/tmp/kinox10_cast_tmpstr2", NULL, NULL, NULL, tmpstr); |
---|
[20836] | 824 | |
---|
| 825 | tmpstr1 = string_resub("<table class=\"findList\">", "</div>", tmpstr, 0); |
---|
[28962] | 826 | titheklog(debuglevel, "/tmp/kinox10_cast_tmpstr3", NULL, NULL, NULL, tmpstr1); |
---|
| 827 | free(tmpstr), tmpstr = NULL; |
---|
[20836] | 828 | |
---|
| 829 | int count = 0; |
---|
| 830 | int incount = 0; |
---|
| 831 | int i; |
---|
| 832 | struct splitstr* ret1 = NULL; |
---|
| 833 | ret1 = strsplit(tmpstr1, "\n", &count); |
---|
| 834 | |
---|
| 835 | char* url = NULL; |
---|
| 836 | char* pic = NULL; |
---|
| 837 | char* name = NULL; |
---|
| 838 | |
---|
| 839 | if(ret1 != NULL && count > 0) |
---|
| 840 | { |
---|
| 841 | int max = count; |
---|
| 842 | for(i = 0; i < max; i++) |
---|
| 843 | { |
---|
| 844 | url = string_resub("found=\"", "/", ret1[i].part, 0); |
---|
| 845 | pic = string_resub("<img src=\"", "\"", ret1[i].part, 0); |
---|
| 846 | |
---|
| 847 | tmpstr = string_resub("found=\"", "<small>", ret1[i].part, 0); |
---|
[22216] | 848 | // name = oregex(".*<a href=\"/name/nm.*\ >(.*)</a>", tmpstr); |
---|
| 849 | name = oregex(".*<a href=\"/name/nm.* >(.*)</a>", tmpstr); |
---|
[20836] | 850 | |
---|
[20837] | 851 | debug(99, "(%d/%d) name: %s url: %s pic: %s\n",i, count, name, url, pic); |
---|
| 852 | debug(99, "-------------------------------"); |
---|
| 853 | |
---|
[20836] | 854 | pic = string_replace_all(",", "%2C", pic, 1); |
---|
| 855 | |
---|
| 856 | if(url != NULL) |
---|
| 857 | { |
---|
[27691] | 858 | incount++; |
---|
[20836] | 859 | line = ostrcat(line, name, 1, 0); |
---|
[30871] | 860 | line = ostrcat(line, "#http://kinox.me/People/", 1, 0); |
---|
[20836] | 861 | line = ostrcat(line, url, 1, 0); |
---|
| 862 | line = ostrcat(line, "#", 1, 0); |
---|
| 863 | line = ostrcat(line, pic, 1, 0); |
---|
| 864 | line = ostrcat(line, "#kinox_search_", 1, 0); |
---|
| 865 | line = ostrcat(line, oitoa(incount + time(NULL)), 1, 1); |
---|
[20840] | 866 | line = ostrcat(line, ".jpg#KinoX - Cast Search#32\n", 1, 0); |
---|
[20836] | 867 | } |
---|
| 868 | |
---|
| 869 | free(url), url = NULL; |
---|
| 870 | free(pic), pic = NULL; |
---|
| 871 | free(name), name = NULL; |
---|
| 872 | free(tmpstr), tmpstr = NULL; |
---|
| 873 | } |
---|
| 874 | |
---|
| 875 | free(ret1), ret1 = NULL; |
---|
| 876 | if(line != NULL) |
---|
| 877 | { |
---|
[25161] | 878 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1); |
---|
[27691] | 879 | menu = ostrcat("/tmp/tithek/kinox.search.cast.", oitoa(time(NULL)), 0, 1); |
---|
| 880 | menu = ostrcat(menu, ".list", 1, 0); |
---|
| 881 | |
---|
[20836] | 882 | writesys(menu, line, 0); |
---|
| 883 | struct tithek* tnode = (struct tithek*)listbox->select->handle; |
---|
| 884 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag); |
---|
| 885 | ret = 0; |
---|
| 886 | } |
---|
| 887 | |
---|
| 888 | } |
---|
| 889 | free(tmpstr), tmpstr = NULL; |
---|
| 890 | free(ip), ip = NULL; |
---|
| 891 | } |
---|
| 892 | free(search), search = NULL; |
---|
| 893 | return ret; |
---|
| 894 | } |
---|
| 895 | |
---|
[18060] | 896 | #endif |
---|