source: titan/plugins/tithek/solarmovie.h @ 23760

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

[tithek] myvidso add lang error msg

File size: 15.6 KB
Line 
1#ifndef SOLARMOVIE_H
2#define SOLARMOVIE_H
3
4// flag 1 = putlocker/sockshare
5// flag 2 = filenuke
6
7char* solarmovie(char* link)
8{
9        debug(99, "link: %s", link);
10        char* tmpstr = NULL, *tmpstr1 = NULL, *tmpstr2 = NULL, *path = NULL, *url = NULL, *streamurl = NULL, *id = NULL, *hname = NULL, *cmd = NULL;
11
12        if(link == NULL) return NULL;
13
14        int count = 0;
15        struct splitstr* ret1 = NULL;
16        ret1 = strsplit(link, ";", &count);
17        if(ret1 != NULL && count >= 3)
18        {
19                unlink("/tmp/tithek/get");
20                unlink("/tmp/tithek/get_zcat");
21                unlink("/tmp/tithek/get_zcat1");
22
23                path = ostrcat(ret1[0].part, NULL, 0, 0);
24                debug(99, "path: %s", path);
25
26                id = ostrcat(ret1[1].part, NULL, 0, 0);
27                debug(99, "id: %s", id);
28
29                hname = ostrcat(ret1[2].part, NULL, 0, 0);
30                debug(99, "hname: %s", hname);
31
32//              tmpstr = gethttp("www.solarmovie.so", path, 80, NULL, NULL, 5000, NULL, 0);
33
34                char* send = ostrcat("GET /link/play/", NULL, 0, 0);
35                send = ostrcat(send, id, 1, 0);
36                send = ostrcat(send, " HTTP/1.1\r\nHost: www.solarmovie.so\r\nUser-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.99 Safari/535.1\r\nConnection: close\r\nAccept-Encoding: gzip\r\n\r\n", 1, 0);   
37                debug(99, "send: %s", send);
38                unlink("/tmp/tithek/get1");
39                gethttpreal("www.solarmovie.so", path, 80, "/tmp/tithek/get1", NULL, NULL, 0, send, NULL, 5000, 0);
40                free(send); send = NULL;
41
42                if(file_exist("/tmp/tithek/get1"))
43                {
44                        tmpstr1 = command("cat /tmp/tithek/get1");
45                        string_strip_whitechars(tmpstr1);
46
47                        if(ostrstr(tmpstr1, "<!DOCTYPE") == NULL)
48                        {
49                                cmd = ostrcat(cmd, "cat /tmp/tithek/get1 | zcat", 1, 0);
50                                debug(99, "cmd: %s", cmd);
51                                free(tmpstr1), tmpstr1 = NULL;
52                                tmpstr1 = command(cmd);
53                               
54                                writesys("/tmp/tithek/get_zcat1", tmpstr1, 0);
55                                free(cmd), cmd = NULL;
56                        }
57                        else
58                        {
59                                system("cp -a /tmp/tithek/get1 /tmp/tithek/get_zcat1");
60                        }
61
62                        if(ostrstr(tmpstr1, "<div class=\"thirdPartyEmbContainer\">") != NULL)
63                        {
64                                tmpstr1 = string_resub("<div class=\"thirdPartyEmbContainer\">", "</div>", tmpstr1, 1);
65                                url = string_resub("<center><iframe src=\"", "\"", tmpstr1, 0);
66                                if(url == NULL || ostrncmp("http://", url, 7) == 0)
67                                        url = oregex(".*src=\"(http://.*)&width.*", tmpstr1);
68                        }
69                        else
70                        {
71                                url = oregex(".*<iframe name=\"service_frame\" class=\"service_frame\" src=\"(http://.*)\".*", tmpstr1);
72                                url = oregex("(http://.*)\".*", url);
73                                url = string_replace_all("embed", "file", url, 1);
74                        }
75
76                        tmpstr1 = ostrcat(url, NULL, 0, 0);
77               
78                        int count2 = 0;
79                        struct splitstr* ret2 = NULL;
80                        ret2 = strsplit(tmpstr1, "/", &count2);
81//                      ret2 = strsplit(tmpstr1, "= & / \"", &count2);
82               
83                        if(ret2 != NULL && count2 > 3 && ostrcmp(hname, "sockshare.com") == 0)
84                                streamurl = putlocker("Sockshare.com", ret2[3].part);
85                        else if(ret2 != NULL && count2 > 3 && ostrcmp(hname, "putlocker.com") == 0)
86                                streamurl = putlocker("Sockshare.com", ret2[3].part);
87                        else if(ret2 != NULL && count2 > 2 && ostrcmp(hname, "filenuke.com") == 0)
88                                streamurl = filenuke("FileNuke.com", ret2[2].part);
89                        else if(ret2 != NULL && count2 > 2 && ostrcmp(hname, "streamcloud.eu") == 0)
90                                streamurl = streamcloud("StreamCloud.eu", ret2[2].part);
91                        else if(ret2 != NULL && count2 > 2 && ostrcmp(hname, "streamcloud.eu") == 0)
92                                streamurl = streamcloud("StreamCloud.eu", ret2[2].part);
93                        else if(ret2 != NULL && count2 > 2 && ostrcmp(hname, "vidstream.in") == 0)
94                                streamurl = vidstream("VidStream.in", ret2[2].part);
95                        else if(ret2 != NULL && count2 > 3 && ostrcmp(hname, "flashx.tv") == 0)
96                                streamurl = flashx("FlashX.tv", ret2[3].part);
97                        else if(ret2 != NULL && count2 > 2 && ostrcmp(hname, "xvidstage.com") == 0)
98                                streamurl = xvidstage("XvidStage.com", ret2[2].part);
99                        else if(ret2 != NULL && count2 > 2 && ostrcmp(hname, "nowvideo.eu") == 0)
100                        {
101                                tmpstr2 = ostrcat(ret2[2].part, NULL, 0, 0);
102                                tmpstr2 = string_replace("embed.php?v=", "", tmpstr2, 1);
103                                streamurl = nowvideo("NowVideo.eu", tmpstr2);
104                        }
105                        else if(ret2 != NULL && count2 > 3 && ostrcmp(hname, "nowvideo.eu") == 0)
106                        {
107                                tmpstr2 = ostrcat(ret2[3].part, NULL, 0, 0);
108                                tmpstr2 = string_replace("embed.php?v=", "", tmpstr2, 1);
109                                debug(99, "tmpstr2: %s", tmpstr2);     
110                                streamurl = nowvideo("NowVideo.eu", tmpstr2);
111                        }
112                        free(ret2), ret2 = NULL;
113                }
114        }
115        free(ret1), ret1 = NULL;
116
117        free(url), url = NULL;
118        free(tmpstr), tmpstr = NULL;
119        free(tmpstr1), tmpstr1 = NULL;
120        free(tmpstr2), tmpstr2 = NULL;
121        free(path), path = NULL;
122        free(hname), hname = NULL;
123        free(id), id = NULL;
124
125        return streamurl;
126}
127
128int solarmovie_search(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title, char* searchstr, int flag)
129{
130        int ret = 1;
131        int incount = 0;
132               
133        if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL)
134                return ret;
135
136        char* search = NULL;
137        if(searchstr == NULL)
138                search = textinputhist("Search", " ", "searchhist");
139        else
140                search = textinputhist("Search", searchstr, "searchhist");
141       
142        if(search != NULL)
143        {
144                drawscreen(load, 0, 0);
145                search = stringreplacechar(search, ' ', '+');
146                char* tmpstr = NULL;
147                char* tmpstr1 = NULL;
148                char* line = NULL;
149                char* pic = NULL;
150                char* title = NULL;
151                char* url = NULL;
152                char* ip = NULL;
153                char* path = NULL;
154                char* menu = NULL;
155                char* file = NULL;
156                char* file1 = NULL;
157
158                ip = ostrcat("www.solarmovie.so", NULL, 0, 0);
159                if(flag == 0)
160                        path = ostrcat("movie/search/", search, 0, 0);
161                else
162                        path = ostrcat("tv/search/", search, 0, 0);
163       
164                tmpstr = gethttp(ip, path, 80, NULL, NULL, 10000, NULL, 0);
165                if(getconfigint("debuglevel", NULL) == 99)
166                        writesys("/tmp/solarmovie_tmpstr", tmpstr, 0);
167
168                while(ostrstr(tmpstr, "<div class=\"typicalGrey coverGroup\">") != NULL)
169                {
170                        int rcret = waitrc(NULL, 10, 0);
171                        if(rcret == getrcconfigint("rcexit", NULL)) break;
172
173                        incount += 1;
174                        if(getconfigint("debuglevel", NULL) == 99)
175                        {
176                                file = ostrcat("/tmp/solarmovie_tmpstr", oitoa(incount), 0, 1);
177                                writesys(file, tmpstr, 0);
178                        }
179                               
180                        tmpstr1 = string_resub("<div class=\"typicalGrey coverGroup\">", "</div>", tmpstr, 0);
181
182                        if(getconfigint("debuglevel", NULL) == 99)
183                        {
184                                file1 = ostrcat("/tmp/solarmovie_tmpstr_resub", oitoa(incount), 0, 1);
185                                writesys(file1, tmpstr1, 0);
186                        }
187
188                        path = string_resub("href=\"", "\"", tmpstr1, 0);
189                        pic = string_resub("<img src=\"", "\"", tmpstr1, 0);
190                        title = string_resub("<a title=\"", "\"", tmpstr1, 0);
191       
192                        url = ostrcat("http://www.solarmovie.so", path, 0, 0);
193       
194                        debug(99, "---------------------------");
195                        debug(99, "pic: %s", pic);
196                        debug(99, "title: %s", title);
197                        debug(99, "url: %s", url);                                     
198                        debug(99, "---------------------------");
199       
200                        if(url != NULL)
201                        {
202                                line = ostrcat(line, title, 1, 0);
203                                line = ostrcat(line, "#", 1, 0);
204                                line = ostrcat(line, url, 1, 0);
205                                line = ostrcat(line, "#", 1, 0);
206                                line = ostrcat(line, pic, 1, 0);
207                                line = ostrcat(line, "#solarmovie_search_", 1, 0);
208                                line = ostrcat(line, oitoa(incount + time(NULL)), 1, 0);
209                                line = ostrcat(line, ".jpg#SolarMovie - Search#28\n", 1, 0);
210                        }
211                        free(url), url = NULL;
212                        free(path), path = NULL;
213                        free(title), title = NULL;
214                        free(pic), pic = NULL;         
215                        free(file), file = NULL;
216                        free(file1), file1 = NULL;
217
218                        tmpstr = string_replace("typicalGrey coverGroup", "", tmpstr, 1);
219                        free(tmpstr1), tmpstr1 = NULL;
220                }
221
222                if(line != NULL)
223                {
224                        menu = ostrcat("/tmp/tithek/solarmovie.search.list", NULL, 0, 0);
225                        writesys(menu, line, 0);
226                        struct tithek* tnode = (struct tithek*)listbox->select->handle;
227                        createtithek(tnode, tnode->title,  menu, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
228                        ret = 0;
229                }
230
231                free(tmpstr), tmpstr = NULL;
232                free(ip), ip = NULL;
233        }
234        free(search), search = NULL;
235        return ret;
236}
237
238int solarmovie_hoster(struct skin* grid, struct skin* listbox, struct skin* countlabel, struct skin* load, char* link, char* title)
239{
240        debug(99, "link: %s", link);
241        int ret = 1, series = 0;
242        char* ip = NULL, *pos = NULL, *path = NULL, *etitle = NULL, *episode = NULL, *session = NULL, *update = NULL, *quality = NULL, *id = NULL, *line = NULL, *hname = NULL, *tmpstr = NULL, *cmd = NULL, *url = NULL, *tmpstr1 = NULL, *tmphost = NULL, *tmphname = NULL;
243
244        unlink("/tmp/tithek/get");
245        unlink("/tmp/tithek/get_zcat");
246        unlink("/tmp/tithek/get_zcat1");
247
248        if(listbox == NULL || listbox->select == NULL || listbox->select->handle == NULL)
249                return ret;
250
251        ip = string_replace("http://", "", (char*)link, 0);
252
253        if(ip != NULL)
254                pos = strchr(ip, '/');
255        if(pos != NULL)
256        {
257                pos[0] = '\0';
258                path = pos + 1;
259        }
260
261        gethttp(ip, path, 80, "/tmp/tithek/get", NULL, 10000, NULL, 0);
262       
263        if(!file_exist("/tmp/tithek/get"))
264        {
265                textbox(_("Message"), _("This file doesn't exist, or has been removed") , _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 200, 0, 0);
266                goto end;
267        }
268        if(getconfigint("debuglevel", NULL) == 99)
269                system("cp -a /tmp/tithek/get /tmp/solarmovie1_tmpstr_get");
270
271        tmpstr = command("cat /tmp/tithek/get");
272        if(ostrstr(tmpstr, "<!DOCTYPE") == NULL)
273        {
274                cmd = ostrcat(cmd, "cat /tmp/tithek/get | zcat", 1, 0);
275                debug(99, "cmd: %s", cmd);
276                free(tmpstr), tmpstr = NULL;
277                tmpstr = command(cmd);
278               
279                writesys("/tmp/tithek/get_zcat", tmpstr, 0);
280                free(cmd), cmd = NULL;
281        }
282        else
283                system("cp -a /tmp/tithek/get /tmp/tithek/get_zcat");
284
285        if(getconfigint("debuglevel", NULL) == 99)
286                writesys("/tmp/solarmovie2_tmpstr_zcat", tmpstr, 0);
287
288        drawscreen(load, 0, 0);
289        if(ostrstr(link, "/tv/") != NULL && ostrstr(link, "/season-") == NULL && ostrstr(link, "/episode-") == NULL)   
290                series = 1;
291        else
292                series = 0;
293
294        if(series == 0)
295        {
296                series = 0;
297                if(file_exist("/tmp/tithek/get_zcat"))
298                {
299                        free(tmpstr), tmpstr = NULL;
300                        tmpstr = command("cat /tmp/tithek/get_zcat");
301                        char* tmpcat = string_resub("<tbody>", "</tbody>", tmpstr, 0);
302       
303                        char* ptmpcat = ostrstr(tmpcat, "<td class=\"qualit");
304                        int i = 0, incount = 0;
305                        while(ptmpcat != NULL)
306                        {
307                                i++;
308                                tmpstr1 = ostrcat(tmpstr1, string_resub("<td class=\"qualit", "<div class=\"linkDetails\">", ptmpcat, 0), 1, 1);
309                                ptmpcat += 5;
310                                ptmpcat = ostrstr(ptmpcat, "<td class=\"qualit");
311       
312                                if(ptmpcat != NULL)
313                                {
314                                        id = oregex(".*/link/show/(.*)/\">.*", tmpstr1);
315                                        quality = string_resub("yCell\">", "</td>", tmpstr1, 0);
316                                        update = string_resub("oddCell\">", "</td>", tmpstr1, 0);
317                                        string_remove_whitechars(quality);
318                                        strstrip(quality);
319                                        tmphname = oregex(".*/\">(.*)</a>.*", tmpstr1);
320                                        string_remove_whitechars(tmphname);
321                                        strstrip(tmphname);
322       
323                                        tmphost = ostrcat("www.solarmovie.so", NULL, 0, 0);
324                                        url = ostrcat("/link/play/", id, 0, 0);
325               
326                                        int type = 43;
327                                        if(ostrcmp(tmphname, "sockshare.com") == 0)
328                                                hname = ostrcat("Sockshare.com", NULL, 0, 0);
329                                        else if(ostrcmp(tmphname, "putlocker.com") == 0)
330                                                hname = ostrcat("Putlocker.com", NULL, 0, 0);
331                                        else if(ostrcmp(tmphname, "filenuke.com") == 0)
332                                                hname = ostrcat("FileNuke.com", NULL, 0, 0);
333                                        else if(ostrcmp(tmphname, "streamcloud.eu") == 0)
334                                                hname = ostrcat("StreamCloud.eu", NULL, 0, 0);
335                                        else if(ostrcmp(tmphname, "streamcloud") == 0)
336                                                hname = ostrcat("StreamCloud.eu", NULL, 0, 0);
337                                        else if(ostrcmp(tmphname, "vidstream.in") == 0)
338                                                hname = ostrcat("VidStream.in", NULL, 0, 0);
339                                        else if(ostrcmp(tmphname, "flashx.tv") == 0)
340                                                hname = ostrcat("FlashX.tv", NULL, 0, 0);
341                                        else if(ostrcmp(tmphname, "primeshare.tv") == 0)
342                                                hname = ostrcat("PrimeShare.tv", NULL, 0, 0);
343                                        else if(ostrcmp(tmphname, "xvidstage.com") == 0)
344                                                hname = ostrcat("XvidStage.com", NULL, 0, 0);
345                                        else if(ostrcmp(tmphname, "vidxden.com") == 0)
346                                                hname = ostrcat("vidxden.com", NULL, 0, 0);
347                                        else if(ostrcmp(tmphname, "nowvideo.eu") == 0)
348                                                hname = ostrcat("NowVideo.eu", NULL, 0, 0);
349                                        else
350                                        {
351                                                hname = ostrcat(tmphname, " (coming soon)", 0, 0);
352                                                type = 66;
353                                        }
354
355                                        debug(99, "hname: %s url: %s id: %s", hname, url, id);
356                                       
357                                        incount += 1;
358                                        line = ostrcat(line, hname, 1, 0);                             
359                                        line = ostrcat(line, "#", 1, 0);
360                                        line = ostrcat(line, url, 1, 0);
361                                        line = ostrcat(line, ";", 1, 0);
362                                        line = ostrcat(line, id, 1, 0);
363                                        line = ostrcat(line, ";", 1, 0);                               
364                                        line = ostrcat(line, tmphname, 1, 0);
365                                        line = ostrcat(line, "#", 1, 0);
366                                        line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/", 1, 0);
367                                        line = ostrcat(line, hname, 1, 0);
368                                        line = ostrcat(line, ".jpg#solarmovie_", 1, 0);
369                                        line = ostrcat(line, hname, 1, 0);
370                                        line = ostrcat(line, ".jpg#Solarmovie - ", 1, 0);
371                                        line = ostrcat(line, title, 1, 0);
372                                        line = ostrcat(line, "#", 1, 0);
373                                        line = ostrcat(line, oitoa(type), 1, 0);
374                                        line = ostrcat(line, "\n", 1, 0);
375                                        free(hname), hname = NULL;
376                                                                               
377                                        free(tmphname), tmphname = NULL;
378                                        free(id), id = NULL;           
379                                }
380                        }
381                        free(tmpcat); tmpcat = NULL;
382                }       
383        }
384        else
385        {
386                series = 1;
387                if(file_exist("/tmp/tithek/get_zcat"))
388                {
389                        free(tmpstr), tmpstr = NULL;
390                        tmpstr = command("cat /tmp/tithek/get_zcat | grep episode- | grep -v Episode | grep -v 'linkCount typicalGrey'");
391                        writesys("/var/usr/local/share/titan/plugins/tithek/solarmovie8_tmpstr", tmpstr, 0);
392
393                        int count = 0;
394                        struct splitstr* ret1 = NULL;
395                        ret1 = strsplit(tmpstr, "\n", &count);
396                        int max = count;
397                        int i = 0, incount = 0;
398                        for(i = 0; i < max; i++)
399                        {
400//<a href="/tv/avatar-the-last-airbender-2005/season-3/episode-2/">The Headband</a>
401                                session = oregex(".*/season-([0-9]{1,2})/episode-.*", ret1[i].part);
402                                episode = oregex(".*/episode-([0-9]{1,2})/.*", ret1[i].part);
403                                etitle = oregex(".*>(.*)<.*", ret1[i].part);
404                                url = string_resub("\"", "\"", ret1[i].part, 0);
405printf("(s%se%s) (%s) = %s\n",session , episode, etitle, url);                         
406                                incount += 1;
407                                line = ostrcat(line, _("Season"), 1, 0);
408                                line = ostrcat(line, " ", 1, 0);
409                                line = ostrcat(line, session, 1, 0);
410                                line = ostrcat(line, " ", 1, 0);
411                                line = ostrcat(line, _("Episode"), 1, 0);
412                                line = ostrcat(line, " ", 1, 0);
413                                line = ostrcat(line, episode, 1, 0);
414
415//                              line = ostrcat(line, "(s", 1, 0);
416//                              line = ostrcat(line, session, 1, 0);
417//                              line = ostrcat(line, "e", 1, 0);
418//                              line = ostrcat(line, episode, 1, 0);
419//                              line = ostrcat(line, ") ", 1, 0);
420//                              line = ostrcat(line, etitle, 1, 0);
421
422                                line = ostrcat(line, "#http://www.solarmovie.so", 1, 0);
423                                line = ostrcat(line, url, 1, 0);
424//                              line = ostrcat(line, ";", 1, 0);
425//                              line = ostrcat(line, session, 1, 0);
426//                              line = ostrcat(line, ";", 1, 0);
427//                              line = ostrcat(line, episode, 1, 0);
428                                line = ostrcat(line, "#", 1, 0);
429                                line = ostrcat(line, "http://atemio.dyndns.tv/mediathek/menu/s", 1, 0);
430                                line = ostrcat(line, session, 1, 0);
431                                line = ostrcat(line, "e", 1, 0);
432                                line = ostrcat(line, episode, 1, 0);
433                                line = ostrcat(line, ".jpg", 1, 0);                                                                                                                             
434                                line = ostrcat(line, "#s", 1, 0);
435                                line = ostrcat(line, session, 1, 0);
436                                line = ostrcat(line, "e", 1, 0);
437                                line = ostrcat(line, episode, 1, 0);
438                                line = ostrcat(line, ".jpg#Solarmovie - ", 1, 0);
439                                line = ostrcat(line, title, 1, 0);
440                                line = ostrcat(line, "#28\n", 1, 0);
441                                free(session), session = NULL;
442                                free(episode), episode = NULL;
443                                free(url), url = NULL; 
444                                free(etitle), etitle = NULL;   
445                        }
446                }
447        }
448        free(tmpstr), tmpstr = NULL;
449
450        if(line != NULL)
451        {
452                if(series == 0)
453                        tmpstr = ostrcat("/tmp/tithek/solarmovie.hoster.list", NULL, 0, 0);
454                else
455                        tmpstr = ostrcat("/tmp/tithek/solarmovie.hoster.ser.list", NULL, 0, 0);
456                writesys(tmpstr, line, 0);
457
458                if(getconfigint("debuglevel", NULL) == 99)
459                        writesys("/tmp/solarmovie8_line", line, 0);
460                                       
461                struct tithek* tnode = (struct tithek*)listbox->select->handle;
462                createtithek(tnode, tnode->title,  tmpstr, tnode->pic, tnode->localname, tnode->menutitle, tnode->flag);
463                ret = 0;
464        }
465end:
466        free(ip), ip = NULL;
467                       
468        return ret;
469}
470#endif
Note: See TracBrowser for help on using the repository browser.