1 | #ifndef RTL2NOW_H
|
---|
2 | #define RTL2NOW_H
|
---|
3 |
|
---|
4 | // flag 1 = get getstreamurl http
|
---|
5 | // flag 2 = getstreamurl
|
---|
6 |
|
---|
7 | char* now(char* link, char* url, char* name, char* title, int flag)
|
---|
8 | {
|
---|
9 | debug(99, "link(%d): %s", flag, link);
|
---|
10 | char* ip = NULL, *pos = NULL, *path = NULL, *streamurl = NULL, *newlink = NULL, *newpath = NULL;
|
---|
11 |
|
---|
12 | ip = string_replace("http://", "", (char*)link, 0);
|
---|
13 |
|
---|
14 | if(ip != NULL)
|
---|
15 | pos = strchr(ip, '/');
|
---|
16 | if(pos != NULL)
|
---|
17 | {
|
---|
18 | pos[0] = '\0';
|
---|
19 | path = pos + 1;
|
---|
20 | }
|
---|
21 |
|
---|
22 | char* tmpstr = NULL;
|
---|
23 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
|
---|
24 | printf("00000000\n");
|
---|
25 |
|
---|
26 | if(flag == 1)
|
---|
27 | {
|
---|
28 | printf("111111111\n");
|
---|
29 |
|
---|
30 | // if(ostrstr(tmpstr, "<!-- 3-->") == NULL)
|
---|
31 | // textbox(_("Message"), _("Found Pay Stream visit the official Website and Order this Stream and try this again !") , _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0);
|
---|
32 |
|
---|
33 | if(ostrstr(title, "Euro)") != NULL)
|
---|
34 | textbox(_("Message"), _("Found Pay Stream visit the official Website and Order this Stream and try this again !") , _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0);
|
---|
35 |
|
---|
36 | tmpstr = string_resub("data:'", "',", tmpstr, 0);
|
---|
37 | debug(99, "tmpstr: %s", tmpstr);
|
---|
38 |
|
---|
39 | htmldecode(tmpstr, tmpstr);
|
---|
40 | tmpstr = ostrcat(url, tmpstr, 0, 1);
|
---|
41 | debug(99, "streamurl: %s", tmpstr);
|
---|
42 | streamurl = now(tmpstr, url, name, title, 2);
|
---|
43 | free(tmpstr); tmpstr = NULL;
|
---|
44 | }
|
---|
45 | else if(flag == 2)
|
---|
46 | {
|
---|
47 | printf("22222222\n");
|
---|
48 |
|
---|
49 | if(ostrstr(tmpstr, "rtmpe://") != NULL)
|
---|
50 | {
|
---|
51 | printf("22222222aaaaaaaaaaa\n");
|
---|
52 |
|
---|
53 | tmpstr = string_resub("rtmpe://", ".f4v", tmpstr, 0);
|
---|
54 |
|
---|
55 | char* tmpstr9 = NULL;
|
---|
56 | tmpstr9 = ostrcat(tmpstr9, tmpstr, 1, 0);
|
---|
57 | free(tmpstr), tmpstr = NULL;
|
---|
58 | tmpstr = ostrcat("rtmpe://", tmpstr9, 0, 0);
|
---|
59 | tmpstr = ostrcat(tmpstr, ".f4v", 1, 0);
|
---|
60 | free(tmpstr9), tmpstr9 = NULL;
|
---|
61 |
|
---|
62 | debug(99, "tmpstr: %s", tmpstr);
|
---|
63 |
|
---|
64 | int count = 0;
|
---|
65 | int i = 0;
|
---|
66 | struct splitstr* ret1 = NULL;
|
---|
67 | ret1 = strsplit(tmpstr, "/", &count);
|
---|
68 | if(ret1 != NULL)
|
---|
69 | {
|
---|
70 | int max = count;
|
---|
71 | for(i = 0; i < max; i++)
|
---|
72 | {
|
---|
73 | if(i < 3)
|
---|
74 | {
|
---|
75 | if(count > i)
|
---|
76 | newlink = ostrcat(newlink, (&ret1[i])->part, 1, 0);
|
---|
77 |
|
---|
78 | if(i == 0)
|
---|
79 | newlink = ostrcat(newlink, "//", 1, 0);
|
---|
80 | else
|
---|
81 | newlink = ostrcat(newlink, "/", 1, 0);
|
---|
82 | }
|
---|
83 | else
|
---|
84 | {
|
---|
85 | if(count > i)
|
---|
86 | newpath = ostrcat(newpath, (&ret1[i])->part, 1, 0);
|
---|
87 | if(i != max - 1)
|
---|
88 | newpath = ostrcat(newpath, "/", 1, 0);
|
---|
89 | }
|
---|
90 | }
|
---|
91 | free(ret1), ret1 = NULL;
|
---|
92 |
|
---|
93 | debug(99, "newlink: %s", newlink);
|
---|
94 | debug(99, "newpath: %s", newpath);
|
---|
95 |
|
---|
96 | streamurl = ostrcat(newlink, " swfVfy=1 playpath=mp4:", 0, 0);
|
---|
97 | streamurl = ostrcat(streamurl, newpath, 1, 0);
|
---|
98 | streamurl = ostrcat(streamurl, " app=", 1, 0);
|
---|
99 | streamurl = ostrcat(streamurl, name, 1, 0);
|
---|
100 | streamurl = ostrcat(streamurl, "/_definst_ pageUrl=", 1, 0);
|
---|
101 | streamurl = ostrcat(streamurl, url, 1, 0);
|
---|
102 | streamurl = ostrcat(streamurl, "/p/ tcUrl=", 1, 0);
|
---|
103 | streamurl = ostrcat(streamurl, newlink, 1, 0);
|
---|
104 | streamurl = ostrcat(streamurl, " swfUrl=", 1, 0);
|
---|
105 | streamurl = ostrcat(streamurl, url, 1, 0);
|
---|
106 | streamurl = ostrcat(streamurl, "/includes/vodplayer.swf", 1, 0);
|
---|
107 | }
|
---|
108 | free(tmpstr); tmpstr = NULL;
|
---|
109 | debug(99, "streamurl: %s", streamurl);
|
---|
110 | }
|
---|
111 | else
|
---|
112 | {
|
---|
113 | printf("2222222bbbbbbbbbb\n");
|
---|
114 |
|
---|
115 | tmpstr = string_resub("<filename", "</filename>", tmpstr, 1);
|
---|
116 | tmpstr = string_resub("<![CDATA[", "]]", tmpstr, 1);
|
---|
117 |
|
---|
118 | int count2 = 0;
|
---|
119 | struct splitstr* ret2 = NULL;
|
---|
120 | ret2 = strsplit(tmpstr, "/", &count2);
|
---|
121 | if(count2 > 6)
|
---|
122 | {
|
---|
123 | // ret2[6].part = string_replace_remove_last_chars(".f4m?ts=", "", ret2[6].part, 0);
|
---|
124 | ret2[6].part = string_replace_remove_last_chars(".f4m", "", ret2[6].part, 0);
|
---|
125 |
|
---|
126 | printf("2222222cccccccccc\n");
|
---|
127 |
|
---|
128 | srand(time(NULL));
|
---|
129 | int r = rand() % 34;
|
---|
130 | printf("random.randint1: %d\n",r);
|
---|
131 | if(r == 0)
|
---|
132 | {
|
---|
133 | sleep(1);
|
---|
134 | srand(time(NULL));
|
---|
135 | r = rand() % 34;
|
---|
136 | printf("random.randint2: %d\n",r);
|
---|
137 | }
|
---|
138 | if(r == 0)
|
---|
139 | {
|
---|
140 | sleep(1);
|
---|
141 | srand(time(NULL));
|
---|
142 | r = rand() % 34;
|
---|
143 | printf("random.randint3: %d\n",r);
|
---|
144 | }
|
---|
145 | if(r == 0)
|
---|
146 | {
|
---|
147 | sleep(1);
|
---|
148 | srand(time(NULL));
|
---|
149 | r = rand() % 34;
|
---|
150 | printf("random.randint4: %d\n",r);
|
---|
151 | }
|
---|
152 |
|
---|
153 | streamurl = ostrcat("rtmpe://fms-fra", oitoa(r), 0, 0);
|
---|
154 | // streamurl = ostrcat("rtmpe://fms-fra26.rtl.de/", ret2[3].part, 0, 0);
|
---|
155 | streamurl = ostrcat(streamurl, ".rtl.de/", 1, 0);
|
---|
156 | streamurl = ostrcat(streamurl, ret2[3].part, 1, 0);
|
---|
157 | streamurl = ostrcat(streamurl, "/", 1, 0);
|
---|
158 | streamurl = ostrcat(streamurl, " playpath=mp4:", 1, 0);
|
---|
159 | streamurl = ostrcat(streamurl, ret2[5].part, 1, 0);
|
---|
160 | streamurl = ostrcat(streamurl, "/", 1, 0);
|
---|
161 | streamurl = ostrcat(streamurl, ret2[6].part, 1, 0);
|
---|
162 | streamurl = ostrcat(streamurl, " swfVfy=1", 1, 0);
|
---|
163 | streamurl = ostrcat(streamurl, " swfUrl=http://", 1, 0);
|
---|
164 | streamurl = ostrcat(streamurl, ip, 1, 0);
|
---|
165 | streamurl = ostrcat(streamurl, "/includes/vodplayer.swf", 1, 0);
|
---|
166 | streamurl = ostrcat(streamurl, " app=", 1, 0);
|
---|
167 | streamurl = ostrcat(streamurl, ret2[3].part, 1, 0);
|
---|
168 | streamurl = ostrcat(streamurl, "/_definst_", 1, 0);
|
---|
169 | streamurl = ostrcat(streamurl, " pageUrl=", 1, 0);
|
---|
170 | streamurl = ostrcat(streamurl, link, 1, 0);
|
---|
171 | }
|
---|
172 | else if(count2 > 5)
|
---|
173 | {
|
---|
174 | // ret2[6].part = string_replace_remove_last_chars(".f4m?ts=", "", ret2[6].part, 0);
|
---|
175 | ret2[5].part = string_replace_remove_last_chars(".f4m", "", ret2[5].part, 0);
|
---|
176 |
|
---|
177 | printf("2222222ccccccc11111111111\n");
|
---|
178 |
|
---|
179 | srand(time(NULL));
|
---|
180 | int r = rand() % 34;
|
---|
181 | printf("random.randint1: %d\n",r);
|
---|
182 | if(r == 0)
|
---|
183 | {
|
---|
184 | sleep(1);
|
---|
185 | srand(time(NULL));
|
---|
186 | r = rand() % 34;
|
---|
187 | printf("random.randint2: %d\n",r);
|
---|
188 | }
|
---|
189 | if(r == 0)
|
---|
190 | {
|
---|
191 | sleep(1);
|
---|
192 | srand(time(NULL));
|
---|
193 | r = rand() % 34;
|
---|
194 | printf("random.randint3: %d\n",r);
|
---|
195 | }
|
---|
196 | if(r == 0)
|
---|
197 | {
|
---|
198 | sleep(1);
|
---|
199 | srand(time(NULL));
|
---|
200 | r = rand() % 34;
|
---|
201 | printf("random.randint4: %d\n",r);
|
---|
202 | }
|
---|
203 |
|
---|
204 | streamurl = ostrcat("rtmpe://fms-fra", oitoa(r), 0, 0);
|
---|
205 | // streamurl = ostrcat("rtmpe://fms-fra26.rtl.de/", ret2[3].part, 0, 0);
|
---|
206 | streamurl = ostrcat(streamurl, ".rtl.de/", 1, 0);
|
---|
207 | streamurl = ostrcat(streamurl, ret2[3].part, 1, 0);
|
---|
208 | streamurl = ostrcat(streamurl, "/", 1, 0);
|
---|
209 | streamurl = ostrcat(streamurl, " playpath=mp4:", 1, 0);
|
---|
210 | streamurl = ostrcat(streamurl, ret2[5].part, 1, 0);
|
---|
211 | streamurl = ostrcat(streamurl, "/", 1, 0);
|
---|
212 | // streamurl = ostrcat(streamurl, ret2[5].part, 1, 0);
|
---|
213 | streamurl = ostrcat(streamurl, " swfVfy=1", 1, 0);
|
---|
214 | streamurl = ostrcat(streamurl, " swfUrl=http://", 1, 0);
|
---|
215 | streamurl = ostrcat(streamurl, ip, 1, 0);
|
---|
216 | streamurl = ostrcat(streamurl, "/includes/vodplayer.swf", 1, 0);
|
---|
217 | streamurl = ostrcat(streamurl, " app=", 1, 0);
|
---|
218 | streamurl = ostrcat(streamurl, ret2[3].part, 1, 0);
|
---|
219 | streamurl = ostrcat(streamurl, "/_definst_", 1, 0);
|
---|
220 | streamurl = ostrcat(streamurl, " pageUrl=", 1, 0);
|
---|
221 | streamurl = ostrcat(streamurl, link, 1, 0);
|
---|
222 | }
|
---|
223 |
|
---|
224 | free(ret2), ret2 = NULL;
|
---|
225 | }
|
---|
226 | }
|
---|
227 |
|
---|
228 |
|
---|
229 | free(ip), ip = NULL;
|
---|
230 | free(newlink), newlink = NULL;
|
---|
231 | free(newpath), newpath = NULL;
|
---|
232 | // segfault munmap_chunk(): invalid pointer
|
---|
233 | // free(pos), pos = NULL;
|
---|
234 | // free(path), path = NULL;
|
---|
235 |
|
---|
236 | debug(99, "streamurl2: %s", streamurl);
|
---|
237 | return streamurl;
|
---|
238 | }
|
---|
239 |
|
---|
240 | int rtl2now_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag)
|
---|
241 | {
|
---|
242 | char* tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *menu = NULL, *search = NULL;
|
---|
243 | int ret = 1, count = 0, i = 0;
|
---|
244 |
|
---|
245 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL)
|
---|
246 | return ret;
|
---|
247 |
|
---|
248 | if(searchstr == NULL)
|
---|
249 | search = textinputhist(_("Search"), " ", "searchhist");
|
---|
250 | else
|
---|
251 | search = textinputhist(_("Search"), searchstr, "searchhist");
|
---|
252 |
|
---|
253 | if(search != NULL)
|
---|
254 | {
|
---|
255 | drawscreen(load, 0, 0);
|
---|
256 |
|
---|
257 | strstrip(search);
|
---|
258 | string_tolower(search);
|
---|
259 |
|
---|
260 | tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/rtl2now/streams/rtl2now.all-sorted.list", 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
261 |
|
---|
262 | struct splitstr* ret1 = NULL;
|
---|
263 | ret1 = strsplit(tmpstr, "\n", &count);
|
---|
264 |
|
---|
265 | if(ret1 != NULL)
|
---|
266 | {
|
---|
267 | int max = count;
|
---|
268 | for(i = 0; i < max; i++)
|
---|
269 | {
|
---|
270 |
|
---|
271 | tmpstr1 = ostrcat(ret1[i].part, NULL, 0, 0);
|
---|
272 | tmpstr1 = stringreplacecharonce(tmpstr1, '#', '\0');
|
---|
273 | string_tolower(tmpstr1);
|
---|
274 |
|
---|
275 | if(ostrstr(tmpstr1, search) != NULL)
|
---|
276 | {
|
---|
277 | printf("found: %s\n", ret1[i].part);
|
---|
278 | int rcret = waitrc(NULL, 10, 0);
|
---|
279 | if(rcret == getrcconfigint("rcexit", NULL)) break;
|
---|
280 |
|
---|
281 | line = ostrcat(line, ret1[i].part, 1, 0);
|
---|
282 | line = ostrcat(line, "\n", 0, 0);
|
---|
283 | }
|
---|
284 | free(tmpstr1), tmpstr1 = NULL;
|
---|
285 | }
|
---|
286 | free(ret1), ret1 = NULL;
|
---|
287 |
|
---|
288 | if(line != NULL)
|
---|
289 | {
|
---|
290 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1);
|
---|
291 | menu = ostrcat("/tmp/tithek/rtl2now.search.list", NULL, 0, 0);
|
---|
292 | writesys(menu, line, 0);
|
---|
293 | struct tithek* tnode = (struct tithek*)listbox->select->handle;
|
---|
294 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
|
---|
295 | ret = 0;
|
---|
296 | }
|
---|
297 | }
|
---|
298 | free(tmpstr), tmpstr = NULL;
|
---|
299 | }
|
---|
300 | free(search), search = NULL;
|
---|
301 | return ret;
|
---|
302 | }
|
---|
303 |
|
---|
304 | int rtlnow_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag)
|
---|
305 | {
|
---|
306 | char* tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *menu = NULL, *search = NULL;
|
---|
307 | int ret = 1, count = 0, i = 0;
|
---|
308 |
|
---|
309 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL)
|
---|
310 | return ret;
|
---|
311 |
|
---|
312 | if(searchstr == NULL)
|
---|
313 | search = textinputhist(_("Search"), " ", "searchhist");
|
---|
314 | else
|
---|
315 | search = textinputhist(_("Search"), searchstr, "searchhist");
|
---|
316 |
|
---|
317 | if(search != NULL)
|
---|
318 | {
|
---|
319 | drawscreen(load, 0, 0);
|
---|
320 |
|
---|
321 | strstrip(search);
|
---|
322 | string_tolower(search);
|
---|
323 |
|
---|
324 | tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/rtl-now/streams/rtl-now.all-sorted.list", 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
325 |
|
---|
326 | struct splitstr* ret1 = NULL;
|
---|
327 | ret1 = strsplit(tmpstr, "\n", &count);
|
---|
328 |
|
---|
329 | if(ret1 != NULL)
|
---|
330 | {
|
---|
331 | int max = count;
|
---|
332 | for(i = 0; i < max; i++)
|
---|
333 | {
|
---|
334 |
|
---|
335 | tmpstr1 = ostrcat(ret1[i].part, NULL, 0, 0);
|
---|
336 | tmpstr1 = stringreplacecharonce(tmpstr1, '#', '\0');
|
---|
337 | string_tolower(tmpstr1);
|
---|
338 |
|
---|
339 | if(ostrstr(tmpstr1, search) != NULL)
|
---|
340 | {
|
---|
341 | printf("found: %s\n", ret1[i].part);
|
---|
342 | int rcret = waitrc(NULL, 10, 0);
|
---|
343 | if(rcret == getrcconfigint("rcexit", NULL)) break;
|
---|
344 |
|
---|
345 | line = ostrcat(line, ret1[i].part, 1, 0);
|
---|
346 | line = ostrcat(line, "\n", 0, 0);
|
---|
347 | }
|
---|
348 | free(tmpstr1), tmpstr1 = NULL;
|
---|
349 | }
|
---|
350 | free(ret1), ret1 = NULL;
|
---|
351 |
|
---|
352 | if(line != NULL)
|
---|
353 | {
|
---|
354 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1);
|
---|
355 | menu = ostrcat("/tmp/tithek/rtl-now.search.list", NULL, 0, 0);
|
---|
356 | writesys(menu, line, 0);
|
---|
357 | struct tithek* tnode = (struct tithek*)listbox->select->handle;
|
---|
358 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
|
---|
359 | ret = 0;
|
---|
360 | }
|
---|
361 | }
|
---|
362 | free(tmpstr), tmpstr = NULL;
|
---|
363 | }
|
---|
364 | free(search), search = NULL;
|
---|
365 | return ret;
|
---|
366 | }
|
---|
367 |
|
---|
368 | int superrtlnow_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag)
|
---|
369 | {
|
---|
370 | char* tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *menu = NULL, *search = NULL;
|
---|
371 | int ret = 1, count = 0, i = 0;
|
---|
372 |
|
---|
373 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL)
|
---|
374 | return ret;
|
---|
375 |
|
---|
376 | if(searchstr == NULL)
|
---|
377 | search = textinputhist(_("Search"), " ", "searchhist");
|
---|
378 | else
|
---|
379 | search = textinputhist(_("Search"), searchstr, "searchhist");
|
---|
380 |
|
---|
381 | if(search != NULL)
|
---|
382 | {
|
---|
383 | drawscreen(load, 0, 0);
|
---|
384 |
|
---|
385 | strstrip(search);
|
---|
386 | string_tolower(search);
|
---|
387 |
|
---|
388 | tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/superrtlnow/streams/superrtlnow.all-sorted.list", 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
389 |
|
---|
390 | struct splitstr* ret1 = NULL;
|
---|
391 | ret1 = strsplit(tmpstr, "\n", &count);
|
---|
392 |
|
---|
393 | if(ret1 != NULL)
|
---|
394 | {
|
---|
395 | int max = count;
|
---|
396 | for(i = 0; i < max; i++)
|
---|
397 | {
|
---|
398 |
|
---|
399 | tmpstr1 = ostrcat(ret1[i].part, NULL, 0, 0);
|
---|
400 | tmpstr1 = stringreplacecharonce(tmpstr1, '#', '\0');
|
---|
401 | string_tolower(tmpstr1);
|
---|
402 |
|
---|
403 | if(ostrstr(tmpstr1, search) != NULL)
|
---|
404 | {
|
---|
405 | printf("found: %s\n", ret1[i].part);
|
---|
406 | int rcret = waitrc(NULL, 10, 0);
|
---|
407 | if(rcret == getrcconfigint("rcexit", NULL)) break;
|
---|
408 |
|
---|
409 | line = ostrcat(line, ret1[i].part, 1, 0);
|
---|
410 | line = ostrcat(line, "\n", 0, 0);
|
---|
411 | }
|
---|
412 | free(tmpstr1), tmpstr1 = NULL;
|
---|
413 | }
|
---|
414 | free(ret1), ret1 = NULL;
|
---|
415 |
|
---|
416 | if(line != NULL)
|
---|
417 | {
|
---|
418 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1);
|
---|
419 | menu = ostrcat("/tmp/tithek/superrtlnow.search.list", NULL, 0, 0);
|
---|
420 | writesys(menu, line, 0);
|
---|
421 | struct tithek* tnode = (struct tithek*)listbox->select->handle;
|
---|
422 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
|
---|
423 | ret = 0;
|
---|
424 | }
|
---|
425 | }
|
---|
426 | free(tmpstr), tmpstr = NULL;
|
---|
427 | }
|
---|
428 | free(search), search = NULL;
|
---|
429 | return ret;
|
---|
430 | }
|
---|
431 |
|
---|
432 | int voxnow_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag)
|
---|
433 | {
|
---|
434 | char* tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *menu = NULL, *search = NULL;
|
---|
435 | int ret = 1, count = 0, i = 0;
|
---|
436 |
|
---|
437 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL)
|
---|
438 | return ret;
|
---|
439 |
|
---|
440 | if(searchstr == NULL)
|
---|
441 | search = textinputhist(_("Search"), " ", "searchhist");
|
---|
442 | else
|
---|
443 | search = textinputhist(_("Search"), searchstr, "searchhist");
|
---|
444 |
|
---|
445 | if(search != NULL)
|
---|
446 | {
|
---|
447 | drawscreen(load, 0, 0);
|
---|
448 |
|
---|
449 | strstrip(search);
|
---|
450 | string_tolower(search);
|
---|
451 |
|
---|
452 | tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/voxnow/streams/voxnow.all-sorted.list", 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
453 |
|
---|
454 | struct splitstr* ret1 = NULL;
|
---|
455 | ret1 = strsplit(tmpstr, "\n", &count);
|
---|
456 |
|
---|
457 | if(ret1 != NULL)
|
---|
458 | {
|
---|
459 | int max = count;
|
---|
460 | for(i = 0; i < max; i++)
|
---|
461 | {
|
---|
462 |
|
---|
463 | tmpstr1 = ostrcat(ret1[i].part, NULL, 0, 0);
|
---|
464 | tmpstr1 = stringreplacecharonce(tmpstr1, '#', '\0');
|
---|
465 | string_tolower(tmpstr1);
|
---|
466 |
|
---|
467 | if(ostrstr(tmpstr1, search) != NULL)
|
---|
468 | {
|
---|
469 | printf("found: %s\n", ret1[i].part);
|
---|
470 | int rcret = waitrc(NULL, 10, 0);
|
---|
471 | if(rcret == getrcconfigint("rcexit", NULL)) break;
|
---|
472 |
|
---|
473 | line = ostrcat(line, ret1[i].part, 1, 0);
|
---|
474 | line = ostrcat(line, "\n", 0, 0);
|
---|
475 | }
|
---|
476 | free(tmpstr1), tmpstr1 = NULL;
|
---|
477 | }
|
---|
478 | free(ret1), ret1 = NULL;
|
---|
479 |
|
---|
480 | if(line != NULL)
|
---|
481 | {
|
---|
482 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1);
|
---|
483 | menu = ostrcat("/tmp/tithek/voxnow.search.list", NULL, 0, 0);
|
---|
484 | writesys(menu, line, 0);
|
---|
485 | struct tithek* tnode = (struct tithek*)listbox->select->handle;
|
---|
486 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
|
---|
487 | ret = 0;
|
---|
488 | }
|
---|
489 | }
|
---|
490 | free(tmpstr), tmpstr = NULL;
|
---|
491 | }
|
---|
492 | free(search), search = NULL;
|
---|
493 | return ret;
|
---|
494 | }
|
---|
495 |
|
---|
496 | int rtlnitronow_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag)
|
---|
497 | {
|
---|
498 | char* tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *menu = NULL, *search = NULL;
|
---|
499 | int ret = 1, count = 0, i = 0;
|
---|
500 |
|
---|
501 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL)
|
---|
502 | return ret;
|
---|
503 |
|
---|
504 | if(searchstr == NULL)
|
---|
505 | search = textinputhist(_("Search"), " ", "searchhist");
|
---|
506 | else
|
---|
507 | search = textinputhist(_("Search"), searchstr, "searchhist");
|
---|
508 |
|
---|
509 | if(search != NULL)
|
---|
510 | {
|
---|
511 | drawscreen(load, 0, 0);
|
---|
512 |
|
---|
513 | strstrip(search);
|
---|
514 | string_tolower(search);
|
---|
515 |
|
---|
516 | tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/rtlnitronow/streams/rtlnitronow.all-sorted.list", 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
517 |
|
---|
518 | struct splitstr* ret1 = NULL;
|
---|
519 | ret1 = strsplit(tmpstr, "\n", &count);
|
---|
520 |
|
---|
521 | if(ret1 != NULL)
|
---|
522 | {
|
---|
523 | int max = count;
|
---|
524 | for(i = 0; i < max; i++)
|
---|
525 | {
|
---|
526 |
|
---|
527 | tmpstr1 = ostrcat(ret1[i].part, NULL, 0, 0);
|
---|
528 | tmpstr1 = stringreplacecharonce(tmpstr1, '#', '\0');
|
---|
529 | string_tolower(tmpstr1);
|
---|
530 |
|
---|
531 | if(ostrstr(tmpstr1, search) != NULL)
|
---|
532 | {
|
---|
533 | printf("found: %s\n", ret1[i].part);
|
---|
534 | int rcret = waitrc(NULL, 10, 0);
|
---|
535 | if(rcret == getrcconfigint("rcexit", NULL)) break;
|
---|
536 |
|
---|
537 | line = ostrcat(line, ret1[i].part, 1, 0);
|
---|
538 | line = ostrcat(line, "\n", 0, 0);
|
---|
539 | }
|
---|
540 | free(tmpstr1), tmpstr1 = NULL;
|
---|
541 | }
|
---|
542 | free(ret1), ret1 = NULL;
|
---|
543 |
|
---|
544 | if(line != NULL)
|
---|
545 | {
|
---|
546 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1);
|
---|
547 | menu = ostrcat("/tmp/tithek/rtlnitronow.search.list", NULL, 0, 0);
|
---|
548 | writesys(menu, line, 0);
|
---|
549 | struct tithek* tnode = (struct tithek*)listbox->select->handle;
|
---|
550 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
|
---|
551 | ret = 0;
|
---|
552 | }
|
---|
553 | }
|
---|
554 | free(tmpstr), tmpstr = NULL;
|
---|
555 | }
|
---|
556 | free(search), search = NULL;
|
---|
557 | return ret;
|
---|
558 | }
|
---|
559 |
|
---|
560 | int ntvnow_search_local(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag)
|
---|
561 | {
|
---|
562 | char* tmpstr = NULL, *tmpstr1 = NULL, *line = NULL, *menu = NULL, *search = NULL;
|
---|
563 | int ret = 1, count = 0, i = 0;
|
---|
564 |
|
---|
565 | if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL)
|
---|
566 | return ret;
|
---|
567 |
|
---|
568 | if(searchstr == NULL)
|
---|
569 | search = textinputhist(_("Search"), " ", "searchhist");
|
---|
570 | else
|
---|
571 | search = textinputhist(_("Search"), searchstr, "searchhist");
|
---|
572 |
|
---|
573 | if(search != NULL)
|
---|
574 | {
|
---|
575 | drawscreen(load, 0, 0);
|
---|
576 |
|
---|
577 | strstrip(search);
|
---|
578 | string_tolower(search);
|
---|
579 |
|
---|
580 | tmpstr = gethttp("atemio.dyndns.tv", "/mediathek/n-tvnow/streams/n-tvnow.all-sorted.list", 80, NULL, HTTPAUTH, 5000, NULL, 0);
|
---|
581 |
|
---|
582 | struct splitstr* ret1 = NULL;
|
---|
583 | ret1 = strsplit(tmpstr, "\n", &count);
|
---|
584 |
|
---|
585 | if(ret1 != NULL)
|
---|
586 | {
|
---|
587 | int max = count;
|
---|
588 | for(i = 0; i < max; i++)
|
---|
589 | {
|
---|
590 |
|
---|
591 | tmpstr1 = ostrcat(ret1[i].part, NULL, 0, 0);
|
---|
592 | tmpstr1 = stringreplacecharonce(tmpstr1, '#', '\0');
|
---|
593 | string_tolower(tmpstr1);
|
---|
594 |
|
---|
595 | if(ostrstr(tmpstr1, search) != NULL)
|
---|
596 | {
|
---|
597 | printf("found: %s\n", ret1[i].part);
|
---|
598 | int rcret = waitrc(NULL, 10, 0);
|
---|
599 | if(rcret == getrcconfigint("rcexit", NULL)) break;
|
---|
600 |
|
---|
601 | line = ostrcat(line, ret1[i].part, 1, 0);
|
---|
602 | line = ostrcat(line, "\n", 0, 0);
|
---|
603 | }
|
---|
604 | free(tmpstr1), tmpstr1 = NULL;
|
---|
605 | }
|
---|
606 | free(ret1), ret1 = NULL;
|
---|
607 |
|
---|
608 | if(line != NULL)
|
---|
609 | {
|
---|
610 | line = string_replace_all("http://atemio.dyndns.tv/", "http://imageshack.us/md/up/grd/", line, 1);
|
---|
611 | menu = ostrcat("/tmp/tithek/n-tvnow.search.list", NULL, 0, 0);
|
---|
612 | writesys(menu, line, 0);
|
---|
613 | struct tithek* tnode = (struct tithek*)listbox->select->handle;
|
---|
614 | createtithek(tnode, tnode->title, menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
|
---|
615 | ret = 0;
|
---|
616 | }
|
---|
617 | }
|
---|
618 | free(tmpstr), tmpstr = NULL;
|
---|
619 | }
|
---|
620 | free(search), search = NULL;
|
---|
621 | return ret;
|
---|
622 | }
|
---|
623 |
|
---|
624 | #endif
|
---|