1 | #ifndef PROMPTFILE_H |
---|
2 | #define PROMPTFILE_H |
---|
3 | |
---|
4 | char* 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 | if(chashname != NULL) |
---|
50 | { |
---|
51 | post = ostrcat(chashname, "=", 0, 0); |
---|
52 | post = ostrcat(post, extra, 1, 0); |
---|
53 | post = ostrcat(post, chashvalue, 1, 0); |
---|
54 | free(chashname), chashname = NULL; |
---|
55 | free(extra), extra = NULL; |
---|
56 | free(chashvalue), chashvalue = NULL; |
---|
57 | |
---|
58 | debug(99, "post: %s", post); |
---|
59 | |
---|
60 | free(tmpstr), tmpstr = NULL; |
---|
61 | tmpstr = gethttps(tmplink, NULL, post, NULL, NULL, tmplink, 1); |
---|
62 | titheklog(debuglevel, "/tmp/promptfile2_post", NULL, NULL, NULL, tmpstr); |
---|
63 | } |
---|
64 | |
---|
65 | // src: "http://www.promptfile.com/file/eyJpIjoiRDFEM0M1MEZGNC00MTBDRTA2RDY5IiwiZSI6MTQ3NDAxNTU0OSwidCI6Im1vYmlsZSIsImgiOiJlZmE1ZmQ2NzBlMDJiOWQ4ZjEzMTBlZjg5NzVlYTBlNzUzZjU1YzViIiwicyI6MX0=" } |
---|
66 | tmpstr2 = string_resub("flowplayer(container", "native_fullscreen", tmpstr, 0); |
---|
67 | |
---|
68 | if(tmpstr2 != NULL) |
---|
69 | streamlink = oregex("src:.*\"(.*)\" }.*", tmpstr2); |
---|
70 | |
---|
71 | if(streamlink == NULL) |
---|
72 | { |
---|
73 | // $f("player", getjspath()+"player.swf", { |
---|
74 | tmpstr2 = string_resub("function initPlayer", "autoBuffering", tmpstr, 0); |
---|
75 | streamlink = string_resub("url: '", "',", tmpstr2, 0); |
---|
76 | } |
---|
77 | titheklog(debuglevel, "/tmp/promptfile3_streamlink", NULL, NULL, NULL, streamlink); |
---|
78 | |
---|
79 | end: |
---|
80 | |
---|
81 | free(tmpstr); tmpstr = NULL; |
---|
82 | free(tmpstr2); tmpstr2 = NULL; |
---|
83 | free(chashname), chashname = NULL; |
---|
84 | free(chashvalue), chashvalue = NULL; |
---|
85 | free(extra), extra = NULL; |
---|
86 | free(tmplink), tmplink = NULL; |
---|
87 | free(post), post = NULL; |
---|
88 | |
---|
89 | return streamlink; |
---|
90 | } |
---|
91 | |
---|
92 | #endif |
---|