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