1 | #ifndef TITHEK_H |
---|
2 | #define TITHEK_H |
---|
3 | |
---|
4 | #define HTTPAUTH "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0=" |
---|
5 | |
---|
6 | #define TITHEKPATH "/tmp/tithek" |
---|
7 | int tithekdownloadrun = 0; |
---|
8 | int tithekdownloadcount = 0; |
---|
9 | int tithekrun = 0; |
---|
10 | int tithekexit = 0; |
---|
11 | int tithekmovie4k = 0; |
---|
12 | int tithekkinox = 0; |
---|
13 | int titheksolarmovie = 0; |
---|
14 | int tithekmlehd = 0; |
---|
15 | |
---|
16 | //flag 0 - menu |
---|
17 | //flag 1 - menu pay hidden tithek_pay=0/1 0=hidden |
---|
18 | //flag 2 - http (default streamurl) |
---|
19 | //flag 3 - menu cover |
---|
20 | //flag 4 - youtube |
---|
21 | //flag 5 - rtl2now |
---|
22 | //flag 6 - superrtlnow |
---|
23 | //flag 7 - rtlnow |
---|
24 | //flag 8 - voxnow |
---|
25 | //flag 9 - youtube suche 10 |
---|
26 | //flag 10 - youtube suche 25 |
---|
27 | //flag 11 - youtube suche 50 |
---|
28 | //flag 12 - myvideo |
---|
29 | //flag 13 - myvideo search 50 |
---|
30 | //flag 14 - hoster putlocker/sockshare |
---|
31 | //flag 15 - hoster filenuke |
---|
32 | //flag 16 - superrtlnow pay |
---|
33 | //flag 17 - rtlnow pay |
---|
34 | //flag 18 - voxnow pay |
---|
35 | //flag 19 - rtl2now pay |
---|
36 | //flag 20 - hoster StreamCloud |
---|
37 | //flag 21 - kinox search |
---|
38 | //flag 22 - kinox hoster |
---|
39 | //flag 23 - kinox hoster serie |
---|
40 | //flag 24 - hoster flashx |
---|
41 | //flag 25 - hoster vidstream |
---|
42 | //flag 26 - hoster xvidstage |
---|
43 | //flag 27 - hoster nowvideo |
---|
44 | //flag 28 - solarmovie hoster |
---|
45 | //flag 29 - solarmovie search movie |
---|
46 | //flag 30 - solarmovie search serie |
---|
47 | //flag 31 - kinox search cast |
---|
48 | //flag 32 - kinox search cast results |
---|
49 | //flag 33 - movie4k search : serie > open seasons and list episode flag=40 > hoster listed flag=34 |
---|
50 | //flag 34 - movie4k hoster de |
---|
51 | //flag 35 - movie4k hoster other |
---|
52 | //flag 36 - movie4k series de > open seasons and list episode flag=39 > hoster listed flag=34 |
---|
53 | //flag 37 - movie4k series other > open seasons and list episode flag=39 > hoster listed flag=34 |
---|
54 | //flag 38 - mlehd |
---|
55 | //flag 39 - movie4k_hoster_listed |
---|
56 | //flag 40 - movie4k_hoster_series |
---|
57 | //flag 41 - movie4k |
---|
58 | //flag 42 - xvideos |
---|
59 | //flag 43 - solarmovie |
---|
60 | //flag 44 - myvideo Single charts |
---|
61 | //flag 45 - ard |
---|
62 | //flag 46 - ard |
---|
63 | |
---|
64 | //flag 50 - beeg |
---|
65 | //flag 66 - coming soon dummy |
---|
66 | //flag 1000 - menu pincode |
---|
67 | //flag 9999 - menu hidden codecpack |
---|
68 | |
---|
69 | struct tithek |
---|
70 | { |
---|
71 | char* title; |
---|
72 | char* link; |
---|
73 | char* pic; |
---|
74 | char* localname; |
---|
75 | char* menutitle; |
---|
76 | int flag; |
---|
77 | struct tithek* prev; |
---|
78 | struct tithek* next; |
---|
79 | }; |
---|
80 | struct tithek *tithek = NULL; |
---|
81 | |
---|
82 | |
---|
83 | void freetithekcontent(struct tithek* node) |
---|
84 | { |
---|
85 | if(node == NULL) return; |
---|
86 | |
---|
87 | free(node->title); node->title = NULL; |
---|
88 | node->link = NULL; |
---|
89 | node->pic = NULL; |
---|
90 | node->localname = NULL; |
---|
91 | node->menutitle = NULL; |
---|
92 | node->flag = 0; |
---|
93 | } |
---|
94 | |
---|
95 | int addtithekcontent(struct tithek* node, char *line, int len, int count, int pay) |
---|
96 | { |
---|
97 | int ret = 0, i = 0, skip = 0, hid = 0, sos = 0; |
---|
98 | char* tmpstr = NULL, *flag = NULL, *cmd = NULL, *tmp = NULL; |
---|
99 | if(node == NULL) return 1; |
---|
100 | |
---|
101 | if(len > 0) tmpstr = malloc(len + 1); |
---|
102 | if(tmpstr != NULL) |
---|
103 | { |
---|
104 | memcpy(tmpstr, line, len); |
---|
105 | tmpstr[len] = '\0'; |
---|
106 | |
---|
107 | node->title = tmpstr; |
---|
108 | |
---|
109 | while(tmpstr[0] != '\0') |
---|
110 | { |
---|
111 | if(tmpstr[0] == '#') |
---|
112 | { |
---|
113 | tmpstr[0] = '\0'; |
---|
114 | tmpstr++; |
---|
115 | switch(ret) |
---|
116 | { |
---|
117 | case 0: node->link = tmpstr; break; |
---|
118 | case 1: node->pic = tmpstr; break; |
---|
119 | case 2: node->localname = tmpstr; break; |
---|
120 | case 3: node->menutitle = tmpstr; break; |
---|
121 | case 4: flag = tmpstr; break; |
---|
122 | } |
---|
123 | |
---|
124 | ret++; |
---|
125 | } |
---|
126 | else |
---|
127 | tmpstr++; |
---|
128 | } |
---|
129 | } |
---|
130 | |
---|
131 | if(ret != 5) |
---|
132 | { |
---|
133 | if(count > 0) |
---|
134 | { |
---|
135 | err("tithek line %d not ok (ret=%d)", count, ret); |
---|
136 | } |
---|
137 | else |
---|
138 | { |
---|
139 | err("add tithek (ret=%d)", ret); |
---|
140 | } |
---|
141 | freetithekcontent(node); |
---|
142 | return 1; |
---|
143 | } |
---|
144 | |
---|
145 | if(flag != NULL) node->flag = atoi(flag); |
---|
146 | |
---|
147 | sos = getconfigint("sos", NULL); |
---|
148 | hid = getconfigint("tithek_hid_xxx", NULL); |
---|
149 | if(node->flag == 1000 && hid == 1) |
---|
150 | skip = 1; |
---|
151 | else if((node->flag == 9996 || node->flag == 9997 || node->flag == 9998 || node->flag == 9999) && !file_exist("/mnt/swapextensions/etc/.codecpack") && !file_exist("/var/swap/etc/.codecpack") && !file_exist("/var/etc/.codecpack")) |
---|
152 | skip = 1; |
---|
153 | else if(node->flag == 16 && pay == 0) |
---|
154 | skip = 1; |
---|
155 | else if(node->flag == 17 && pay == 0) |
---|
156 | skip = 1; |
---|
157 | else if(node->flag == 18 && pay == 0) |
---|
158 | skip = 1; |
---|
159 | else if(node->flag == 19 && pay == 0) |
---|
160 | skip = 1; |
---|
161 | else if(node->flag == 1 && pay == 0) |
---|
162 | skip = 1; |
---|
163 | else if(node->flag == 35 && pay == 0) |
---|
164 | skip = 1; |
---|
165 | else if(titheksolarmovie == 1 && node->flag == 9996 && sos == 0) |
---|
166 | { |
---|
167 | cmd = ostrcat(cmd, "ww", 1, 0); |
---|
168 | cmd = ostrcat(cmd, "w.sola", 1, 0); |
---|
169 | cmd = ostrcat(cmd, "rmovi", 1, 0); |
---|
170 | cmd = ostrcat(cmd, "e.", 1, 0); |
---|
171 | cmd = ostrcat(cmd, "so", 1, 0); |
---|
172 | |
---|
173 | for(i = 0; i < 3; i++) |
---|
174 | { |
---|
175 | free(tmp); tmp = NULL; |
---|
176 | tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2); |
---|
177 | if(tmp != NULL) break; |
---|
178 | } |
---|
179 | if(tmp == NULL) |
---|
180 | skip = 1; |
---|
181 | |
---|
182 | titheksolarmovie = 0; |
---|
183 | } |
---|
184 | else if(tithekmovie4k == 1 && node->flag == 9997 && sos == 0) |
---|
185 | { |
---|
186 | cmd = ostrcat(cmd, "ww", 1, 0); |
---|
187 | cmd = ostrcat(cmd, "w.mov", 1, 0); |
---|
188 | cmd = ostrcat(cmd, "ie4k", 1, 0); |
---|
189 | cmd = ostrcat(cmd, ".", 1, 0); |
---|
190 | cmd = ostrcat(cmd, "to", 1, 0); |
---|
191 | |
---|
192 | for(i = 0; i < 3; i++) |
---|
193 | { |
---|
194 | free(tmp); tmp = NULL; |
---|
195 | tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2); |
---|
196 | if(tmp != NULL) break; |
---|
197 | } |
---|
198 | if(tmp == NULL) |
---|
199 | skip = 1; |
---|
200 | |
---|
201 | tithekmovie4k = 0; |
---|
202 | } |
---|
203 | else if(tithekmlehd == 1 && node->flag == 9998 && sos == 0) |
---|
204 | { |
---|
205 | cmd = ostrcat(cmd, "ww", 1, 0); |
---|
206 | cmd = ostrcat(cmd, "w.mle", 1, 0); |
---|
207 | cmd = ostrcat(cmd, "-hd", 1, 0); |
---|
208 | cmd = ostrcat(cmd, ".", 1, 0); |
---|
209 | cmd = ostrcat(cmd, "se", 1, 0); |
---|
210 | |
---|
211 | for(i = 0; i < 3; i++) |
---|
212 | { |
---|
213 | free(tmp); tmp = NULL; |
---|
214 | tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2); |
---|
215 | if(tmp != NULL) break; |
---|
216 | } |
---|
217 | if(tmp == NULL) |
---|
218 | skip = 1; |
---|
219 | |
---|
220 | tithekmlehd = 0; |
---|
221 | } |
---|
222 | else if(tithekkinox == 1 && node->flag == 9999 && sos == 0) |
---|
223 | { |
---|
224 | cmd = ostrcat(cmd, "kin", 1, 0); |
---|
225 | cmd = ostrcat(cmd, "ox", 1, 0); |
---|
226 | cmd = ostrcat(cmd, ".", 1, 0); |
---|
227 | cmd = ostrcat(cmd, "to", 1, 0); |
---|
228 | |
---|
229 | for(i = 0; i < 3; i++) |
---|
230 | { |
---|
231 | free(tmp); tmp = NULL; |
---|
232 | tmp = gethttpreal(cmd, "/", 80, NULL, NULL, NULL, 0, NULL, NULL, 5000, 2); |
---|
233 | if(tmp != NULL) break; |
---|
234 | } |
---|
235 | if(tmp == NULL) |
---|
236 | skip = 1; |
---|
237 | |
---|
238 | tithekkinox = 0; |
---|
239 | } |
---|
240 | |
---|
241 | if(skip == 1) |
---|
242 | { |
---|
243 | freetithekcontent(node); |
---|
244 | return 1; |
---|
245 | } |
---|
246 | |
---|
247 | free(tmp); tmp = NULL; |
---|
248 | free(cmd), cmd = NULL; |
---|
249 | |
---|
250 | return 0; |
---|
251 | } |
---|
252 | |
---|
253 | struct tithek* addtithek(char *line, int len, int count, struct tithek* last, int pay) |
---|
254 | { |
---|
255 | //debug(1000, "in"); |
---|
256 | struct tithek *newnode = NULL, *prev = NULL, *node = NULL; |
---|
257 | int ret = 0; |
---|
258 | |
---|
259 | if(line == NULL) return NULL; |
---|
260 | |
---|
261 | newnode = (struct tithek*)calloc(1, sizeof(struct tithek)); |
---|
262 | if(newnode == NULL) |
---|
263 | { |
---|
264 | err("no memory"); |
---|
265 | return NULL; |
---|
266 | } |
---|
267 | |
---|
268 | ret = addtithekcontent(newnode, line, len, count, pay); |
---|
269 | if(ret == 1) |
---|
270 | { |
---|
271 | free(newnode); |
---|
272 | return NULL; |
---|
273 | } |
---|
274 | |
---|
275 | node = tithek; |
---|
276 | |
---|
277 | if(last == NULL) |
---|
278 | { |
---|
279 | while(node != NULL) |
---|
280 | { |
---|
281 | prev = node; |
---|
282 | node = node->next; |
---|
283 | } |
---|
284 | } |
---|
285 | else |
---|
286 | { |
---|
287 | prev = last; |
---|
288 | node = last->next; |
---|
289 | } |
---|
290 | |
---|
291 | if(prev == NULL) |
---|
292 | tithek = newnode; |
---|
293 | else |
---|
294 | { |
---|
295 | prev->next = newnode; |
---|
296 | newnode->prev = prev; |
---|
297 | } |
---|
298 | newnode->next = node; |
---|
299 | if(node != NULL) node->prev = newnode; |
---|
300 | |
---|
301 | //debug(1000, "out"); |
---|
302 | return newnode; |
---|
303 | } |
---|
304 | |
---|
305 | struct tithek* createtithek(struct tithek* update, char* title, char* link, char* pic, char* localname, char* menutitle, int flag) |
---|
306 | { |
---|
307 | int pay = 0; |
---|
308 | struct tithek* tnode = NULL; |
---|
309 | char* tmpstr = NULL; |
---|
310 | |
---|
311 | pay = getconfigint("tithek_pay", NULL); |
---|
312 | |
---|
313 | title = stringreplacechar(title, '#', ' '); |
---|
314 | link = stringreplacechar(link, '#', ' '); |
---|
315 | pic = stringreplacechar(pic, '#', ' '); |
---|
316 | localname = stringreplacechar(localname, '#', ' '); |
---|
317 | menutitle = stringreplacechar(menutitle, '#', ' '); |
---|
318 | |
---|
319 | tmpstr = ostrcat(tmpstr, title, 1, 0); |
---|
320 | tmpstr = ostrcat(tmpstr, "#", 1, 0); |
---|
321 | tmpstr = ostrcat(tmpstr, link, 1, 0); |
---|
322 | tmpstr = ostrcat(tmpstr, "#", 1, 0); |
---|
323 | tmpstr = ostrcat(tmpstr, pic, 1, 0); |
---|
324 | tmpstr = ostrcat(tmpstr, "#", 1, 0); |
---|
325 | tmpstr = ostrcat(tmpstr, localname, 1, 0); |
---|
326 | tmpstr = ostrcat(tmpstr, "#", 1, 0); |
---|
327 | tmpstr = ostrcat(tmpstr, menutitle, 1, 0); |
---|
328 | tmpstr = ostrcat(tmpstr, "#", 1, 0); |
---|
329 | tmpstr = ostrcat(tmpstr, oitoa(flag), 1, 1); |
---|
330 | |
---|
331 | tmpstr = string_replace_all("\n", "", tmpstr, 1); |
---|
332 | tmpstr = string_replace_all("\r", "", tmpstr, 1); |
---|
333 | |
---|
334 | if(update != NULL) |
---|
335 | { |
---|
336 | freetithekcontent(update); |
---|
337 | addtithekcontent(update, tmpstr, strlen(tmpstr), 1, pay); |
---|
338 | tnode = update; |
---|
339 | } |
---|
340 | else |
---|
341 | tnode = addtithek(tmpstr, strlen(tmpstr), 1, NULL, pay); |
---|
342 | |
---|
343 | free(tmpstr); |
---|
344 | |
---|
345 | return tnode; |
---|
346 | } |
---|
347 | |
---|
348 | int readtithek(const char* filename) |
---|
349 | { |
---|
350 | debug(1000, "in"); |
---|
351 | FILE *fd = NULL; |
---|
352 | char *fileline = NULL; |
---|
353 | int linecount = 0, len = 0, pay = 0; |
---|
354 | struct tithek* last = NULL, *tmplast = NULL; |
---|
355 | |
---|
356 | fileline = malloc(MINMALLOC); |
---|
357 | if(fileline == NULL) |
---|
358 | { |
---|
359 | err("no memory"); |
---|
360 | return 1; |
---|
361 | } |
---|
362 | |
---|
363 | fd = fopen(filename, "r"); |
---|
364 | if(fd == NULL) |
---|
365 | { |
---|
366 | perr("can't open %s", filename); |
---|
367 | free(fileline); |
---|
368 | return 1; |
---|
369 | } |
---|
370 | |
---|
371 | pay = getconfigint("tithek_pay", NULL); |
---|
372 | |
---|
373 | while(fgets(fileline, MINMALLOC, fd) != NULL) |
---|
374 | { |
---|
375 | if(fileline[0] == '\n') |
---|
376 | continue; |
---|
377 | len = strlen(fileline) - 1; |
---|
378 | if(fileline[len] == '\n') |
---|
379 | fileline[len] = '\0'; |
---|
380 | if(fileline[len - 1] == '\r') |
---|
381 | fileline[len - 1] = '\0'; |
---|
382 | |
---|
383 | linecount++; |
---|
384 | |
---|
385 | if(last == NULL) last = tmplast; |
---|
386 | last = addtithek(fileline, len + 2, linecount, last, pay); |
---|
387 | if(last != NULL) tmplast = last; |
---|
388 | } |
---|
389 | |
---|
390 | free(fileline); |
---|
391 | fclose(fd); |
---|
392 | return linecount; |
---|
393 | } |
---|
394 | |
---|
395 | int deltithek(char* link) |
---|
396 | { |
---|
397 | debug(1000, "in"); |
---|
398 | int ret = 1; |
---|
399 | |
---|
400 | struct tithek *node = tithek, *prev = tithek; |
---|
401 | |
---|
402 | while(node != NULL) |
---|
403 | { |
---|
404 | if(ostrcmp(link, node->link) == 0) |
---|
405 | { |
---|
406 | ret = 0; |
---|
407 | if(node == tithek) |
---|
408 | { |
---|
409 | tithek = node->next; |
---|
410 | if(tithek != NULL) |
---|
411 | tithek->prev = NULL; |
---|
412 | } |
---|
413 | else |
---|
414 | { |
---|
415 | prev->next = node->next; |
---|
416 | if(node->next != NULL) |
---|
417 | node->next->prev = prev; |
---|
418 | } |
---|
419 | |
---|
420 | freetithekcontent(node); |
---|
421 | |
---|
422 | free(node); |
---|
423 | node = NULL; |
---|
424 | |
---|
425 | break; |
---|
426 | } |
---|
427 | |
---|
428 | prev = node; |
---|
429 | node = node->next; |
---|
430 | } |
---|
431 | |
---|
432 | debug(1000, "out"); |
---|
433 | return ret; |
---|
434 | } |
---|
435 | |
---|
436 | void freetithek() |
---|
437 | { |
---|
438 | debug(1000, "in"); |
---|
439 | struct tithek *node = tithek, *prev = tithek; |
---|
440 | |
---|
441 | while(node != NULL) |
---|
442 | { |
---|
443 | prev = node; |
---|
444 | node = node->next; |
---|
445 | if(prev != NULL) |
---|
446 | deltithek(prev->link); |
---|
447 | } |
---|
448 | |
---|
449 | debug(1000, "out"); |
---|
450 | } |
---|
451 | |
---|
452 | void tithekdownloadthread(struct stimerthread* timernode, struct download* node, int flag) |
---|
453 | { |
---|
454 | int defpic = 0; |
---|
455 | |
---|
456 | tithekdownloadcount++; |
---|
457 | |
---|
458 | if(node != NULL) |
---|
459 | { |
---|
460 | m_lock(&status.tithekmutex, 20); |
---|
461 | if(file_exist(node->filename)) |
---|
462 | { |
---|
463 | m_unlock(&status.tithekmutex, 20); |
---|
464 | goto end; |
---|
465 | } |
---|
466 | |
---|
467 | FILE *fd; fd = fopen(node->filename, "w"); |
---|
468 | if(fd != NULL) fclose(fd); |
---|
469 | m_unlock(&status.tithekmutex, 20); |
---|
470 | |
---|
471 | gethttpreal(node->host, node->page, node->port, node->filename, node->auth, NULL, 0, NULL, NULL, node->timeout, 0); |
---|
472 | |
---|
473 | if(tithekrun == 0) |
---|
474 | unlink(node->filename); |
---|
475 | else |
---|
476 | { |
---|
477 | //check file size |
---|
478 | /* |
---|
479 | off64_t checkpic = getfilesize(node->filename); |
---|
480 | if(checkpic < 200) defpic = 1; |
---|
481 | */ |
---|
482 | |
---|
483 | //check file is gif or html |
---|
484 | if(defpic == 0) |
---|
485 | { |
---|
486 | char* tmp = NULL; |
---|
487 | tmp = readbintomem(node->filename, 3); |
---|
488 | if(ostrncmp("GIF", tmp, 3) == 0) defpic = 1; //gif |
---|
489 | if(ostrncmp("<", tmp, 1) == 0) defpic = 1; //html |
---|
490 | free(tmp); tmp = NULL; |
---|
491 | } |
---|
492 | |
---|
493 | if(defpic == 1) |
---|
494 | { |
---|
495 | m_lock(&status.tithekmutex, 20); |
---|
496 | unlink(node->filename); |
---|
497 | symlink("/var/usr/local/share/titan/plugins/tithek/default.jpg", node->filename); |
---|
498 | m_unlock(&status.tithekmutex, 20); |
---|
499 | } |
---|
500 | } |
---|
501 | |
---|
502 | end: |
---|
503 | free(node->host); node->host = NULL; |
---|
504 | free(node->page); node->page = NULL; |
---|
505 | free(node->filename); node->filename = NULL; |
---|
506 | free(node->auth); node->auth = NULL; |
---|
507 | } |
---|
508 | |
---|
509 | free(node); node = NULL; |
---|
510 | |
---|
511 | tithekdownloadcount--; |
---|
512 | tithekdownloadrun = 1; |
---|
513 | } |
---|
514 | |
---|
515 | char* tithekdownload(char* link, char* localname, char* pw, int pic, int flag) |
---|
516 | { |
---|
517 | int ret = 1, port = 80, timeout = 10000; |
---|
518 | char* ip = NULL, *pos = NULL, *path = NULL; |
---|
519 | char* tmpstr = NULL, *localfile = NULL; |
---|
520 | |
---|
521 | if(link == NULL) return NULL; |
---|
522 | if(ostrncmp("http://", link, 7)) return NULL; |
---|
523 | |
---|
524 | ip = string_replace("http://", "", (char*)link, 0); |
---|
525 | // tithek security |
---|
526 | ip = string_replace_all("imageshack.us/md/up/grd/", "atemio.dyndns.tv/", ip, 1); |
---|
527 | |
---|
528 | if(ip != NULL) |
---|
529 | pos = strchr(ip, '/'); |
---|
530 | if(pos != NULL) |
---|
531 | { |
---|
532 | pos[0] = '\0'; |
---|
533 | path = pos + 1; |
---|
534 | } |
---|
535 | |
---|
536 | if(ostrstr(ip, ":") != NULL) |
---|
537 | { |
---|
538 | ip = oregex("http://(.*):.*", link); |
---|
539 | port = atoi(oregex("http://.*:(.*)/.*", link)); |
---|
540 | } |
---|
541 | |
---|
542 | tmpstr = ostrcat(path, NULL, 0, 0); |
---|
543 | |
---|
544 | if(flag == 0) |
---|
545 | { |
---|
546 | localfile = ostrcat(TITHEKPATH, "/", 0, 0); |
---|
547 | if(localname == NULL) |
---|
548 | localfile = ostrcat(localfile, basename(tmpstr), 1, 0); |
---|
549 | else |
---|
550 | localfile = ostrcat(localfile, localname, 1, 0); |
---|
551 | } |
---|
552 | else |
---|
553 | { |
---|
554 | localfile = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0); |
---|
555 | if(localname == NULL) |
---|
556 | localfile = ostrcat(localfile, basename(tmpstr), 1, 0); |
---|
557 | else |
---|
558 | localfile = ostrcat(localfile, localname, 1, 0); |
---|
559 | } |
---|
560 | |
---|
561 | /* |
---|
562 | debug(99, "---------------------------------------"); |
---|
563 | debug(99, "link: %s", link); |
---|
564 | debug(99, "localname: %s", localname); |
---|
565 | debug(99, "---------------------------------------"); |
---|
566 | debug(99, "ip: %s", ip); |
---|
567 | debug(99, "port: %d", port); |
---|
568 | debug(99, "path: %s", path); |
---|
569 | debug(99, "localfile: %s", localfile); |
---|
570 | // debug(99, "pw: %s", pw); |
---|
571 | debug(99, "---------------------------------------"); |
---|
572 | */ |
---|
573 | if(flag == 0) |
---|
574 | { |
---|
575 | if(localfile != NULL && !file_exist(localfile)) |
---|
576 | { |
---|
577 | if(pic == 1) |
---|
578 | { |
---|
579 | if(tithekdownloadcount >= 24) //start max 24 threads |
---|
580 | gethttp(ip, path, port, localfile, pw, timeout, NULL, 0); |
---|
581 | else |
---|
582 | { |
---|
583 | //dnode is freed in thread |
---|
584 | struct download* dnode = calloc(1, sizeof(struct download)); |
---|
585 | if(dnode != NULL) |
---|
586 | { |
---|
587 | dnode->host = ostrcat(ip, NULL, 0, 0); |
---|
588 | dnode->page = ostrcat(path, NULL, 0, 0); |
---|
589 | dnode->port = port; |
---|
590 | dnode->filename = ostrcat(localfile, NULL, 0, 0); |
---|
591 | dnode->auth = ostrcat(pw, NULL, 0, 0); |
---|
592 | dnode->connfd = -1; |
---|
593 | dnode->ret = -1; |
---|
594 | dnode->timeout = timeout; |
---|
595 | addtimer(&tithekdownloadthread, START, 100, 1, (void*)dnode, NULL, NULL); |
---|
596 | } |
---|
597 | } |
---|
598 | } |
---|
599 | else |
---|
600 | gethttp(ip, path, port, localfile, pw, timeout, NULL, 0); |
---|
601 | } |
---|
602 | } |
---|
603 | else |
---|
604 | { |
---|
605 | |
---|
606 | if(localfile != NULL && file_exist(localfile)) |
---|
607 | ret = textbox(_("Message"), _("File exist, overwrite?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
608 | |
---|
609 | if(localfile != NULL && ret == 1) |
---|
610 | screendownload("Download", ip, path, port, localfile, pw, timeout, 0); |
---|
611 | } |
---|
612 | |
---|
613 | free(ip); ip = NULL; |
---|
614 | free(tmpstr); tmpstr = NULL; |
---|
615 | |
---|
616 | return localfile; |
---|
617 | } |
---|
618 | |
---|
619 | int createtithekplay(char* titheklink, struct skin* grid, struct skin* listbox, struct skin* countlabel, int flag) |
---|
620 | { |
---|
621 | int gridbr = 0, posx = 0, count = 0, sumcount = 0, count1 = 0, pagecount = 0, skip = 0; |
---|
622 | int localfile = 0; |
---|
623 | struct skin* tmp = NULL; |
---|
624 | char* tithekfile = NULL; |
---|
625 | char* tmpstr = NULL; |
---|
626 | |
---|
627 | if(!ostrncmp("http://", titheklink, 7)) |
---|
628 | tithekfile = tithekdownload(titheklink, NULL, HTTPAUTH, 0, 0); |
---|
629 | else |
---|
630 | { |
---|
631 | tithekfile = ostrcat(titheklink, NULL, 0, 0); |
---|
632 | localfile = 1; |
---|
633 | } |
---|
634 | |
---|
635 | delmarkedscreennodes(grid, 1); |
---|
636 | freetithek(); |
---|
637 | // if(readtithek(tithekfile) != 0) return 1; |
---|
638 | int linecount = readtithek(tithekfile); |
---|
639 | // if(linecount == 0) return 1; |
---|
640 | |
---|
641 | struct tithek* titheknode = tithek; |
---|
642 | |
---|
643 | int height = 500; |
---|
644 | int width = 590; |
---|
645 | int picheight = 480; |
---|
646 | int picwidth = 570; |
---|
647 | int zcount = 2; |
---|
648 | int fontsize = 25; |
---|
649 | int pcount = 2; |
---|
650 | |
---|
651 | if(getconfigint("tithek_cover", NULL) == 0 || getconfigint("tithek_view", NULL) == 0) |
---|
652 | { |
---|
653 | if(linecount > 2) |
---|
654 | { |
---|
655 | height = 280; |
---|
656 | width = 390; |
---|
657 | picheight = 230; |
---|
658 | picwidth = 370; |
---|
659 | zcount = 3; |
---|
660 | fontsize = 20; |
---|
661 | pcount = 6; |
---|
662 | } |
---|
663 | |
---|
664 | if(linecount > 8) |
---|
665 | { |
---|
666 | height = 180; |
---|
667 | width = 295; |
---|
668 | picheight = 130; |
---|
669 | picwidth = 270; |
---|
670 | zcount = 4; |
---|
671 | fontsize = 18; |
---|
672 | pcount = 12; |
---|
673 | } |
---|
674 | |
---|
675 | if(linecount > 19) |
---|
676 | { |
---|
677 | height = 140; |
---|
678 | width = 235; |
---|
679 | picheight = 90; |
---|
680 | picwidth = 210; |
---|
681 | zcount = 5; |
---|
682 | fontsize = 16; |
---|
683 | pcount = 20; |
---|
684 | } |
---|
685 | |
---|
686 | if(linecount > 25) |
---|
687 | { |
---|
688 | height = 111; |
---|
689 | width = 196; |
---|
690 | picheight = 60; |
---|
691 | picwidth = 150; |
---|
692 | zcount = 6; |
---|
693 | fontsize = 14; |
---|
694 | pcount = 30; |
---|
695 | } |
---|
696 | } |
---|
697 | |
---|
698 | if((getconfigint("tithek_cover", NULL) == 1 && flag == 3) || (getconfigint("tithek_view", NULL) == 1 && flag != 3)) |
---|
699 | { |
---|
700 | height = 500; |
---|
701 | width = 590; |
---|
702 | picheight = 480; |
---|
703 | picwidth = 570; |
---|
704 | zcount = 2; |
---|
705 | fontsize = 25; |
---|
706 | pcount = 2; |
---|
707 | } |
---|
708 | |
---|
709 | if((getconfigint("tithek_cover", NULL) == 2 && flag == 3) || (getconfigint("tithek_view", NULL) == 2 && flag != 3)) |
---|
710 | { |
---|
711 | height = 280; |
---|
712 | width = 390; |
---|
713 | picheight = 230; |
---|
714 | picwidth = 370; |
---|
715 | zcount = 3; |
---|
716 | fontsize = 20; |
---|
717 | pcount = 6; |
---|
718 | } |
---|
719 | |
---|
720 | if((getconfigint("tithek_cover", NULL) == 3 && flag == 3) || (getconfigint("tithek_view", NULL) == 3 && flag != 3)) |
---|
721 | { |
---|
722 | height = 180; |
---|
723 | width = 295; |
---|
724 | picheight = 130; |
---|
725 | picwidth = 270; |
---|
726 | zcount = 4; |
---|
727 | fontsize = 18; |
---|
728 | pcount = 12; |
---|
729 | } |
---|
730 | |
---|
731 | if((getconfigint("tithek_cover", NULL) == 4 && flag == 3) || (getconfigint("tithek_view", NULL) == 4 && flag != 3)) |
---|
732 | { |
---|
733 | height = 140; |
---|
734 | width = 235; |
---|
735 | picheight = 90; |
---|
736 | picwidth = 210; |
---|
737 | zcount = 5; |
---|
738 | fontsize = 16; |
---|
739 | pcount = 20; |
---|
740 | } |
---|
741 | |
---|
742 | if((getconfigint("tithek_cover", NULL) == 5 && flag == 3) || (getconfigint("tithek_view", NULL) == 5 && flag != 3)) |
---|
743 | { |
---|
744 | height = 111; |
---|
745 | width = 196; |
---|
746 | picheight = 60; |
---|
747 | picwidth = 150; |
---|
748 | zcount = 6; |
---|
749 | fontsize = 14; |
---|
750 | pcount = 30; |
---|
751 | } |
---|
752 | |
---|
753 | if(getconfigint("tithek_pic_ratio", NULL) == 1) |
---|
754 | { |
---|
755 | picwidth = 2; |
---|
756 | picheight = 2; |
---|
757 | } |
---|
758 | |
---|
759 | while(titheknode != NULL) |
---|
760 | { |
---|
761 | tmp = addlistbox(grid, listbox, tmp, 1); |
---|
762 | if(tmp != NULL) |
---|
763 | { |
---|
764 | skip = 0; |
---|
765 | sumcount++; |
---|
766 | count++; |
---|
767 | count1++; |
---|
768 | if(gridbr == 0) |
---|
769 | tmp->type = GRIDBR; |
---|
770 | gridbr = 1; |
---|
771 | tmp->wrap = YES; |
---|
772 | |
---|
773 | tmp->picheight = picheight; |
---|
774 | tmp->picwidth = picwidth; |
---|
775 | |
---|
776 | tmp->fontsize = fontsize; |
---|
777 | tmp->height = height; |
---|
778 | tmp->width = width; |
---|
779 | tmp->prozwidth = 0; |
---|
780 | //tmp->bgcol = 0xffffff; |
---|
781 | tmp->bgspace = 1; |
---|
782 | tmp->vspace = 10; |
---|
783 | tmp->hspace = 10; |
---|
784 | tmp->posx = posx; |
---|
785 | //tmp->fontcol = 0x0000ff; |
---|
786 | tmp->halign = CENTER; |
---|
787 | tmp->valign = TEXTBOTTOM; |
---|
788 | changetext(tmp, titheknode->title); |
---|
789 | tmp->handle = (char*)titheknode; |
---|
790 | posx += tmp->width; |
---|
791 | if(count >= zcount) |
---|
792 | { |
---|
793 | count = 0; |
---|
794 | posx = 0; |
---|
795 | gridbr = 0; |
---|
796 | } |
---|
797 | |
---|
798 | if(count1 >= pcount) |
---|
799 | { |
---|
800 | count1 = 0; |
---|
801 | pagecount++; |
---|
802 | skip = 1; |
---|
803 | } |
---|
804 | } |
---|
805 | titheknode = titheknode->next; |
---|
806 | } |
---|
807 | |
---|
808 | if(skip == 0) |
---|
809 | pagecount++; |
---|
810 | |
---|
811 | tmpstr = oitoa(sumcount); |
---|
812 | |
---|
813 | char* tmpstr1 = ostrcat(_("found"), NULL, 0, 0); |
---|
814 | tmpstr1 = ostrcat(tmpstr1, " ", 1, 0); |
---|
815 | tmpstr1 = ostrcat(tmpstr1, tmpstr, 1, 0); |
---|
816 | free(tmpstr); tmpstr = NULL; |
---|
817 | tmpstr1 = ostrcat(tmpstr1, " ", 1, 0); |
---|
818 | tmpstr1 = ostrcat(tmpstr1, _("Results"), 1, 0); |
---|
819 | changetext(countlabel, tmpstr1); |
---|
820 | free(tmpstr1); tmpstr1 = NULL; |
---|
821 | |
---|
822 | if(localfile == 0) |
---|
823 | unlink(tithekfile); |
---|
824 | |
---|
825 | free(tithekfile); tithekfile = NULL; |
---|
826 | return pagecount; |
---|
827 | } |
---|
828 | |
---|
829 | void removefav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag) |
---|
830 | { |
---|
831 | int count = 0, i = 0; |
---|
832 | char* tmpstr = NULL, *tmpstr1 = NULL, *input = NULL; |
---|
833 | struct splitstr* ret = NULL; |
---|
834 | |
---|
835 | input = ostrcat(input, title, 1, 0); |
---|
836 | input = ostrcat(input, "#", 1, 0); |
---|
837 | input = ostrcat(input, link, 1, 0); |
---|
838 | input = ostrcat(input, "#", 1, 0); |
---|
839 | input = ostrcat(input, pic, 1, 0); |
---|
840 | input = ostrcat(input, "#", 1, 0); |
---|
841 | input = ostrcat(input, localname, 1, 0); |
---|
842 | input = ostrcat(input, "#", 1, 0); |
---|
843 | input = ostrcat(input, menutitle, 1, 0); |
---|
844 | input = ostrcat(input, "#", 1, 0); |
---|
845 | input = ostrcat(input, oitoa(flag), 1, 1); |
---|
846 | |
---|
847 | tmpstr = readfiletomem(getconfig("tithek_fav", NULL), 0); |
---|
848 | |
---|
849 | ret = strsplit(tmpstr, "\n", &count); |
---|
850 | |
---|
851 | if(ret != NULL) |
---|
852 | { |
---|
853 | for(i = 0; i < count; i++) |
---|
854 | { |
---|
855 | if(ostrcmp((ret[i]).part, input) != 0) |
---|
856 | { |
---|
857 | tmpstr1 = ostrcat(tmpstr1, ret[i].part, 1, 0); |
---|
858 | tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0); |
---|
859 | } |
---|
860 | else |
---|
861 | printf("remove: %s\n", ret[i].part); |
---|
862 | } |
---|
863 | } |
---|
864 | |
---|
865 | if(tmpstr1 != NULL && strlen(tmpstr1) > 0) |
---|
866 | tmpstr1[strlen(tmpstr1) - 1] = '\0'; |
---|
867 | |
---|
868 | if(tmpstr1 == NULL) |
---|
869 | writesys(getconfig("tithek_fav", NULL), "", 0); |
---|
870 | else |
---|
871 | writesys(getconfig("tithek_fav", NULL), tmpstr1, 0); |
---|
872 | |
---|
873 | free(ret); ret = NULL; |
---|
874 | free(tmpstr); tmpstr = NULL; |
---|
875 | free(tmpstr1); tmpstr1 = NULL; |
---|
876 | free(input); input = NULL; |
---|
877 | } |
---|
878 | |
---|
879 | void addfav(char* title, char* link, char* pic, char* localname, char* menutitle, int flag) |
---|
880 | { |
---|
881 | int count = 0, i = 0; |
---|
882 | char* tmpstr = NULL, *tmpstr1 = NULL, *input = NULL; |
---|
883 | struct splitstr* ret = NULL; |
---|
884 | |
---|
885 | input = ostrcat(input, title, 1, 0); |
---|
886 | input = ostrcat(input, "#", 1, 0); |
---|
887 | input = ostrcat(input, link, 1, 0); |
---|
888 | input = ostrcat(input, "#", 1, 0); |
---|
889 | input = ostrcat(input, pic, 1, 0); |
---|
890 | input = ostrcat(input, "#", 1, 0); |
---|
891 | input = ostrcat(input, localname, 1, 0); |
---|
892 | input = ostrcat(input, "#", 1, 0); |
---|
893 | input = ostrcat(input, menutitle, 1, 0); |
---|
894 | input = ostrcat(input, "#", 1, 0); |
---|
895 | input = ostrcat(input, oitoa(flag), 1, 1); |
---|
896 | // tithek security |
---|
897 | input = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", input, 1); |
---|
898 | |
---|
899 | tmpstr1 = ostrcat(tmpstr1, input, 1, 0); |
---|
900 | tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0); |
---|
901 | |
---|
902 | tmpstr = readfiletomem(getconfig("tithek_fav", NULL), 0); |
---|
903 | |
---|
904 | ret = strsplit(tmpstr, "\n", &count); |
---|
905 | |
---|
906 | if(ret != NULL) |
---|
907 | { |
---|
908 | for(i = 0; i < count; i++) |
---|
909 | { |
---|
910 | if(ostrcmp((ret[i]).part, input) != 0) |
---|
911 | { |
---|
912 | tmpstr1 = ostrcat(tmpstr1, ret[i].part, 1, 0); |
---|
913 | tmpstr1 = ostrcat(tmpstr1, "\n", 1, 0); |
---|
914 | } |
---|
915 | } |
---|
916 | } |
---|
917 | |
---|
918 | if(tmpstr1 != NULL && strlen(tmpstr1) > 0) |
---|
919 | tmpstr1[strlen(tmpstr1) - 1] = '\0'; |
---|
920 | |
---|
921 | writesys(getconfig("tithek_fav", NULL), tmpstr1, 0); |
---|
922 | |
---|
923 | free(ret); ret = NULL; |
---|
924 | free(tmpstr); tmpstr = NULL; |
---|
925 | free(tmpstr1); tmpstr1 = NULL; |
---|
926 | free(input); input = NULL; |
---|
927 | } |
---|
928 | |
---|
929 | void cacheplay(char* link, char* filename, int flag) |
---|
930 | { |
---|
931 | struct skin* load = getscreen("loadingproz"); |
---|
932 | struct skin* proztext = getscreennode(load, "proztext"); |
---|
933 | |
---|
934 | drawscreen(load, 0, 0); |
---|
935 | int port = 80, count = 0, mcount = 0; |
---|
936 | off64_t size = 0, msize = 0; |
---|
937 | char* host = NULL, *pos = NULL, *path = NULL, *file = NULL, *tmpstr = NULL; |
---|
938 | host = string_replace("http://", "", (char*)link, 0); |
---|
939 | |
---|
940 | if(host != NULL) |
---|
941 | pos = strchr(host, '/'); |
---|
942 | if(pos != NULL) |
---|
943 | { |
---|
944 | pos[0] = '\0'; |
---|
945 | path = pos + 1; |
---|
946 | } |
---|
947 | |
---|
948 | file = ostrcat(getconfig("rec_streampath", NULL), "/.cache.", 0, 0); |
---|
949 | file = ostrcat(file, filename, 1, 0); |
---|
950 | |
---|
951 | if(ostrstr(host, ":") != NULL) |
---|
952 | { |
---|
953 | host = oregex("http://(.*):.*", link); |
---|
954 | port = atoi(oregex("http://.*:(.*)/.*", link)); |
---|
955 | } |
---|
956 | |
---|
957 | debug(99, "---------------------------------------"); |
---|
958 | debug(99, "link: %s", link); |
---|
959 | debug(99, "---------------------------------------"); |
---|
960 | debug(99, "host: %s", host); |
---|
961 | debug(99, "port: %d", port); |
---|
962 | debug(99, "path: %s", path); |
---|
963 | debug(99, "local: %s", file); |
---|
964 | debug(99, "---------------------------------------"); |
---|
965 | |
---|
966 | |
---|
967 | struct download* dnode = NULL; |
---|
968 | dnode = calloc(1, sizeof(struct download)); |
---|
969 | if(dnode == NULL) |
---|
970 | { |
---|
971 | err("no mem"); |
---|
972 | return; |
---|
973 | } |
---|
974 | dnode->host = host; |
---|
975 | dnode->page = path; |
---|
976 | dnode->port = port; |
---|
977 | dnode->filename = file; |
---|
978 | dnode->auth = NULL; |
---|
979 | dnode->connfd = -1; |
---|
980 | dnode->ret = -1; |
---|
981 | dnode->timeout = 30000; |
---|
982 | |
---|
983 | addtimer(&gethttpstruct, START, 1000, 1, (void*)dnode, NULL, NULL); |
---|
984 | |
---|
985 | if(flag == 1) |
---|
986 | { |
---|
987 | mcount = 120; |
---|
988 | msize = 10485760; |
---|
989 | } |
---|
990 | else if(flag == 2) |
---|
991 | { |
---|
992 | mcount = 240; |
---|
993 | msize = 20971520; |
---|
994 | } |
---|
995 | else if(flag == 3) |
---|
996 | { |
---|
997 | mcount = 360; |
---|
998 | msize = 31457280; |
---|
999 | } |
---|
1000 | |
---|
1001 | while(count < mcount || size >= msize) |
---|
1002 | { |
---|
1003 | sleep(1); |
---|
1004 | count++; |
---|
1005 | if(file_exist(file)) |
---|
1006 | size = getfilesize(file); |
---|
1007 | |
---|
1008 | int proz = 0; |
---|
1009 | int proz1 = size * 100 / msize; |
---|
1010 | debug(99, "size (%dprozent)", proz1); |
---|
1011 | |
---|
1012 | int proz2 = count * 100 / mcount; |
---|
1013 | debug(99, "time (%dprozent)", proz2); |
---|
1014 | |
---|
1015 | if(proz1 > proz2) |
---|
1016 | proz = proz1; |
---|
1017 | else |
---|
1018 | proz = proz2; |
---|
1019 | |
---|
1020 | debug(99, "cacheing...(%lldkb) (%dprozent)", size / 1024, proz); |
---|
1021 | |
---|
1022 | if(size >= msize) |
---|
1023 | break; |
---|
1024 | if(count >= mcount) |
---|
1025 | break; |
---|
1026 | |
---|
1027 | tmpstr = ostrcat(_("please wait..."), " (", 0, 0); |
---|
1028 | tmpstr = ostrcat(tmpstr, oitoa(proz), 1, 1); |
---|
1029 | tmpstr = ostrcat(tmpstr, "%)", 1, 0); |
---|
1030 | clearscreen(load); |
---|
1031 | changetext(proztext, tmpstr); |
---|
1032 | drawscreen(load, 0, 0); |
---|
1033 | free(tmpstr), tmpstr = NULL; |
---|
1034 | } |
---|
1035 | |
---|
1036 | screenplay(file, filename, 2, 0); |
---|
1037 | sockclose(&dnode->connfd); |
---|
1038 | free(dnode); dnode = NULL; |
---|
1039 | |
---|
1040 | tmpstr = ostrcat(tmpstr, _("Remove Cachefile ?"), 1, 0); |
---|
1041 | tmpstr = ostrcat(tmpstr, "\n\n", 1, 0); |
---|
1042 | tmpstr = ostrcat(tmpstr, file, 1, 0); |
---|
1043 | |
---|
1044 | if(textbox(_("Message"), tmpstr, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1) |
---|
1045 | { |
---|
1046 | unlink(file); |
---|
1047 | } |
---|
1048 | free(tmpstr), tmpstr = NULL; |
---|
1049 | free(file), file = NULL; |
---|
1050 | free(host), host = NULL; |
---|
1051 | } |
---|
1052 | |
---|
1053 | void backgrounddl(char* link, char* filename) |
---|
1054 | { |
---|
1055 | int port = 80, ret = 0; |
---|
1056 | char* host = NULL, *pos = NULL, *path = NULL, *file = NULL, *tmpstr = NULL; |
---|
1057 | host = string_replace("http://", "", (char*)link, 0); |
---|
1058 | |
---|
1059 | if(host != NULL) |
---|
1060 | pos = strchr(host, '/'); |
---|
1061 | if(pos != NULL) |
---|
1062 | { |
---|
1063 | pos[0] = '\0'; |
---|
1064 | path = pos + 1; |
---|
1065 | } |
---|
1066 | |
---|
1067 | file = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0); |
---|
1068 | file = ostrcat(file, filename, 1, 0); |
---|
1069 | |
---|
1070 | if(ostrstr(host, ":") != NULL) |
---|
1071 | { |
---|
1072 | host = oregex("http://(.*):.*", link); |
---|
1073 | port = atoi(oregex("http://.*:(.*)/.*", link)); |
---|
1074 | } |
---|
1075 | |
---|
1076 | debug(99, "---------------------------------------"); |
---|
1077 | debug(99, "link: %s", link); |
---|
1078 | debug(99, "---------------------------------------"); |
---|
1079 | debug(99, "host: %s", host); |
---|
1080 | debug(99, "port: %d", port); |
---|
1081 | debug(99, "path: %s", path); |
---|
1082 | debug(99, "local: %s", file); |
---|
1083 | debug(99, "---------------------------------------"); |
---|
1084 | |
---|
1085 | ret = startbgdownload(host, path, port, file, NULL, 30000, 1); |
---|
1086 | if(ret == 1) |
---|
1087 | textbox(_("Message"), _("Can't start download.\nPlease try later."), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
1088 | |
---|
1089 | free(tmpstr), tmpstr = NULL; |
---|
1090 | free(file), file = NULL; |
---|
1091 | free(host), host = NULL; |
---|
1092 | } |
---|
1093 | |
---|
1094 | void submenu(struct skin* listbox, struct skin* load, char* title) |
---|
1095 | { |
---|
1096 | int flag = 0; |
---|
1097 | if(status.security == 1 || checkbox("WHITEBOX") == 1) |
---|
1098 | { |
---|
1099 | drawscreen(load, 0, 0); |
---|
1100 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1101 | char* tmpstr1 = NULL; |
---|
1102 | |
---|
1103 | if(((struct tithek*)listbox->select->handle)->flag == 2) |
---|
1104 | { |
---|
1105 | if(tmpstr != NULL) tmpstr1 = ostrcat(tmpstr, NULL, 0, 0); |
---|
1106 | } |
---|
1107 | else if(((struct tithek*)listbox->select->handle)->flag == 4) |
---|
1108 | { |
---|
1109 | if(tmpstr != NULL) tmpstr1 = youtube(tmpstr, NULL, NULL, 1); |
---|
1110 | } |
---|
1111 | else if(((struct tithek*)listbox->select->handle)->flag == 5) |
---|
1112 | { |
---|
1113 | if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl2now.rtl2.de", "rtl2now", 1); |
---|
1114 | } |
---|
1115 | else if(((struct tithek*)listbox->select->handle)->flag == 6) |
---|
1116 | { |
---|
1117 | if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.superrtlnow.de", "superrtlnow", 1); |
---|
1118 | } |
---|
1119 | else if(((struct tithek*)listbox->select->handle)->flag == 7) |
---|
1120 | { |
---|
1121 | if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl-now.rtl.de", "rtlnow", 1); |
---|
1122 | } |
---|
1123 | else if(((struct tithek*)listbox->select->handle)->flag == 8) |
---|
1124 | { |
---|
1125 | if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.voxnow.de", "voxnow", 1); |
---|
1126 | } |
---|
1127 | else if(((struct tithek*)listbox->select->handle)->flag == 12) |
---|
1128 | { |
---|
1129 | if(tmpstr != NULL) tmpstr1 = myvideo(tmpstr, NULL, NULL, 1); |
---|
1130 | } |
---|
1131 | else if(((struct tithek*)listbox->select->handle)->flag == 14) |
---|
1132 | { |
---|
1133 | if(tmpstr != NULL) tmpstr1 = kinox(tmpstr); |
---|
1134 | } |
---|
1135 | else if(((struct tithek*)listbox->select->handle)->flag == 16) |
---|
1136 | { |
---|
1137 | if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.superrtlnow.de", "superrtlnow", 1); |
---|
1138 | } |
---|
1139 | else if(((struct tithek*)listbox->select->handle)->flag == 17) |
---|
1140 | { |
---|
1141 | if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl-now.rtl.de", "rtlnow", 1); |
---|
1142 | } |
---|
1143 | else if(((struct tithek*)listbox->select->handle)->flag == 18) |
---|
1144 | { |
---|
1145 | if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://www.voxnow.de", "voxnow", 1); |
---|
1146 | } |
---|
1147 | else if(((struct tithek*)listbox->select->handle)->flag == 19) |
---|
1148 | { |
---|
1149 | if(tmpstr != NULL) tmpstr1 = rtl2now(tmpstr, "http://rtl2now.rtl2.de", "rtl2now", 1); |
---|
1150 | } |
---|
1151 | else if(((struct tithek*)listbox->select->handle)->flag == 38) |
---|
1152 | { |
---|
1153 | if(tmpstr != NULL) tmpstr1 = mlehd(tmpstr); |
---|
1154 | } |
---|
1155 | else if(((struct tithek*)listbox->select->handle)->flag == 41) |
---|
1156 | { |
---|
1157 | if(tmpstr != NULL) tmpstr1 = movie4k(tmpstr); |
---|
1158 | } |
---|
1159 | else if(((struct tithek*)listbox->select->handle)->flag == 42) |
---|
1160 | { |
---|
1161 | if(tmpstr != NULL) tmpstr1 = xvideos(tmpstr); |
---|
1162 | } |
---|
1163 | else if(((struct tithek*)listbox->select->handle)->flag == 43) |
---|
1164 | { |
---|
1165 | if(tmpstr != NULL) tmpstr1 = solarmovie(tmpstr); |
---|
1166 | } |
---|
1167 | else if(((struct tithek*)listbox->select->handle)->flag == 45) |
---|
1168 | { |
---|
1169 | if(tmpstr != NULL) tmpstr1 = ard(tmpstr); |
---|
1170 | } |
---|
1171 | else if(((struct tithek*)listbox->select->handle)->flag == 46) |
---|
1172 | { |
---|
1173 | if(tmpstr != NULL) tmpstr1 = zdf(tmpstr); |
---|
1174 | } |
---|
1175 | else if(((struct tithek*)listbox->select->handle)->flag == 50) |
---|
1176 | { |
---|
1177 | if(tmpstr != NULL) tmpstr1 = beeg(tmpstr); |
---|
1178 | } |
---|
1179 | |
---|
1180 | free(tmpstr); tmpstr = NULL; |
---|
1181 | |
---|
1182 | if(ostrcmp(title, "TiThek - Internet Radio") == 0) |
---|
1183 | flag = 4; |
---|
1184 | |
---|
1185 | if(ostrstr(tmpstr1, "&") != NULL) |
---|
1186 | { |
---|
1187 | printf("change streamurl from: %s\n", tmpstr1); |
---|
1188 | tmpstr1 = string_replace_all("&", "&", tmpstr1, 1); |
---|
1189 | printf("change streamurl to: %s\n", tmpstr1); |
---|
1190 | } |
---|
1191 | |
---|
1192 | if(tmpstr1 != NULL) |
---|
1193 | { |
---|
1194 | char* filename = ostrcat(title, "_", 0, 0); |
---|
1195 | filename = ostrcat(filename, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1196 | filename = ostrcat(filename, ".mp4", 1, 0); |
---|
1197 | filename = string_replace_all(" ", ".", filename, 1); |
---|
1198 | filename = string_replace_all("-", "_", filename, 1); |
---|
1199 | filename = string_replace_all("._.", "_", filename, 1); |
---|
1200 | debug(99, "filename: %s", filename); |
---|
1201 | |
---|
1202 | char* keyconf = NULL; |
---|
1203 | char* skintitle = "Choice Playback"; |
---|
1204 | struct menulist* mlist = NULL, *mbox = NULL; |
---|
1205 | |
---|
1206 | addmenulist(&mlist, "Streaming Playback (default)", NULL, NULL, 0, 0); |
---|
1207 | |
---|
1208 | if(!ostrncmp("http://", tmpstr1, 7)) |
---|
1209 | { |
---|
1210 | if(flag == 4) |
---|
1211 | { |
---|
1212 | addmenulist(&mlist, "Streaming Playback Caching (0.5MB)", NULL, NULL, 0, 0); |
---|
1213 | addmenulist(&mlist, "Streaming Playback Caching (1MB)", NULL, NULL, 0, 0); |
---|
1214 | } |
---|
1215 | else if(!ostrncmp("http://", tmpstr1, 7)) |
---|
1216 | { |
---|
1217 | // addmenulist(&mlist, "Streaming Playback Caching (1MB)", NULL, NULL, 0, 0); |
---|
1218 | // addmenulist(&mlist, "Streaming Playback Caching (2MB)", NULL, NULL, 0, 0); |
---|
1219 | // addmenulist(&mlist, "Streaming Playback Caching (3MB)", NULL, NULL, 0, 0); |
---|
1220 | // addmenulist(&mlist, "Streaming Playback Caching (4MB)", NULL, NULL, 0, 0); |
---|
1221 | addmenulist(&mlist, "Streaming Playback Caching (5MB)", NULL, NULL, 0, 0); |
---|
1222 | addmenulist(&mlist, "Streaming Playback Caching (7.5MB)", NULL, NULL, 0, 0); |
---|
1223 | addmenulist(&mlist, "Streaming Playback Caching (10MB)", NULL, NULL, 0, 0); |
---|
1224 | if(file_exist(getconfig("rec_streampath", NULL))) |
---|
1225 | { |
---|
1226 | // addmenulist(&mlist, "File Caching Playback (10MB / 120s)", NULL, NULL, 0, 0); |
---|
1227 | // addmenulist(&mlist, "File Caching Playback (20MB / 240s)", NULL, NULL, 0, 0); |
---|
1228 | // addmenulist(&mlist, "File Caching Playback (30MB / 360s)", NULL, NULL, 0, 0); |
---|
1229 | if(status.expertmodus >= 11 || file_exist("/mnt/swapextensions/etc/.codecpack") || file_exist("/var/swap/etc/.codecpack") || file_exist("/var/etc/.codecpack")) |
---|
1230 | { |
---|
1231 | addmenulist(&mlist, "Download Full File", NULL, NULL, 0, 0); |
---|
1232 | addmenulist(&mlist, "Download Full File (background)", NULL, NULL, 0, 0); |
---|
1233 | } |
---|
1234 | } |
---|
1235 | } |
---|
1236 | } |
---|
1237 | mbox = menulistbox(mlist, NULL, skintitle, NULL, NULL, 1, 0); |
---|
1238 | if(mbox != NULL) keyconf = mbox->name; |
---|
1239 | if(ostrcmp(keyconf, "Streaming Playback (default)") == 0) |
---|
1240 | { |
---|
1241 | addconfigtmp("playerbuffersize", "0"); |
---|
1242 | screenplay(tmpstr1, filename, 2, flag); |
---|
1243 | delconfigtmp("playerbuffersize"); |
---|
1244 | } |
---|
1245 | else if(ostrcmp(keyconf, "Streaming Playback Caching (0.5MB)") == 0) |
---|
1246 | { |
---|
1247 | addconfigtmp("playerbuffersize", "524288"); |
---|
1248 | screenplay(tmpstr1, filename, 2, flag); |
---|
1249 | delconfigtmp("playerbuffersize"); |
---|
1250 | } |
---|
1251 | else if(ostrcmp(keyconf, "Streaming Playback Caching (1MB)") == 0) |
---|
1252 | { |
---|
1253 | addconfigtmp("playerbuffersize", "1048576"); |
---|
1254 | screenplay(tmpstr1, filename, 2, flag); |
---|
1255 | delconfigtmp("playerbuffersize"); |
---|
1256 | } |
---|
1257 | else if(ostrcmp(keyconf, "Streaming Playback Caching (2MB)") == 0) |
---|
1258 | { |
---|
1259 | addconfigtmp("playerbuffersize", "2097152"); |
---|
1260 | screenplay(tmpstr1, filename, 2, flag); |
---|
1261 | delconfigtmp("playerbuffersize"); |
---|
1262 | } |
---|
1263 | else if(ostrcmp(keyconf, "Streaming Playback Caching (3MB)") == 0) |
---|
1264 | { |
---|
1265 | addconfigtmp("playerbuffersize", "3145728"); |
---|
1266 | screenplay(tmpstr1, filename, 2, flag); |
---|
1267 | delconfigtmp("playerbuffersize"); |
---|
1268 | } |
---|
1269 | else if(ostrcmp(keyconf, "Streaming Playback Caching (4MB)") == 0) |
---|
1270 | { |
---|
1271 | addconfigtmp("playerbuffersize", "4194304"); |
---|
1272 | screenplay(tmpstr1, filename, 2, flag); |
---|
1273 | delconfigtmp("playerbuffersize"); |
---|
1274 | } |
---|
1275 | else if(ostrcmp(keyconf, "Streaming Playback Caching (5MB)") == 0) |
---|
1276 | { |
---|
1277 | addconfigtmp("playerbuffersize", "5242880"); |
---|
1278 | screenplay(tmpstr1, filename, 2, flag); |
---|
1279 | delconfigtmp("playerbuffersize"); |
---|
1280 | } |
---|
1281 | else if(ostrcmp(keyconf, "Streaming Playback Caching (7.5MB)") == 0) |
---|
1282 | { |
---|
1283 | addconfigtmp("playerbuffersize", "7864320"); |
---|
1284 | screenplay(tmpstr1, filename, 2, flag); |
---|
1285 | delconfigtmp("playerbuffersize"); |
---|
1286 | } |
---|
1287 | else if(ostrcmp(keyconf, "Streaming Playback Caching (10MB)") == 0) |
---|
1288 | { |
---|
1289 | addconfigtmp("playerbuffersize", "10485760"); |
---|
1290 | screenplay(tmpstr1, filename, 2, flag); |
---|
1291 | delconfigtmp("playerbuffersize"); |
---|
1292 | } |
---|
1293 | else if(ostrcmp(keyconf, "File Caching Playback (10MB / 120s)") == 0) |
---|
1294 | { |
---|
1295 | cacheplay(tmpstr1, filename, 1); |
---|
1296 | } |
---|
1297 | else if(ostrcmp(keyconf, "File Caching Playback (20MB / 240s)") == 0) |
---|
1298 | { |
---|
1299 | cacheplay(tmpstr1, filename, 2); |
---|
1300 | } |
---|
1301 | else if(ostrcmp(keyconf, "File Caching Playback (30MB / 360s)") == 0) |
---|
1302 | { |
---|
1303 | cacheplay(tmpstr1, filename, 3); |
---|
1304 | } |
---|
1305 | else if(ostrcmp(keyconf, "Download Full File") == 0) |
---|
1306 | { |
---|
1307 | char* search = textinput("Filename", filename); |
---|
1308 | if(search != NULL) |
---|
1309 | { |
---|
1310 | char* tmpstr2 = tithekdownload(tmpstr1, search, NULL, 0, 1); |
---|
1311 | // drawscreen(grid, 0, 0); |
---|
1312 | free(tmpstr2); tmpstr2 = NULL; |
---|
1313 | |
---|
1314 | if(textbox(_("Message"), _("Start playback"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0) == 1) |
---|
1315 | { |
---|
1316 | tmpstr2 = ostrcat(getconfig("rec_streampath", NULL), "/", 0, 0); |
---|
1317 | tmpstr2 = ostrcat(tmpstr2, search, 1, 0); |
---|
1318 | screenplay(tmpstr2, filename, 2, flag); |
---|
1319 | free(tmpstr2); tmpstr2 = NULL; |
---|
1320 | } |
---|
1321 | } |
---|
1322 | free(search), search = NULL; |
---|
1323 | } |
---|
1324 | else if(ostrcmp(keyconf, "Download Full File (background)") == 0) |
---|
1325 | { |
---|
1326 | char* search = textinput("Filename", filename); |
---|
1327 | if(search != NULL) |
---|
1328 | backgrounddl(tmpstr1, search); |
---|
1329 | free(search), search = NULL; |
---|
1330 | } |
---|
1331 | |
---|
1332 | free(filename), filename = NULL; |
---|
1333 | freemenulist(mlist, 1); mlist = NULL; |
---|
1334 | } |
---|
1335 | else |
---|
1336 | textbox(_("Message"), _("Can't get Streamurl !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 0, 0); |
---|
1337 | |
---|
1338 | free(tmpstr1); tmpstr1 = NULL; |
---|
1339 | } |
---|
1340 | else |
---|
1341 | textbox(_("Message"), _("Registration needed, please contact Atemio !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1000, 200, 0, 0); |
---|
1342 | } |
---|
1343 | |
---|
1344 | void screentithekplay(char* titheklink, char* title, int first) |
---|
1345 | { |
---|
1346 | if(!file_exist("/mnt/swapextensions/player")) |
---|
1347 | mkdir("/mnt/swapextensions/player", 0777); |
---|
1348 | |
---|
1349 | char* disclaimer = NULL; |
---|
1350 | disclaimer = ostrcat(disclaimer, "/mnt/swapextensions/player/tithek_disclaimer_accepted", 1, 0); |
---|
1351 | |
---|
1352 | if(!file_exist(disclaimer)) |
---|
1353 | { |
---|
1354 | char* tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/disclaimer.txt", 80, NULL, HTTPAUTH, 5000, NULL, 0); |
---|
1355 | if(textbox(_("TitanNit Tithek disclaimer"), _(tmpstr), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1100, 650, 0, 0) == 1) |
---|
1356 | { |
---|
1357 | writesys(disclaimer, tmpstr, 0); |
---|
1358 | free(tmpstr), tmpstr = NULL; |
---|
1359 | } |
---|
1360 | else |
---|
1361 | { |
---|
1362 | free(tmpstr), tmpstr = NULL; |
---|
1363 | free(disclaimer), disclaimer = NULL; |
---|
1364 | return; |
---|
1365 | } |
---|
1366 | } |
---|
1367 | free(disclaimer), disclaimer = NULL; |
---|
1368 | |
---|
1369 | int rcret = -1, oaktline = 1, oaktpage = -1, ogridcol = 0, pagecount = 0; |
---|
1370 | |
---|
1371 | writesysint("/proc/sys/vm/drop_caches", 3, 0); |
---|
1372 | |
---|
1373 | if(first == 1) |
---|
1374 | { |
---|
1375 | delallfiles("/tmp/tithek", NULL); |
---|
1376 | mkdir("/tmp/tithek", 777); |
---|
1377 | if(status.mcaktiv == 0) |
---|
1378 | { |
---|
1379 | rcret = servicestop(status.aktservice, 1, 1); |
---|
1380 | if(rcret == 1) return; |
---|
1381 | } |
---|
1382 | } |
---|
1383 | |
---|
1384 | struct skin* grid = getscreen("titheklist"); |
---|
1385 | struct skin* listbox = getscreennode(grid, "listbox"); |
---|
1386 | struct skin* countlabel = getscreennode(grid, "countlabel"); |
---|
1387 | struct skin* countpage = getscreennode(grid, "countpage"); |
---|
1388 | struct skin* load = getscreen("loading"); |
---|
1389 | struct skin* tmp = NULL; |
---|
1390 | char* tithekpic = NULL; |
---|
1391 | |
---|
1392 | drawscreen(load, 0, 0); |
---|
1393 | |
---|
1394 | if(titheklink == NULL) return; |
---|
1395 | |
---|
1396 | listbox->aktpage = -1; |
---|
1397 | listbox->aktline = 1; |
---|
1398 | listbox->gridcol = 0; |
---|
1399 | listbox->select = NULL; |
---|
1400 | |
---|
1401 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, first); |
---|
1402 | if(pagecount == 0) return; |
---|
1403 | |
---|
1404 | changetitle(grid, _(title)); |
---|
1405 | drawscreen(grid, 0, 0); |
---|
1406 | addscreenrc(grid, listbox); |
---|
1407 | |
---|
1408 | while(1) |
---|
1409 | { |
---|
1410 | changetitle(grid, _(title)); |
---|
1411 | changetext(countpage, NULL); |
---|
1412 | if(listbox->select != NULL && listbox->select->handle != NULL) |
---|
1413 | { |
---|
1414 | tmp = listbox->select; |
---|
1415 | while(tmp != NULL) |
---|
1416 | { |
---|
1417 | |
---|
1418 | if(tmp->pagecount != listbox->aktpage) break; |
---|
1419 | |
---|
1420 | char* tmpstr = ostrcat(_("Page"), NULL, 0, 0); |
---|
1421 | tmpstr = ostrcat(tmpstr, " ( ", 1, 0); |
---|
1422 | tmpstr = ostrcat(tmpstr, oitoa(tmp->pagecount), 1, 1); |
---|
1423 | tmpstr = ostrcat(tmpstr, " / ", 1, 0); |
---|
1424 | tmpstr = ostrcat(tmpstr, oitoa(pagecount), 1, 1); |
---|
1425 | tmpstr = ostrcat(tmpstr, " )", 1, 0); |
---|
1426 | changetext(countpage, tmpstr); |
---|
1427 | free(tmpstr); tmpstr = NULL; |
---|
1428 | |
---|
1429 | if(tmp->handle != NULL) |
---|
1430 | { |
---|
1431 | tithekpic = tithekdownload(((struct tithek*)tmp->handle)->pic, ((struct tithek*)tmp->handle)->localname, "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0=", 1, 0); |
---|
1432 | |
---|
1433 | /* not working with thread download |
---|
1434 | off64_t checkpic = getfilesize(tithekpic); |
---|
1435 | |
---|
1436 | if(checkpic < 1000) |
---|
1437 | { |
---|
1438 | free(tithekpic); tithekpic = NULL; |
---|
1439 | tithekpic = ostrcat("/var/usr/local/share/titan/plugins/tithek/default.jpg", NULL, 0, 0); |
---|
1440 | } |
---|
1441 | */ |
---|
1442 | |
---|
1443 | changepic(tmp, tithekpic); |
---|
1444 | free(tithekpic); tithekpic = NULL; |
---|
1445 | } |
---|
1446 | tmp = tmp->prev; |
---|
1447 | } |
---|
1448 | tmp = listbox->select; |
---|
1449 | if(tmp != NULL) tmp = tmp->next; |
---|
1450 | while(tmp != NULL) |
---|
1451 | { |
---|
1452 | if(tmp->pagecount != listbox->aktpage) break; |
---|
1453 | if(tmp->handle != NULL) |
---|
1454 | { |
---|
1455 | tithekpic = tithekdownload(((struct tithek*)tmp->handle)->pic, ((struct tithek*)tmp->handle)->localname, "aXBrLUdaRmg6RkhaVkJHaG56ZnZFaEZERlRHenVpZjU2NzZ6aGpHVFVHQk5Iam0=", 1, 0); |
---|
1456 | |
---|
1457 | /* not working with thread download |
---|
1458 | off64_t checkpic = getfilesize(tithekpic); |
---|
1459 | |
---|
1460 | if(checkpic < 1000) |
---|
1461 | { |
---|
1462 | free(tithekpic); tithekpic = NULL; |
---|
1463 | tithekpic = ostrcat("/var/usr/local/share/titan/plugins/tithek/default.jpg", NULL, 0, 0); |
---|
1464 | } |
---|
1465 | */ |
---|
1466 | |
---|
1467 | changepic(tmp, tithekpic); |
---|
1468 | free(tithekpic); tithekpic = NULL; |
---|
1469 | } |
---|
1470 | tmp = tmp->next; |
---|
1471 | } |
---|
1472 | } |
---|
1473 | |
---|
1474 | int count = getfilecount(TITHEKPATH); |
---|
1475 | if(count > 500) |
---|
1476 | delallfiles(TITHEKPATH, ".jpg"); |
---|
1477 | |
---|
1478 | drawscreen(grid, 0, 0); |
---|
1479 | waitrcstart: |
---|
1480 | rcret = waitrc(grid, 2000, 2); |
---|
1481 | |
---|
1482 | if(rcret == RCTIMEOUT) |
---|
1483 | { |
---|
1484 | if(tithekdownloadrun == 1) |
---|
1485 | { |
---|
1486 | tithekdownloadrun = 0; |
---|
1487 | drawscreen(grid, 0, 0); |
---|
1488 | } |
---|
1489 | goto waitrcstart; |
---|
1490 | } |
---|
1491 | |
---|
1492 | if(rcret == getrcconfigint("rcblue", NULL)) |
---|
1493 | { |
---|
1494 | tithekexit = 1; |
---|
1495 | break; |
---|
1496 | } |
---|
1497 | |
---|
1498 | if(rcret == getrcconfigint("rcexit", NULL)) break; |
---|
1499 | if(rcret == getrcconfigint("rcmenu", NULL)) |
---|
1500 | { |
---|
1501 | screentithek_settings(); |
---|
1502 | |
---|
1503 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, first); |
---|
1504 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1505 | |
---|
1506 | listbox->aktpage = -1; |
---|
1507 | listbox->aktline = 1; |
---|
1508 | listbox->gridcol = 1; |
---|
1509 | addscreenrc(grid, listbox); |
---|
1510 | drawscreen(grid, 0, 0); |
---|
1511 | } |
---|
1512 | |
---|
1513 | if(rcret == getrcconfigint("rcred", NULL)) |
---|
1514 | { |
---|
1515 | if(listbox->select != NULL && listbox->select->handle != NULL) |
---|
1516 | { |
---|
1517 | |
---|
1518 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->title, NULL, 0, 0); |
---|
1519 | debug(99, "tmpstr: %s", tmpstr); |
---|
1520 | tmpstr = string_replace("-1 (de)", "", tmpstr, 1); |
---|
1521 | tmpstr = string_replace("-1 (en)", "", tmpstr, 1); |
---|
1522 | tmpstr = string_replace("-1 (\?\?)", "", tmpstr, 1); |
---|
1523 | tmpstr = string_replace("-2 (de)", "", tmpstr, 1); |
---|
1524 | tmpstr = string_replace("-2 (en)", "", tmpstr, 1); |
---|
1525 | tmpstr = string_replace("-2 (\?\?)", "", tmpstr, 1); |
---|
1526 | tmpstr = string_replace("-3 (de)", "", tmpstr, 1); |
---|
1527 | tmpstr = string_replace("-3 (en)", "", tmpstr, 1); |
---|
1528 | tmpstr = string_replace("-3 (\?\?)", "", tmpstr, 1); |
---|
1529 | tmpstr = string_replace(" (de)", "", tmpstr, 1); |
---|
1530 | tmpstr = string_replace(" (en)", "", tmpstr, 1); |
---|
1531 | tmpstr = string_replace(" (\?\?)", "", tmpstr, 1); |
---|
1532 | tmpstr = string_replace_all("_", " ", tmpstr, 1); |
---|
1533 | tmpstr = string_replace_all("-", " ", tmpstr, 1); |
---|
1534 | tmpstr = string_replace_all(".", " ", tmpstr, 1); |
---|
1535 | debug(99, "tmpstr: %s", tmpstr); |
---|
1536 | |
---|
1537 | int check = playrcred(tmpstr, NULL, 1, 0, 99); |
---|
1538 | if(check == 2) |
---|
1539 | { |
---|
1540 | if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search", tmpstr, 0) == 0) |
---|
1541 | { |
---|
1542 | oaktpage = listbox->aktpage; |
---|
1543 | oaktline = listbox->aktline; |
---|
1544 | ogridcol = listbox->gridcol; |
---|
1545 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1546 | char* tmpstr1 = ostrcat("KinoX - Search", " - ", 0, 0); |
---|
1547 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1548 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1549 | free(tmpstr); tmpstr = NULL; |
---|
1550 | free(tmpstr2); tmpstr2 = NULL; |
---|
1551 | |
---|
1552 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1553 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1554 | |
---|
1555 | listbox->aktpage = oaktpage; |
---|
1556 | listbox->aktline = oaktline; |
---|
1557 | listbox->gridcol = ogridcol; |
---|
1558 | addscreenrc(grid, listbox); |
---|
1559 | } |
---|
1560 | } |
---|
1561 | else if(check == 3) |
---|
1562 | { |
---|
1563 | if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "SolarMovies - Movie - Search", tmpstr, 0) == 0) |
---|
1564 | { |
---|
1565 | oaktpage = listbox->aktpage; |
---|
1566 | oaktline = listbox->aktline; |
---|
1567 | ogridcol = listbox->gridcol; |
---|
1568 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1569 | char* tmpstr1 = ostrcat("SolarMovies - Movie - Search", " - ", 0, 0); |
---|
1570 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1571 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1572 | free(tmpstr); tmpstr = NULL; |
---|
1573 | free(tmpstr2); tmpstr2 = NULL; |
---|
1574 | |
---|
1575 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1576 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1577 | |
---|
1578 | listbox->aktpage = oaktpage; |
---|
1579 | listbox->aktline = oaktline; |
---|
1580 | listbox->gridcol = ogridcol; |
---|
1581 | addscreenrc(grid, listbox); |
---|
1582 | } |
---|
1583 | } |
---|
1584 | else if(check == 4) |
---|
1585 | { |
---|
1586 | if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "SolarMovies - Tv - Search", tmpstr, 1) == 0) |
---|
1587 | { |
---|
1588 | oaktpage = listbox->aktpage; |
---|
1589 | oaktline = listbox->aktline; |
---|
1590 | ogridcol = listbox->gridcol; |
---|
1591 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1592 | char* tmpstr1 = ostrcat("SolarMovies - Tv - Search", " - ", 0, 0); |
---|
1593 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1594 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1595 | free(tmpstr); tmpstr = NULL; |
---|
1596 | free(tmpstr2); tmpstr2 = NULL; |
---|
1597 | |
---|
1598 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1599 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1600 | |
---|
1601 | listbox->aktpage = oaktpage; |
---|
1602 | listbox->aktline = oaktline; |
---|
1603 | listbox->gridcol = ogridcol; |
---|
1604 | addscreenrc(grid, listbox); |
---|
1605 | } |
---|
1606 | } |
---|
1607 | else if(check == 5) |
---|
1608 | { |
---|
1609 | if(youtube_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "Youtube - Search", tmpstr) == 0) |
---|
1610 | { |
---|
1611 | oaktpage = listbox->aktpage; |
---|
1612 | oaktline = listbox->aktline; |
---|
1613 | ogridcol = listbox->gridcol; |
---|
1614 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1615 | char* tmpstr1 = ostrcat("Youtube - Search", " - ", 0, 0); |
---|
1616 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1617 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1618 | free(tmpstr); tmpstr = NULL; |
---|
1619 | free(tmpstr2); tmpstr2 = NULL; |
---|
1620 | |
---|
1621 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1622 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1623 | |
---|
1624 | listbox->aktpage = oaktpage; |
---|
1625 | listbox->aktline = oaktline; |
---|
1626 | listbox->gridcol = ogridcol; |
---|
1627 | addscreenrc(grid, listbox); |
---|
1628 | } |
---|
1629 | } |
---|
1630 | else if(check == 7) |
---|
1631 | { |
---|
1632 | if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "KinoX - Search", tmpstr, 0) == 0) |
---|
1633 | { |
---|
1634 | oaktpage = listbox->aktpage; |
---|
1635 | oaktline = listbox->aktline; |
---|
1636 | ogridcol = listbox->gridcol; |
---|
1637 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1638 | char* tmpstr1 = ostrcat("Movie4k - Search", " - ", 0, 0); |
---|
1639 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1640 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1641 | free(tmpstr); tmpstr = NULL; |
---|
1642 | free(tmpstr2); tmpstr2 = NULL; |
---|
1643 | |
---|
1644 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1645 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1646 | |
---|
1647 | listbox->aktpage = oaktpage; |
---|
1648 | listbox->aktline = oaktline; |
---|
1649 | listbox->gridcol = ogridcol; |
---|
1650 | addscreenrc(grid, listbox); |
---|
1651 | } |
---|
1652 | } |
---|
1653 | else if((((struct tithek*)listbox->select->handle)->flag == 13)) |
---|
1654 | { |
---|
1655 | if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, "MyVideo - Search", tmpstr, 0) == 0) |
---|
1656 | { |
---|
1657 | oaktpage = listbox->aktpage; |
---|
1658 | oaktline = listbox->aktline; |
---|
1659 | ogridcol = listbox->gridcol; |
---|
1660 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1661 | char* tmpstr1 = ostrcat("MyVideo - Search", " - ", 0, 0); |
---|
1662 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1663 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1664 | free(tmpstr); tmpstr = NULL; |
---|
1665 | free(tmpstr2); tmpstr2 = NULL; |
---|
1666 | |
---|
1667 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1668 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1669 | |
---|
1670 | listbox->aktpage = oaktpage; |
---|
1671 | listbox->aktline = oaktline; |
---|
1672 | listbox->gridcol = ogridcol; |
---|
1673 | addscreenrc(grid, listbox); |
---|
1674 | } |
---|
1675 | } |
---|
1676 | |
---|
1677 | free(tmpstr), tmpstr = NULL; |
---|
1678 | } |
---|
1679 | } |
---|
1680 | else if(rcret == getrcconfigint("rcok", NULL)) |
---|
1681 | { |
---|
1682 | if(listbox->select != NULL && listbox->select->handle != NULL) |
---|
1683 | { |
---|
1684 | clearscreen(grid); |
---|
1685 | |
---|
1686 | if((((struct tithek*)listbox->select->handle)->flag == 2) || (((struct tithek*)listbox->select->handle)->flag == 4) || (((struct tithek*)listbox->select->handle)->flag == 5) || (((struct tithek*)listbox->select->handle)->flag == 6) || (((struct tithek*)listbox->select->handle)->flag == 7) || (((struct tithek*)listbox->select->handle)->flag == 8) || (((struct tithek*)listbox->select->handle)->flag == 12) || (((struct tithek*)listbox->select->handle)->flag == 14) || (((struct tithek*)listbox->select->handle)->flag == 15) || (((struct tithek*)listbox->select->handle)->flag == 16) || (((struct tithek*)listbox->select->handle)->flag == 17) || (((struct tithek*)listbox->select->handle)->flag == 18) || (((struct tithek*)listbox->select->handle)->flag == 19) || (((struct tithek*)listbox->select->handle)->flag == 20) || (((struct tithek*)listbox->select->handle)->flag == 24) || (((struct tithek*)listbox->select->handle)->flag == 25) || (((struct tithek*)listbox->select->handle)->flag == 26) || (((struct tithek*)listbox->select->handle)->flag == 27) || (((struct tithek*)listbox->select->handle)->flag == 38) || (((struct tithek*)listbox->select->handle)->flag == 42) || (((struct tithek*)listbox->select->handle)->flag == 45) || (((struct tithek*)listbox->select->handle)->flag == 46) || (((struct tithek*)listbox->select->handle)->flag == 50) || (((struct tithek*)listbox->select->handle)->flag == 41) || (((struct tithek*)listbox->select->handle)->flag == 43)) |
---|
1687 | { |
---|
1688 | submenu(listbox, load, title); |
---|
1689 | drawscreen(grid, 0, 0); |
---|
1690 | } |
---|
1691 | else if((((struct tithek*)listbox->select->handle)->flag == 9) || (((struct tithek*)listbox->select->handle)->flag == 10) || (((struct tithek*)listbox->select->handle)->flag == 11)) |
---|
1692 | { |
---|
1693 | if(youtube_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL) == 0) |
---|
1694 | { |
---|
1695 | oaktpage = listbox->aktpage; |
---|
1696 | oaktline = listbox->aktline; |
---|
1697 | ogridcol = listbox->gridcol; |
---|
1698 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1699 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1700 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1701 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1702 | free(tmpstr); tmpstr = NULL; |
---|
1703 | free(tmpstr2); tmpstr2 = NULL; |
---|
1704 | |
---|
1705 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1706 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1707 | |
---|
1708 | listbox->aktpage = oaktpage; |
---|
1709 | listbox->aktline = oaktline; |
---|
1710 | listbox->gridcol = ogridcol; |
---|
1711 | addscreenrc(grid, listbox); |
---|
1712 | } |
---|
1713 | } |
---|
1714 | else if(((struct tithek*)listbox->select->handle)->flag == 13) |
---|
1715 | { |
---|
1716 | if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0) |
---|
1717 | { |
---|
1718 | oaktpage = listbox->aktpage; |
---|
1719 | oaktline = listbox->aktline; |
---|
1720 | ogridcol = listbox->gridcol; |
---|
1721 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1722 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1723 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1724 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1725 | free(tmpstr); tmpstr = NULL; |
---|
1726 | free(tmpstr2); tmpstr2 = NULL; |
---|
1727 | |
---|
1728 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1729 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1730 | |
---|
1731 | listbox->aktpage = oaktpage; |
---|
1732 | listbox->aktline = oaktline; |
---|
1733 | listbox->gridcol = ogridcol; |
---|
1734 | addscreenrc(grid, listbox); |
---|
1735 | } |
---|
1736 | } |
---|
1737 | else if(((struct tithek*)listbox->select->handle)->flag == 44) |
---|
1738 | { |
---|
1739 | if(myvideo_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0) |
---|
1740 | { |
---|
1741 | oaktpage = listbox->aktpage; |
---|
1742 | oaktline = listbox->aktline; |
---|
1743 | ogridcol = listbox->gridcol; |
---|
1744 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1745 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1746 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1747 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1748 | free(tmpstr); tmpstr = NULL; |
---|
1749 | free(tmpstr2); tmpstr2 = NULL; |
---|
1750 | |
---|
1751 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1752 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1753 | |
---|
1754 | listbox->aktpage = oaktpage; |
---|
1755 | listbox->aktline = oaktline; |
---|
1756 | listbox->gridcol = ogridcol; |
---|
1757 | addscreenrc(grid, listbox); |
---|
1758 | } |
---|
1759 | } |
---|
1760 | else if((((struct tithek*)listbox->select->handle)->flag == 21)) |
---|
1761 | { |
---|
1762 | if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0) |
---|
1763 | { |
---|
1764 | oaktpage = listbox->aktpage; |
---|
1765 | oaktline = listbox->aktline; |
---|
1766 | ogridcol = listbox->gridcol; |
---|
1767 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1768 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1769 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1770 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1771 | free(tmpstr); tmpstr = NULL; |
---|
1772 | free(tmpstr2); tmpstr2 = NULL; |
---|
1773 | |
---|
1774 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1775 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1776 | |
---|
1777 | listbox->aktpage = oaktpage; |
---|
1778 | listbox->aktline = oaktline; |
---|
1779 | listbox->gridcol = ogridcol; |
---|
1780 | addscreenrc(grid, listbox); |
---|
1781 | } |
---|
1782 | } |
---|
1783 | else if((((struct tithek*)listbox->select->handle)->flag == 33)) |
---|
1784 | { |
---|
1785 | if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0) |
---|
1786 | { |
---|
1787 | oaktpage = listbox->aktpage; |
---|
1788 | oaktline = listbox->aktline; |
---|
1789 | ogridcol = listbox->gridcol; |
---|
1790 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1791 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1792 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1793 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1794 | free(tmpstr); tmpstr = NULL; |
---|
1795 | free(tmpstr2); tmpstr2 = NULL; |
---|
1796 | |
---|
1797 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1798 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1799 | |
---|
1800 | listbox->aktpage = oaktpage; |
---|
1801 | listbox->aktline = oaktline; |
---|
1802 | listbox->gridcol = ogridcol; |
---|
1803 | addscreenrc(grid, listbox); |
---|
1804 | } |
---|
1805 | } |
---|
1806 | else if(((struct tithek*)listbox->select->handle)->flag == 29) |
---|
1807 | { |
---|
1808 | if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 0) == 0) |
---|
1809 | { |
---|
1810 | oaktpage = listbox->aktpage; |
---|
1811 | oaktline = listbox->aktline; |
---|
1812 | ogridcol = listbox->gridcol; |
---|
1813 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1814 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1815 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1816 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1817 | free(tmpstr); tmpstr = NULL; |
---|
1818 | free(tmpstr2); tmpstr2 = NULL; |
---|
1819 | |
---|
1820 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1821 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1822 | |
---|
1823 | listbox->aktpage = oaktpage; |
---|
1824 | listbox->aktline = oaktline; |
---|
1825 | listbox->gridcol = ogridcol; |
---|
1826 | addscreenrc(grid, listbox); |
---|
1827 | } |
---|
1828 | } |
---|
1829 | else if(((struct tithek*)listbox->select->handle)->flag == 30) |
---|
1830 | { |
---|
1831 | if(solarmovie_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0) |
---|
1832 | { |
---|
1833 | oaktpage = listbox->aktpage; |
---|
1834 | oaktline = listbox->aktline; |
---|
1835 | ogridcol = listbox->gridcol; |
---|
1836 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1837 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1838 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1839 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1840 | free(tmpstr); tmpstr = NULL; |
---|
1841 | free(tmpstr2); tmpstr2 = NULL; |
---|
1842 | |
---|
1843 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1844 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1845 | |
---|
1846 | listbox->aktpage = oaktpage; |
---|
1847 | listbox->aktline = oaktline; |
---|
1848 | listbox->gridcol = ogridcol; |
---|
1849 | addscreenrc(grid, listbox); |
---|
1850 | } |
---|
1851 | } |
---|
1852 | else if((((struct tithek*)listbox->select->handle)->flag == 31)) |
---|
1853 | { |
---|
1854 | if(kinox_search_cast(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL) == 0) |
---|
1855 | { |
---|
1856 | oaktpage = listbox->aktpage; |
---|
1857 | oaktline = listbox->aktline; |
---|
1858 | ogridcol = listbox->gridcol; |
---|
1859 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1860 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1861 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1862 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1863 | free(tmpstr); tmpstr = NULL; |
---|
1864 | free(tmpstr2); tmpstr2 = NULL; |
---|
1865 | |
---|
1866 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1867 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1868 | |
---|
1869 | listbox->aktpage = oaktpage; |
---|
1870 | listbox->aktline = oaktline; |
---|
1871 | listbox->gridcol = ogridcol; |
---|
1872 | addscreenrc(grid, listbox); |
---|
1873 | } |
---|
1874 | } |
---|
1875 | else if((((struct tithek*)listbox->select->handle)->flag == 32)) |
---|
1876 | { |
---|
1877 | if(kinox_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0) |
---|
1878 | { |
---|
1879 | oaktpage = listbox->aktpage; |
---|
1880 | oaktline = listbox->aktline; |
---|
1881 | ogridcol = listbox->gridcol; |
---|
1882 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1883 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1884 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1885 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1886 | free(tmpstr); tmpstr = NULL; |
---|
1887 | free(tmpstr2); tmpstr2 = NULL; |
---|
1888 | |
---|
1889 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1890 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1891 | |
---|
1892 | listbox->aktpage = oaktpage; |
---|
1893 | listbox->aktline = oaktline; |
---|
1894 | listbox->gridcol = ogridcol; |
---|
1895 | addscreenrc(grid, listbox); |
---|
1896 | } |
---|
1897 | } |
---|
1898 | else if((((struct tithek*)listbox->select->handle)->flag == 33)) |
---|
1899 | { |
---|
1900 | if(movie4k_search(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title, NULL, 1) == 0) |
---|
1901 | { |
---|
1902 | oaktpage = listbox->aktpage; |
---|
1903 | oaktline = listbox->aktline; |
---|
1904 | ogridcol = listbox->gridcol; |
---|
1905 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1906 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1907 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1908 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1909 | free(tmpstr); tmpstr = NULL; |
---|
1910 | free(tmpstr2); tmpstr2 = NULL; |
---|
1911 | |
---|
1912 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 3); |
---|
1913 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1914 | |
---|
1915 | listbox->aktpage = oaktpage; |
---|
1916 | listbox->aktline = oaktline; |
---|
1917 | listbox->gridcol = ogridcol; |
---|
1918 | addscreenrc(grid, listbox); |
---|
1919 | } |
---|
1920 | } |
---|
1921 | else if((((struct tithek*)listbox->select->handle)->flag == 34) || (((struct tithek*)listbox->select->handle)->flag == 35)) |
---|
1922 | { |
---|
1923 | if(movie4k_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0) |
---|
1924 | { |
---|
1925 | oaktpage = listbox->aktpage; |
---|
1926 | oaktline = listbox->aktline; |
---|
1927 | ogridcol = listbox->gridcol; |
---|
1928 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1929 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1930 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1931 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1932 | free(tmpstr); tmpstr = NULL; |
---|
1933 | free(tmpstr2); tmpstr2 = NULL; |
---|
1934 | |
---|
1935 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
1936 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1937 | |
---|
1938 | listbox->aktpage = oaktpage; |
---|
1939 | listbox->aktline = oaktline; |
---|
1940 | listbox->gridcol = ogridcol; |
---|
1941 | addscreenrc(grid, listbox); |
---|
1942 | } |
---|
1943 | } |
---|
1944 | else if((((struct tithek*)listbox->select->handle)->flag == 22)) |
---|
1945 | { |
---|
1946 | if(kinox_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0) |
---|
1947 | { |
---|
1948 | oaktpage = listbox->aktpage; |
---|
1949 | oaktline = listbox->aktline; |
---|
1950 | ogridcol = listbox->gridcol; |
---|
1951 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1952 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1953 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1954 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1955 | free(tmpstr); tmpstr = NULL; |
---|
1956 | free(tmpstr2); tmpstr2 = NULL; |
---|
1957 | |
---|
1958 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 3); |
---|
1959 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1960 | |
---|
1961 | listbox->aktpage = oaktpage; |
---|
1962 | listbox->aktline = oaktline; |
---|
1963 | listbox->gridcol = ogridcol; |
---|
1964 | addscreenrc(grid, listbox); |
---|
1965 | } |
---|
1966 | } |
---|
1967 | else if((((struct tithek*)listbox->select->handle)->flag == 28)) |
---|
1968 | { |
---|
1969 | if(solarmovie_hoster(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0) |
---|
1970 | { |
---|
1971 | oaktpage = listbox->aktpage; |
---|
1972 | oaktline = listbox->aktline; |
---|
1973 | ogridcol = listbox->gridcol; |
---|
1974 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1975 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1976 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
1977 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
1978 | free(tmpstr); tmpstr = NULL; |
---|
1979 | free(tmpstr2); tmpstr2 = NULL; |
---|
1980 | |
---|
1981 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 3); |
---|
1982 | if(pagecount == 0 || tithekexit == 1) break; |
---|
1983 | |
---|
1984 | listbox->aktpage = oaktpage; |
---|
1985 | listbox->aktline = oaktline; |
---|
1986 | listbox->gridcol = ogridcol; |
---|
1987 | addscreenrc(grid, listbox); |
---|
1988 | } |
---|
1989 | } |
---|
1990 | else if((((struct tithek*)listbox->select->handle)->flag == 23)) |
---|
1991 | { |
---|
1992 | if(kinox_hoster_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0) |
---|
1993 | { |
---|
1994 | oaktpage = listbox->aktpage; |
---|
1995 | oaktline = listbox->aktline; |
---|
1996 | ogridcol = listbox->gridcol; |
---|
1997 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
1998 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
1999 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
2000 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
2001 | free(tmpstr); tmpstr = NULL; |
---|
2002 | free(tmpstr2); tmpstr2 = NULL; |
---|
2003 | |
---|
2004 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
2005 | if(pagecount == 0 || tithekexit == 1) break; |
---|
2006 | |
---|
2007 | listbox->aktpage = oaktpage; |
---|
2008 | listbox->aktline = oaktline; |
---|
2009 | listbox->gridcol = ogridcol; |
---|
2010 | addscreenrc(grid, listbox); |
---|
2011 | } |
---|
2012 | } |
---|
2013 | else if((((struct tithek*)listbox->select->handle)->flag == 36) || (((struct tithek*)listbox->select->handle)->flag == 37)) |
---|
2014 | { |
---|
2015 | if(movie4k_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0) |
---|
2016 | { |
---|
2017 | oaktpage = listbox->aktpage; |
---|
2018 | oaktline = listbox->aktline; |
---|
2019 | ogridcol = listbox->gridcol; |
---|
2020 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
2021 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
2022 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
2023 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
2024 | free(tmpstr); tmpstr = NULL; |
---|
2025 | free(tmpstr2); tmpstr2 = NULL; |
---|
2026 | |
---|
2027 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
2028 | if(pagecount == 0 || tithekexit == 1) break; |
---|
2029 | |
---|
2030 | listbox->aktpage = oaktpage; |
---|
2031 | listbox->aktline = oaktline; |
---|
2032 | listbox->gridcol = ogridcol; |
---|
2033 | addscreenrc(grid, listbox); |
---|
2034 | } |
---|
2035 | } |
---|
2036 | else if((((struct tithek*)listbox->select->handle)->flag == 39)) |
---|
2037 | { |
---|
2038 | if(movie4k_series_listed(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0) |
---|
2039 | { |
---|
2040 | oaktpage = listbox->aktpage; |
---|
2041 | oaktline = listbox->aktline; |
---|
2042 | ogridcol = listbox->gridcol; |
---|
2043 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
2044 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
2045 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
2046 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
2047 | free(tmpstr); tmpstr = NULL; |
---|
2048 | free(tmpstr2); tmpstr2 = NULL; |
---|
2049 | |
---|
2050 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
2051 | if(pagecount == 0 || tithekexit == 1) break; |
---|
2052 | |
---|
2053 | listbox->aktpage = oaktpage; |
---|
2054 | listbox->aktline = oaktline; |
---|
2055 | listbox->gridcol = ogridcol; |
---|
2056 | addscreenrc(grid, listbox); |
---|
2057 | } |
---|
2058 | } |
---|
2059 | else if((((struct tithek*)listbox->select->handle)->flag == 40)) |
---|
2060 | { |
---|
2061 | if(movie4k_hoster_series(grid, listbox, countlabel, load, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->title) == 0) |
---|
2062 | { |
---|
2063 | oaktpage = listbox->aktpage; |
---|
2064 | oaktline = listbox->aktline; |
---|
2065 | ogridcol = listbox->gridcol; |
---|
2066 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
2067 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
2068 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
2069 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
2070 | free(tmpstr); tmpstr = NULL; |
---|
2071 | free(tmpstr2); tmpstr2 = NULL; |
---|
2072 | |
---|
2073 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
2074 | if(pagecount == 0 || tithekexit == 1) break; |
---|
2075 | |
---|
2076 | listbox->aktpage = oaktpage; |
---|
2077 | listbox->aktline = oaktline; |
---|
2078 | listbox->gridcol = ogridcol; |
---|
2079 | addscreenrc(grid, listbox); |
---|
2080 | } |
---|
2081 | } |
---|
2082 | else if((((struct tithek*)listbox->select->handle)->flag == 66)) |
---|
2083 | { |
---|
2084 | textbox(_("Message"), _("The hoster is not yet supported !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0); |
---|
2085 | continue; |
---|
2086 | } |
---|
2087 | else if((((struct tithek*)listbox->select->handle)->flag == 3)) |
---|
2088 | { |
---|
2089 | int pincheck = 0; |
---|
2090 | if(((struct tithek*)listbox->select->handle)->flag == 1000) |
---|
2091 | pincheck = screenpincheck(0, NULL); |
---|
2092 | if(pincheck == 0) |
---|
2093 | { |
---|
2094 | oaktpage = listbox->aktpage; |
---|
2095 | oaktline = listbox->aktline; |
---|
2096 | ogridcol = listbox->gridcol; |
---|
2097 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
2098 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
2099 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
2100 | screentithekplay(tmpstr, tmpstr2, 3); |
---|
2101 | free(tmpstr); tmpstr = NULL; |
---|
2102 | free(tmpstr2); tmpstr2 = NULL; |
---|
2103 | |
---|
2104 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
2105 | if(pagecount == 0 || tithekexit == 1) break; |
---|
2106 | |
---|
2107 | listbox->aktpage = oaktpage; |
---|
2108 | listbox->aktline = oaktline; |
---|
2109 | listbox->gridcol = ogridcol; |
---|
2110 | addscreenrc(grid, listbox); |
---|
2111 | } |
---|
2112 | } |
---|
2113 | else |
---|
2114 | { |
---|
2115 | int pincheck = 0; |
---|
2116 | if(((struct tithek*)listbox->select->handle)->flag == 1000) |
---|
2117 | pincheck = screenpincheck(0, NULL); |
---|
2118 | if(pincheck == 0) |
---|
2119 | { |
---|
2120 | oaktpage = listbox->aktpage; |
---|
2121 | oaktline = listbox->aktline; |
---|
2122 | ogridcol = listbox->gridcol; |
---|
2123 | char* tmpstr = ostrcat(((struct tithek*)listbox->select->handle)->link, NULL, 0, 0); |
---|
2124 | char* tmpstr1 = ostrcat(((struct tithek*)listbox->select->handle)->menutitle, " - ", 0, 0); |
---|
2125 | char* tmpstr2 = ostrcat(tmpstr1, ((struct tithek*)listbox->select->handle)->title, 1, 0); |
---|
2126 | screentithekplay(tmpstr, tmpstr2, 0); |
---|
2127 | free(tmpstr); tmpstr = NULL; |
---|
2128 | free(tmpstr2); tmpstr2 = NULL; |
---|
2129 | |
---|
2130 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
2131 | if(pagecount == 0 || tithekexit == 1) break; |
---|
2132 | |
---|
2133 | listbox->aktpage = oaktpage; |
---|
2134 | listbox->aktline = oaktline; |
---|
2135 | listbox->gridcol = ogridcol; |
---|
2136 | addscreenrc(grid, listbox); |
---|
2137 | } |
---|
2138 | } |
---|
2139 | drawscreen(grid, 0, 0); |
---|
2140 | } |
---|
2141 | } |
---|
2142 | else if(rcret == getrcconfigint("rcyellow", NULL) && ostrcmp(title, "TiThek - Favoriten") == 0) |
---|
2143 | { |
---|
2144 | if(listbox->select != NULL && listbox->select->handle != NULL) |
---|
2145 | { |
---|
2146 | if(textbox(_("Message"), _("Remove this Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0) == 1) |
---|
2147 | { |
---|
2148 | removefav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag); |
---|
2149 | pagecount = createtithekplay(titheklink, grid, listbox, countlabel, 0); |
---|
2150 | if(pagecount == 0) return; |
---|
2151 | |
---|
2152 | drawscreen(grid, 0, 0); |
---|
2153 | } |
---|
2154 | } |
---|
2155 | } |
---|
2156 | else if(rcret == getrcconfigint("rcgreen", NULL) && ostrcmp(title, "TiThek - Favoriten") != 0) |
---|
2157 | { |
---|
2158 | if(listbox->select != NULL && listbox->select->handle != NULL) |
---|
2159 | { |
---|
2160 | if(textbox(_("Message"), _("Add this link as Favorite ?"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0) == 1) |
---|
2161 | { |
---|
2162 | addfav(((struct tithek*)listbox->select->handle)->title, ((struct tithek*)listbox->select->handle)->link, ((struct tithek*)listbox->select->handle)->pic, ((struct tithek*)listbox->select->handle)->localname, ((struct tithek*)listbox->select->handle)->menutitle, ((struct tithek*)listbox->select->handle)->flag); |
---|
2163 | } |
---|
2164 | } |
---|
2165 | } |
---|
2166 | } |
---|
2167 | |
---|
2168 | delmarkedscreennodes(grid, 1); |
---|
2169 | delownerrc(grid); |
---|
2170 | clearscreen(grid); |
---|
2171 | |
---|
2172 | if(first == 1) |
---|
2173 | { |
---|
2174 | freetithek(); |
---|
2175 | delallfiles("/tmp/tithek", ".list"); |
---|
2176 | if(status.mcaktiv == 0) |
---|
2177 | servicecheckret(servicestart(status.lastservice->channel, NULL, NULL, 0), 0); |
---|
2178 | } |
---|
2179 | } |
---|
2180 | |
---|
2181 | #endif |
---|