source: titan/plugins/tithek/ard.h @ 24002

Last change on this file since 24002 was 24002, checked in by obi, 10 years ago

update zdf parser

File size: 2.0 KB
Line 
1#ifndef ARD_H
2#define ARD_H
3
4char* ard(char* link)
5{
6        debug(99, "link %s", link);
7        char* ip = NULL, *pos = NULL, *path = NULL, *streamurl = NULL, *tmpstr = NULL;
8       
9        ip = string_replace("http://", "", (char*)link, 0);
10
11        if(ip != NULL)
12                pos = strchr(ip, '/');
13        if(pos != NULL)
14        {
15                pos[0] = '\0';
16                path = pos + 1;
17        }
18
19        tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
20        if(getconfigint("debuglevel", NULL) == 99)
21                writesys("/tmp/ard1_tmpstr", tmpstr, 0);
22
23//      writesys("/var/usr/local/share/titan/plugins/tithek/ard1_tmpstr", tmpstr, 0);
24       
25
26        if(tmpstr != NULL)
27        {
28                if(ostrstr(tmpstr, "<div class=\"fsk\">") != NULL)
29                {
30                        char* tmpstr2 = string_resub("<div class=\"fsk\">", "</div>", tmpstr, 0);
31                        tmpstr2 = string_replace(".", ".\n", tmpstr2, 1),
32                        textbox(_("Message"), tmpstr2, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0);
33                        free(tmpstr2), tmpstr2 = NULL;
34                }
35/*
36                streamurl = string_resub("'file': '","',",tmpstr,0);
37
38mediaCollection.addMediaStream(0, 0, "", "http://http-stream.rbb-online.de/rbb/abendschau/abendschau_20130923_wahl_s_16_9_256x144.mp4", "akamai");
39mediaCollection.addMediaStream(0, 1, "rtmp://ondemand.rbb-online.de/ondemand/", "mp4:rbb/abendschau/abendschau_20130923_wahl_m_16_9_512x288.mp4", "akamai");
40mediaCollection.addMediaStream(1, 0, "", "http://http-stream.rbb-online.de/rbb/abendschau/abendschau_20130923_wahl_s_16_9_256x144.mp4", "akamai");
41mediaCollection.addMediaStream(1, 1, "", "http://http-stream.rbb-online.de/rbb/abendschau/abendschau_20130923_wahl_m_16_9_512x288.mp4", "akamai");
42
43*/
44
45                streamurl = oregex(".*mediaCollection.addMediaStream.*(http://.*.mp4).*", tmpstr);
46        }
47
48        free(tmpstr); tmpstr = NULL;
49        free(ip), ip = NULL;
50
51        if(getconfigint("debuglevel", NULL) == 99)
52                writesys("/tmp/ard2_streamurl", streamurl, 0);
53
54// segfault munmap_chunk(): invalid pointer
55//      free(pos), pos = NULL;
56//      free(path), path = NULL;
57
58        debug(99, "streamurl: %s", streamurl); 
59        return streamurl;
60}
61
62#endif
Note: See TracBrowser for help on using the repository browser.