source: titan/plugins/tithek/promptfile.h @ 38816

Last change on this file since 38816 was 38816, checked in by obi, 6 years ago

tithek fix promptfile

File size: 3.0 KB
Line 
1#ifndef PROMPTFILE_H
2#define PROMPTFILE_H
3
4char* promptfile(char* link)
5{
6        debug(99, "link: %s", link);
7        int debuglevel = getconfigint("debuglevel", NULL);
8        char* tmpstr = NULL, *post = NULL, *streamlink = NULL, *chashname = NULL, *chashvalue = NULL, *extra = NULL, *tmpstr2 = NULL, *tmplink = NULL;
9
10        if(link == NULL) return NULL;
11
12        unlink("/tmp/promptfile1_get");
13        unlink("/tmp/promptfile2_post");
14        unlink("/tmp/promptfile3_streamlink");
15
16        tmplink = ostrcat(link, NULL, 0, 0);
17
18        if(ostrstr(link, "/Out/?s=") != NULL)
19        {
20                tmplink = string_replace("/Out/?s=", "", tmplink, 1);
21                debug(99, "remove out string: %s", tmplink);
22        }
23       
24        if(tmplink == NULL || ostrncmp("http", tmplink, 4))
25        {
26                textbox(_("Message"), _("Hoster Url not http:// or https://") , _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 200, 0, 0);
27                goto end;
28        }
29
30        tmpstr = gethttps(tmplink, NULL, NULL, NULL, NULL, NULL, 1);
31        titheklog(debuglevel, "/tmp/promptfile1_get", NULL, NULL, NULL, tmpstr);
32
33        if(tmpstr == NULL)
34        {
35                textbox(_("Message"), _("The page is temporarily unavailable") , _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 200, 0, 0);
36                goto end;
37        }
38
39// <input type="hidden" id="chash" name  =  "ch883c3b867d7baa1d9e0176d44e7af34de1281a93" value="b205ee9355067bbc71a3802324d3aa42df661450" />
40// <button type="submit" class="gray_btn" onclick='$("#chash").val("bb"+$("#chash").val());//For Kodi devs: we are prepared to rotate our code every hour. So please stop including us in your addons.'>Continue to File</button>
41
42        chashname = oregex("id=\"chash\" name.*\"(.*)\" value=.*", tmpstr);
43        chashvalue = oregex("id=\"chash\" name.*value=\"(.*)\" />.*", tmpstr);
44        extra = string_resub("onclick='$(\"#chash\").val(\"", "\"+$(\"#chash\").val", tmpstr, 0);
45        debug(99, "chashname: %s", chashname);
46        debug(99, "extra: %s", extra);
47        debug(99, "chashvalue: %s", chashvalue);
48
49        post = ostrcat(chashname, "=", 0, 0);
50        post = ostrcat(post, extra, 1, 0);
51        post = ostrcat(post, chashvalue, 1, 0);
52        free(chashname), chashname = NULL;
53        free(extra), extra = NULL;
54        free(chashvalue), chashvalue = NULL;
55
56        debug(99, "post: %s", post);
57
58        tmpstr = gethttps(tmplink, NULL, post, NULL, NULL, tmplink, 1);
59        titheklog(debuglevel, "/tmp/promptfile2_post", NULL, NULL, NULL, tmpstr);
60
61        tmpstr2 = string_resub("flowplayer(container", "native_fullscreen", tmpstr, 0);
62// src:  "http://www.promptfile.com/file/eyJpIjoiRDFEM0M1MEZGNC00MTBDRTA2RDY5IiwiZSI6MTQ3NDAxNTU0OSwidCI6Im1vYmlsZSIsImgiOiJlZmE1ZmQ2NzBlMDJiOWQ4ZjEzMTBlZjg5NzVlYTBlNzUzZjU1YzViIiwicyI6MX0=" }
63
64        streamlink = oregex("src:.*\"(.*)\" }.*", tmpstr);
65        titheklog(debuglevel, "/tmp/promptfile3_streamlink", NULL, NULL, NULL, streamlink);
66
67end:
68
69        free(tmpstr); tmpstr = NULL;
70        free(tmpstr2); tmpstr2 = NULL;
71        free(chashname), chashname = NULL;
72        free(chashvalue), chashvalue = NULL;
73        free(extra), extra = NULL;
74        free(tmplink), tmplink = NULL;
75        free(post), post = NULL;
76
77        return streamlink;
78}
79
80#endif
Note: See TracBrowser for help on using the repository browser.