1 | #ifndef ARD_H |
---|
2 | #define ARD_H |
---|
3 | |
---|
4 | char* ard(char* link) |
---|
5 | { |
---|
6 | debug(99, "link %s", link); |
---|
7 | int debuglevel = getconfigint("debuglevel", NULL); |
---|
8 | char* ip = NULL, *pos = NULL, *path = NULL, *streamurl = NULL, *tmpstr = NULL; |
---|
9 | |
---|
10 | ip = string_replace("http://", "", (char*)link, 0); |
---|
11 | |
---|
12 | if(ip != NULL) |
---|
13 | pos = strchr(ip, '/'); |
---|
14 | if(pos != NULL) |
---|
15 | { |
---|
16 | pos[0] = '\0'; |
---|
17 | path = pos + 1; |
---|
18 | } |
---|
19 | |
---|
20 | tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0); |
---|
21 | titheklog(debuglevel, "/tmp/ard1_tmpstr", NULL, tmpstr); |
---|
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 | |
---|
38 | mediaCollection.addMediaStream(0, 0, "", "http://http-stream.rbb-online.de/rbb/abendschau/abendschau_20130923_wahl_s_16_9_256x144.mp4", "akamai"); |
---|
39 | mediaCollection.addMediaStream(0, 1, "rtmp://ondemand.rbb-online.de/ondemand/", "mp4:rbb/abendschau/abendschau_20130923_wahl_m_16_9_512x288.mp4", "akamai"); |
---|
40 | mediaCollection.addMediaStream(1, 0, "", "http://http-stream.rbb-online.de/rbb/abendschau/abendschau_20130923_wahl_s_16_9_256x144.mp4", "akamai"); |
---|
41 | mediaCollection.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 | titheklog(debuglevel, "/tmp/ard2_streamurl", NULL, streamurl); |
---|
52 | |
---|
53 | // segfault munmap_chunk(): invalid pointer |
---|
54 | // free(pos), pos = NULL; |
---|
55 | // free(path), path = NULL; |
---|
56 | |
---|
57 | debug(99, "streamurl: %s", streamurl); |
---|
58 | return streamurl; |
---|
59 | } |
---|
60 | |
---|
61 | #endif |
---|