Changeset 24273
- Timestamp:
- 10/13/13 17:20:53 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/tithek/flashx.h
r24255 r24273 8 8 debug(99, "hosterurl: %s", hosterurl); 9 9 int debuglevel = getconfigint("debuglevel", NULL); 10 char* tmphost = NULL, *tmppath = NULL, *tmpstr = NULL, *send = NULL, *streamlink = NULL, *ip = NULL, *pos = NULL, *path = NULL , *error = NULL;11 10 char* tmphost = NULL, *tmppath = NULL, *tmpstr = NULL, *send = NULL, *streamlink = NULL, *ip = NULL, *pos = NULL, *path = NULL; 11 char* playurl = NULL, *tmpstr2 = NULL, *hash1tmp = NULL, *hash2tmp = NULL, *hash = NULL, *hash1 = NULL, *hash2 = NULL, *error = NULL, *cookie1 = NULL, *cookie2 = NULL, *cookie3 = NULL, *tmphost1 = NULL; 12 12 if(host == NULL || file == NULL) return NULL; 13 13 … … 25 25 tmppath = ostrcat("/", path, 0, 0); 26 26 27 //printf("\n#######################################################\n");28 //printf("GET /video/UX98AKXU2ARB/RiddickUeberlebenistseineRacheTSLDGermanX264-AOE\n");29 //printf("tmphost: %s\n",tmphost);30 //printf("tmppath: %s\n",tmppath);31 //printf("\n#######################################################\n");32 27 send = ostrcat(send, "GET ", 1, 0); 33 28 send = ostrcat(send, tmppath, 1, 0); … … 36 31 send = ostrcat(send, "\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 32 debug(99, "send: %s", send); 38 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 33 34 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 35 debug(99, "tmpstr: %s", tmpstr); 39 36 titheklog(debuglevel, "/tmp/flashx_tmpstr_get1", NULL, tmpstr); 40 writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get1", tmpstr, 0);41 //printf("\n#######################################################\n");42 37 43 if( ostrstr(tmpstr, "<center>Video not found, deleted or abused, sorry!<br") != NULL)44 { 45 error = string_resub("<li> <center>", "<br", tmpstr, 0); 46 string_deltags(error); 47 error = strstrip(error); 48 if(error == NULL || strlen(error) == 0) 49 error = ostrcat(_("The page is temporarily unavailable"), NULL, 0, 0); 50 textbox(_("Message"), error, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0); 51 goto end; 52 } 53 54 c har* cookie1 = string_resub("Set-Cookie: pageredir=", ";", tmpstr, 0);55 debug(99, "cookie1 : %s", cookie1);56 57 c har* cookie2 = string_resub("Set-Cookie: PHPSESSID=", ";", tmpstr, 0);58 debug(99, "cookie2 : %s", cookie2);59 60 c har* cookie3 = string_resub("Set-Cookie: video_", "=", tmpstr, 0);61 debug(99, "cookie3 : %s", cookie3);38 if(tmpstr == NULL || ostrstr(tmpstr, "<center>Video not found, deleted or abused, sorry!<br") != NULL) 39 { 40 error = string_resub("<li> <center>", "<br", tmpstr, 0); 41 string_deltags(error); 42 error = strstrip(error); 43 if(error == NULL || strlen(error) == 0) 44 error = ostrcat(_("The page is temporarily unavailable"), NULL, 0, 0); 45 textbox(_("Message"), error, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0); 46 goto end; 47 } 48 49 cookie1 = string_resub("Set-Cookie: pageredir=", ";", tmpstr, 0); 50 debug(99, "cookie1 (pageredir): %s", cookie1); 51 52 cookie2 = string_resub("Set-Cookie: PHPSESSID=", ";", tmpstr, 0); 53 debug(99, "cookie2 (PHPSESSID): %s", cookie2); 54 55 cookie3 = string_resub("Set-Cookie: video_", "=", tmpstr, 0); 56 debug(99, "cookie3 (vid): %s", cookie3); 62 57 63 58 free(tmppath), tmppath = NULL; 64 59 tmppath = ostrcat("/player/embed.php?vid=", cookie3, 0, 0); 65 60 free(tmphost), tmphost = NULL; 66 char*tmphost1 = oregex(".*<iframe width=.*src=\"(http://.*)&width.*", tmpstr);61 tmphost1 = oregex(".*<iframe width=.*src=\"(http://.*)&width.*", tmpstr); 67 62 tmphost = string_resub("http://", "/", tmphost1, 0); 68 63 free(tmphost1), tmphost1 = NULL; 69 64 free(tmpstr); tmpstr = NULL; 70 65 free(send); send = NULL; 71 // sleep(1); 72 //printf("\n#######################################################\n"); 73 //printf("GET /player/embed.php?vid=1008580\n"); 74 //printf("tmphost: %s\n",tmphost); 75 //printf("tmppath: %s\n",tmppath); 76 //printf("\n#######################################################\n"); 66 77 67 send = ostrcat(send, "GET ", 1, 0); 78 68 send = ostrcat(send, tmppath, 1, 0); … … 87 77 send = ostrcat(send, "\r\nConnection: close\r\nAccept-Encoding: gzip\r\n\r\n", 1, 0); 88 78 debug(99, "send: %s", send); 89 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 90 79 80 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 91 81 titheklog(debuglevel, "/tmp/flashx_tmpstr_get2", NULL, tmpstr); 92 writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get2", tmpstr, 0); 93 //printf("\n#######################################################\n"); 94 95 char* hash1tmp = string_resub("<input type=\"hidden\" name=\"sec\" value=\"", "\"", tmpstr, 0); 96 char* hash2tmp = string_resub("<input type=\"hidden\" name=\"id\" value=\"", "\"", tmpstr, 0); 82 debug(99, "tmpstr: %s", tmpstr); 83 84 if(tmpstr == NULL || ostrstr(tmpstr, "<center>Video not found, deleted or abused, sorry!<br") != NULL) 85 { 86 error = string_resub("<li> <center>", "<br", tmpstr, 0); 87 string_deltags(error); 88 error = strstrip(error); 89 if(error == NULL || strlen(error) == 0) 90 error = ostrcat(_("The page is temporarily unavailable"), NULL, 0, 0); 91 textbox(_("Message"), error, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0); 92 goto end; 93 } 94 95 hash1tmp = string_resub("<input type=\"hidden\" name=\"sec\" value=\"", "\"", tmpstr, 0); 96 hash2tmp = string_resub("<input type=\"hidden\" name=\"id\" value=\"", "\"", tmpstr, 0); 97 97 98 98 if(hash1tmp == NULL || hash2tmp == NULL) goto end; 99 char*hash1 = htmlencode(hash1tmp);100 char*hash2 = htmlencode(hash2tmp);99 hash1 = htmlencode(hash1tmp); 100 hash2 = htmlencode(hash2tmp); 101 101 free(hash1tmp); hash1tmp = NULL; 102 102 free(hash2tmp); hash2tmp = NULL; … … 106 106 // hash2 = string_replace_all("/", "%2F", hash2, 1); 107 107 108 char*hash = ostrcat("sec=", hash1, 0, 0);108 hash = ostrcat("sec=", hash1, 0, 0); 109 109 hash = ostrcat(hash, "&id=", 0, 0); 110 110 hash = ostrcat(hash, hash2, 0, 0); … … 114 114 hashlen = oitoa(strlen(hash)); 115 115 debug(99, "hashlen: %s", hashlen); 116 117 free(tmpstr); tmpstr = NULL; 118 free(send); send = NULL; 119 // sleep(1); 120 121 //printf("\n#######################################################\n"); 122 //printf("POST /player/show.php\n"); 123 //printf("\n#######################################################\n"); 116 free(tmpstr); tmpstr = NULL; 117 free(send); send = NULL; 124 118 125 119 send = ostrcat(send, "POST /player/show.php HTTP/1.1\r\nContent-Length: ", 1, 0); … … 138 132 debug(99, "send: %s", send); 139 133 tmpstr = gethttpreal(tmphost, "/player/show.php", 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 140 134 debug(99, "tmpstr: %s", tmpstr); 141 135 titheklog(debuglevel, "/tmp/flashx_tmpstr_get3", NULL, tmpstr); 142 writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get3", tmpstr, 0); 143 //printf("\n#######################################################\n"); 144 //var code ='<object id="nuevoplayer" width="'+ww+'" height="'+hh+'" data="http://play.flashx.tv/nuevo/player/player.swf?config=http://play.flashx.tv/nuevo/player/play.php?str=4MfrzrW4qrPKnM2dw5/Fvcs=" type="application/x-shockwave-flash">'; 145 char* playurl = string_resub("?config=", "\"", tmpstr, 0); 136 137 if(tmpstr == NULL || ostrstr(tmpstr, "<center>Video not found, deleted or abused, sorry!<br") != NULL) 138 { 139 error = string_resub("<li> <center>", "<br", tmpstr, 0); 140 string_deltags(error); 141 error = strstrip(error); 142 if(error == NULL || strlen(error) == 0) 143 error = ostrcat(_("The page is temporarily unavailable"), NULL, 0, 0); 144 textbox(_("Message"), error, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0); 145 goto end; 146 } 147 148 playurl = string_resub("?config=", "\"", tmpstr, 0); 146 149 free(tmppath), tmppath = NULL; 147 150 tmppath = ostrcat("/nuevo/player/player.swf?config=", playurl, 0, 0); 151 // needed in post 148 152 // free(playurl), playurl = NULL; 149 153 150 154 free(tmpstr); tmpstr = NULL; 151 155 free(send); send = NULL; 152 // sleep(1);153 154 //printf("\n#######################################################\n");155 //printf("GET /nuevo/player/player.swf?config=http://play.flashx.tv/nuevo/player/play.php?str=4MfrzrW70J.wp8O.zZi5uLo=\n");156 //printf("tmphost: %s\n",tmphost);157 //printf("tmppath: %s\n",tmppath);158 //printf("\n#######################################################\n");159 156 160 157 send = ostrcat(send, "GET ", 1, 0); … … 169 166 send = ostrcat(send, "\r\nConnection: close\r\nAccept-Encoding: gzip\r\n\r\n", 1, 0); 170 167 171 172 debug(99, "send: %s", send); 173 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 174 168 debug(99, "send: %s", send); 169 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 170 debug(99, "tmpstr: %s", tmpstr); 175 171 titheklog(debuglevel, "/tmp/flashx_tmpstr_get4", NULL, tmpstr); 176 writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get4", tmpstr, 0); 177 //printf("\n#######################################################\n"); 178 179 180 181 //printf("tmppath: %s\n",tmppath); 182 //printf("playurl: %s\n",playurl); 172 173 if(tmpstr == NULL || ostrstr(tmpstr, "<center>Video not found, deleted or abused, sorry!<br") != NULL) 174 { 175 error = string_resub("<li> <center>", "<br", tmpstr, 0); 176 string_deltags(error); 177 error = strstrip(error); 178 if(error == NULL || strlen(error) == 0) 179 error = ostrcat(_("The page is temporarily unavailable"), NULL, 0, 0); 180 textbox(_("Message"), error, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0); 181 goto end; 182 } 183 183 184 free(tmppath), tmppath = NULL; 184 // tmppath = ostrcat("/nuevo/player/play.php?str=4MfrzrW4qrPKnM2dw5/Fvcs=", NULL, 0, 0); 185 // tmppath = string_resub("/play.php?", "\0", tmpstr, 0); 186 char* tmpstr2 = ostrcat("http://", tmphost, 0, 0); 185 tmpstr2 = ostrcat("http://", tmphost, 0, 0); 187 186 tmppath = string_replace(tmpstr2, "", playurl, 0); 188 189 187 free(tmpstr2); tmpstr2 = NULL; 190 188 free(playurl), playurl = NULL; 191 189 free(tmpstr); tmpstr = NULL; 192 190 free(send); send = NULL; 193 // sleep(1);194 195 //printf("\n#######################################################\n");196 //printf("GET /nuevo/player/play.php?str=4MfrzrW70J.wp8O.zZi5uLo=\n");197 //printf("tmphost: %s\n",tmphost);198 //printf("tmppath: %s\n",tmppath);199 200 //printf("\n#######################################################\n");201 191 202 192 send = ostrcat(send, "GET ", 1, 0); … … 210 200 send = ostrcat(send, cookie2, 1, 0); 211 201 send = ostrcat(send, "\r\nConnection: close\r\nAccept-Encoding: gzip\r\n\r\n", 1, 0); 212 213 214 debug(99, "send: %s", send); 215 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 216 217 if(getconfigint("debuglevel", NULL) == 99) 218 writesys("/tmp/flashx_tmpstr_get5", tmpstr, 0); 219 writesys("/var/usr/local/share/titan/plugins/tithek//flashx_tmpstr_get5", tmpstr, 0); 220 //printf("\n#######################################################\n"); 202 debug(99, "send: %s", send); 203 204 tmpstr = gethttpreal(tmphost, tmppath, 80, NULL, NULL, NULL, 0, send, NULL, 5000, 1); 205 debug(99, "tmpstr: %s", tmpstr); 206 titheklog(debuglevel, "/tmp/flashx_tmpstr_get5", NULL, tmpstr); 207 208 if(tmpstr == NULL || ostrstr(tmpstr, "<center>Video not found, deleted or abused, sorry!<br") != NULL) 209 { 210 error = string_resub("<li> <center>", "<br", tmpstr, 0); 211 string_deltags(error); 212 error = strstrip(error); 213 if(error == NULL || strlen(error) == 0) 214 error = ostrcat(_("The page is temporarily unavailable"), NULL, 0, 0); 215 textbox(_("Message"), error, _("OK"), getrcconfigint("rcok", NULL), _("EXIT"), getrcconfigint("rcexit", NULL), NULL, 0, NULL, 0, 1200, 400, 0, 0); 216 goto end; 217 } 221 218 222 219 streamlink = string_resub("<file>", "</file>", tmpstr, 0); 223 if(getconfigint("debuglevel", NULL) == 99) 224 writesys("/tmp/flashx5_streamlink", streamlink, 0); 220 titheklog(debuglevel, "flashx_streamlink", NULL, tmpstr); 225 221 226 222 end:
Note: See TracChangeset
for help on using the changeset viewer.