1 | #ifndef TITHEK_GLOBAL_H |
---|
2 | #define TITHEK_GLOBAL |
---|
3 | |
---|
4 | char* getfilekey(char* w, char* i, char* s, char* e) |
---|
5 | { |
---|
6 | char* ret = NULL; |
---|
7 | |
---|
8 | if(w == NULL || i == NULL || s == NULL || e == NULL) |
---|
9 | return NULL; |
---|
10 | |
---|
11 | int a = 0, b = 0, c = 0; |
---|
12 | int a1 = 0, b1 = 0; |
---|
13 | |
---|
14 | int lw = strlen(w); |
---|
15 | int li = strlen(i); |
---|
16 | int ls = strlen(s); |
---|
17 | |
---|
18 | if(lw < 5 || li < 5 || ls < 5) |
---|
19 | return NULL; |
---|
20 | |
---|
21 | char ca[lw + li + ls - 14]; |
---|
22 | char cb[16]; |
---|
23 | |
---|
24 | ca[lw + li + ls - 15] = '\0'; |
---|
25 | cb[15] = '\0'; |
---|
26 | |
---|
27 | while(1) |
---|
28 | { |
---|
29 | if(a < 5) |
---|
30 | { |
---|
31 | cb[b1] = w[a]; |
---|
32 | b1++; |
---|
33 | } |
---|
34 | else if(a < lw) |
---|
35 | { |
---|
36 | ca[a1] = w[a]; |
---|
37 | a1++; |
---|
38 | } |
---|
39 | a++; |
---|
40 | |
---|
41 | if(b < 5) |
---|
42 | { |
---|
43 | cb[b1] = i[b]; |
---|
44 | b1++; |
---|
45 | } |
---|
46 | else if(b < li) |
---|
47 | { |
---|
48 | ca[a1] = i[b]; |
---|
49 | a1++; |
---|
50 | } |
---|
51 | b++; |
---|
52 | |
---|
53 | if(c < 5) |
---|
54 | { |
---|
55 | cb[b1] = s[c]; |
---|
56 | b1++; |
---|
57 | } |
---|
58 | else if(c < ls) |
---|
59 | { |
---|
60 | ca[a1] = s[c]; |
---|
61 | a1++; |
---|
62 | } |
---|
63 | c++; |
---|
64 | |
---|
65 | if(lw + li + ls == a1 + b1) |
---|
66 | break; |
---|
67 | } |
---|
68 | |
---|
69 | b = 0; |
---|
70 | int d = 0; |
---|
71 | char cc[a1 / 2 + 1]; |
---|
72 | char casub[3] = {'\0'}; |
---|
73 | cc[a1 / 2] = '\0'; |
---|
74 | |
---|
75 | for(a = 0; a < a1; a += 2) |
---|
76 | { |
---|
77 | int c = -1; |
---|
78 | |
---|
79 | if(cb[b] % 2) c = 1; |
---|
80 | |
---|
81 | casub[0] = ca[a]; |
---|
82 | casub[1] = ca[a + 1]; |
---|
83 | |
---|
84 | cc[d] = strtol(casub, '\0', 36) - c; |
---|
85 | b++; d++; |
---|
86 | if(b >= b1) b = 0; |
---|
87 | } |
---|
88 | |
---|
89 | char* r1 = NULL, *r2 = NULL, *r3 = NULL, *r4 = NULL; |
---|
90 | char* pos = ostrstr(cc, ");}('"); |
---|
91 | if(pos != NULL) |
---|
92 | { |
---|
93 | r1 = string_resub(");}('", "'", pos, 0); |
---|
94 | pos = ostrstr(pos + 5, ",'"); |
---|
95 | if(pos != NULL) |
---|
96 | { |
---|
97 | r2 = string_resub(",'", "'", pos, 0); |
---|
98 | pos = ostrstr(pos + 2, ",'"); |
---|
99 | if(pos != NULL) |
---|
100 | { |
---|
101 | r3 = string_resub(",'", "'", pos, 0); |
---|
102 | pos = ostrstr(pos + 2, ",'"); |
---|
103 | if(pos != NULL) |
---|
104 | { |
---|
105 | r4 = string_resub(",'", "'", pos, 0); |
---|
106 | ret = getfilekey(r1, r2, r3, r4); |
---|
107 | } |
---|
108 | } |
---|
109 | } |
---|
110 | } |
---|
111 | else |
---|
112 | { |
---|
113 | ret = string_resub("ll=\"", "\"", cc, 0); |
---|
114 | if(ret == NULL) |
---|
115 | ret = string_resub("filekey=\"", "\"", cc, 0); |
---|
116 | } |
---|
117 | |
---|
118 | free(r1); r1 = NULL; |
---|
119 | free(r2); r2 = NULL; |
---|
120 | free(r3); r3 = NULL; |
---|
121 | free(r4); r4 = NULL; |
---|
122 | |
---|
123 | return ret; |
---|
124 | } |
---|
125 | |
---|
126 | char* hoster(char* url) |
---|
127 | { |
---|
128 | debug(99, "url: %s", url); |
---|
129 | char* streamurl = NULL, *tmplink = NULL; |
---|
130 | |
---|
131 | /* |
---|
132 | if re.match(".*?http://www.putlocker.com/(file|embed)/", link, re.S): |
---|
133 | elif re.match(".*?http://www.sockshare.com/(file|embed)/", link, re.S): |
---|
134 | elif re.match(".*?http://www.videoslasher.com/embed/", link, re.S): |
---|
135 | elif re.match('.*?http://faststream.in', link, re.S): |
---|
136 | elif re.match('.*?http:/.*?flashx.tv', link, re.S): |
---|
137 | elif re.match('.*?http://streamcloud.eu', link, re.S): |
---|
138 | elif re.match('.*?http://vidstream.in', link, re.S): |
---|
139 | elif re.match('.*?http://xvidstage.com', link, re.S): |
---|
140 | elif re.match('.*?http://embed.nowvideo.eu', link, re.S): |
---|
141 | elif re.match('.*?.movshare.net', link, re.S): |
---|
142 | elif re.match('.*?(embed.divxstage.eu|divxstage.eu/video)', link, re.S): |
---|
143 | elif re.match('.*?videoweed.es', link, re.S): |
---|
144 | elif re.match('.*?novamov.com', link, re.S): |
---|
145 | elif re.match('.*primeshare', link, re.S): |
---|
146 | elif re.match('.*?videomega.tv', link, re.S): |
---|
147 | elif re.match('.*?bitshare.com', link, re.S): |
---|
148 | elif re.match('.*?http://movreel.com/', link, re.S): |
---|
149 | elif re.match('.*?uploadc.com', link, re.S): |
---|
150 | elif re.match('.*?http://filenuke.com', link, re.S): |
---|
151 | elif re.match('.*?http://www.youtube.com/watch', link, re.S): |
---|
152 | elif re.match('.*?http://www.mightyupload.com/embed', link, re.S): |
---|
153 | elif re.match('.*?180upload', link, re.S): |
---|
154 | elif re.match('.*?ecostream.tv', link, re.S): |
---|
155 | |
---|
156 | tmplink = ostrcat(url, NULL, 0, 0); |
---|
157 | |
---|
158 | if(ostrstr(tmpstr, "/Out/?s=") != NULL) |
---|
159 | { |
---|
160 | tmplink = string_replace("/Out/?s=", "", tmplink, 1); |
---|
161 | debug(99, "remove out string: %s", tmplink); |
---|
162 | } |
---|
163 | |
---|
164 | |
---|
165 | if(ostrcmp(tmphname, "Sockshare") == 0) |
---|
166 | hname = ostrcat("Sockshare.com", NULL, 0, 0); |
---|
167 | else if(ostrcmp(tmphname, "Putlocker") == 0) |
---|
168 | hname = ostrcat("Putlocker.com", NULL, 0, 0); |
---|
169 | else if(ostrcmp(tmphname, "Filenuke") == 0) |
---|
170 | hname = ostrcat("FileNuke.com", NULL, 0, 0); |
---|
171 | else if(ostrcmp(tmphname, "Streamclou") == 0) |
---|
172 | hname = ostrcat("StreamCloud.eu", NULL, 0, 0); |
---|
173 | else if(ostrcmp(tmphname, "Streamcloud") == 0) |
---|
174 | hname = ostrcat("StreamCloud.eu", NULL, 0, 0); |
---|
175 | else if(ostrcmp(tmphname, "VidStream") == 0) |
---|
176 | hname = ostrcat("VidStream.in", NULL, 0, 0); |
---|
177 | else if(ostrcmp(tmphname, "Flashx") == 0) |
---|
178 | hname = ostrcat("FlashX.tv", NULL, 0, 0); |
---|
179 | else if(ostrcmp(tmphname, "PrimeShare") == 0) |
---|
180 | hname = ostrcat("PrimeShare.tv", NULL, 0, 0); |
---|
181 | else if(ostrcmp(tmphname, "Xvidstage") == 0) |
---|
182 | hname = ostrcat("XvidStage.com", NULL, 0, 0); |
---|
183 | else if(ostrcmp(tmphname, "Nowvideo") == 0) |
---|
184 | hname = ostrcat("NowVideo.eu", NULL, 0, 0); |
---|
185 | else if(ostrcmp(tmphname, "Movshare") == 0) |
---|
186 | hname = ostrcat("MovShare.net", NULL, 0, 0); |
---|
187 | else if(ostrcmp(tmphname, "MovReel") == 0) |
---|
188 | hname = ostrcat("MovReel.com", NULL, 0, 0); |
---|
189 | else if(ostrcmp(tmphname, "NovaMov") == 0) |
---|
190 | hname = ostrcat("NovaMov", NULL, 0, 0); |
---|
191 | else if(ostrcmp(tmphname, "DivXStage") == 0) |
---|
192 | hname = ostrcat("DivXStage", NULL, 0, 0); |
---|
193 | else if(ostrcmp(tmphname, "PrimeShare") == 0) |
---|
194 | hname = ostrcat("PrimeShare.tv", NULL, 0, 0); |
---|
195 | else |
---|
196 | { |
---|
197 | hname = ostrcat(tmphname, " (coming soon)", 0, 0); |
---|
198 | type = 66; |
---|
199 | } |
---|
200 | */ |
---|
201 | |
---|
202 | tmplink = ostrcat(url, NULL, 0, 0); |
---|
203 | string_tolower(tmplink); |
---|
204 | |
---|
205 | if(ostrstr(tmplink, "sockshare") != NULL) |
---|
206 | streamurl = putlocker(url); |
---|
207 | else if(ostrstr(tmplink, "putlocker") != NULL) |
---|
208 | streamurl = putlocker(url); |
---|
209 | else if(ostrstr(tmplink, "filenuke") != NULL) |
---|
210 | streamurl = filenuke(url); |
---|
211 | else if(ostrstr(tmplink, "streamcloud") != NULL) |
---|
212 | streamurl = streamcloud(url); |
---|
213 | else if(ostrstr(tmplink, "vidstream") != NULL) |
---|
214 | streamurl = vidstream(url); |
---|
215 | else if(ostrstr(tmplink, "flashx") != NULL) |
---|
216 | streamurl = flashx(url); |
---|
217 | else if(ostrstr(tmplink, "xvidstage") != NULL) |
---|
218 | streamurl = xvidstage(url); |
---|
219 | else if(ostrstr(tmplink, "nowvideo") != NULL) |
---|
220 | streamurl = nowvideo(url); |
---|
221 | else if(ostrstr(tmplink, "movshare") != NULL) |
---|
222 | streamurl = movshare(url); |
---|
223 | else if(ostrstr(tmplink, "movreel") != NULL) |
---|
224 | streamurl = movreel(url); |
---|
225 | else if(ostrstr(tmplink, "novamov") != NULL) |
---|
226 | streamurl = novamov(url); |
---|
227 | else if(ostrstr(tmplink, "divxstage") != NULL) |
---|
228 | streamurl = divxstage(url); |
---|
229 | else if(ostrstr(tmplink, "primeshare") != NULL) |
---|
230 | streamurl = primeshare(url); |
---|
231 | else if(ostrstr(tmplink, "faststream") != NULL) |
---|
232 | streamurl = faststream(url); |
---|
233 | else if(ostrstr(tmplink, "played") != NULL) |
---|
234 | streamurl = played(url); |
---|
235 | else if(ostrstr(tmplink, "videoweed") != NULL) |
---|
236 | streamurl = videoweed(url); |
---|
237 | else |
---|
238 | textbox(_("Message"), _("The hoster is not yet supported !"), _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 600, 200, 5, 0); |
---|
239 | |
---|
240 | |
---|
241 | debug(99, "streamurl1: %s", streamurl); |
---|
242 | |
---|
243 | streamurl = string_replace_all("amp;", "", streamurl, 1); |
---|
244 | debug(99, "streamurl2: %s", streamurl); |
---|
245 | |
---|
246 | free(tmplink), tmplink = NULL; |
---|
247 | return streamurl; |
---|
248 | } |
---|
249 | |
---|
250 | #endif |
---|