hyperlink - Getting mediafire directlink without using WebBrowser .NET control? -
I am looking for a way to get direct link from MediaFire. By default, when a user goes to the download link, they will be presented on the download page, where they will have to wait for download and then a link will appear.
I googled and found a VB .NET 2008 solution used by WebBooser WB
It works very well, but I have pop-up windows And I'm tired at load speed. So, I wonder what is the solution to this problem? (A non-WB solution ^^)
Any help is greatly appreciated.
- (handling cookies)
When I do regular expressions in the code, I have to post back, it is not sure that it is going to work though I think the real link is received through AJAX I still Playing with this
Ajax concerns were discussed:
Based on the php code given in the comments:
- 1 response-> "CG (Value varied from a function called "var1, var2, var3"). I do not think that the mediafire still uses that function, it seems that it is called "Q (var1, var2, var3)", is no longer sure if any of your given PHP still works, We can do the same thing with the Q function to get the value & amp; After our request? By cookies we have recovered from our first reaction.
- In this second reaction, this large list of randomly generated variables is created, then generates the download URL by adding some of those variables, the only way to get the URL out is to do it . I am posting code asap
(warning this code is ugly and needs to be cleaned):
string sURL = "http ?: //www.mediafire.com/ syzjuytmdkn "; HttpWebRequest wrGETURL = (HttpWebRequest) WebRequest.Create (sURL); WrGETURL.CookieContainer = New Cookie Container (); WrGETURL.Referer = "http://www.mediafire.com"; WrGETURL.UserAgent = "Mozilla / 4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"; HttpWebResponse wrResponse = (HttpWebResponse) wrGETURL.GetResponse (); Cookie Collection Cookies = wrResponse.Cookies;
Send us the request first & amp; Store the received cookies Next We would like to parse the page to find the key for the second request:
Strimmer Observer = New Stream Reader (wrResponse.GetResponsestream ()); String [] parameters = {}; // String received parameters in HTML = objReader.ReadToEnd (); Int cupos1 = html.IndexOf ("cu ("); int cupos2 = html.indexOf ("')", capole 1); String [] separator = {"','"}; Parameters = html.Substring (cupos1 + 4, cup2 - cup 1 - 4) .spot (separator, string split option no.);
Get the second page with the encoded download URL:
string sURL2 = string.format ("http://www.mediafire.com/dynamic/ Download.php? Qk = {0} & amp; pk = {1} & amp; r = {2} ", criteria [0], criteria [1], parameter [2]); HttpWebRequest wrGETURL2 = (HttpWebRequest) WebRequest.Create (sURL2); WrGETURL2.usergeent = "Mozilla / 4.0 (compatible; MSI 6.0; Windows NT 5.1; SV1; NAT CLR 1.1.4322; NAT CLR 2.0.50727)"; WrGETURL2 Reviser = "http://www.mediafire.com"; WrGETURL2 Cook Container = New Cookie Container (); WrGETURL2.CookieContainer.Add (cookies); WrResponse = (HttpWebResponse) wrGETURL2.GetResponse (); ObjReader = new streamrider (wrResponse.GetResponsestream ()); Html = objReader.ReadToEnd ();
This HTML contains JavaScript which will generate the download URL, here we will remove it, then evaluate it & amp; Finally, write it in the console:
int varpos1 = html.IndexOf ("& lt; script language = \" javascript \ "& gt;" +) + 35; // variable is declared before 'function' int varpos2 = html.indexOf ("function", varpos1); String verdata = html.Substring (varpos1, varpos2 - varpos1); Int hrefpos1 = html.IndexOf ("href = \\\" http: // ", varpos2) +6; int hrefpos2 = html.indexOf (" & gt; ", hrefpos1); string hrefdata = String.Format (" var Url = {0}; ", html.Substring (hrefpos1, hrefpos2 - hrefpos1-5)); Object result = EvalJScript (verdata +" \ n "+ hrefdata); console.provided (result.Thethering);
This content works for me, but needs to be rewritten, I also leave the EvalJScript function for you to work because the one I am using Is left
Comments
Post a Comment