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