Question

I am writing a download manager for iPhone using objective C. I am using ASIHTTP framework and its working great. But my problem is I am not able to download from file sharing sites like filesonic, rapidshare, hotfile etc.

I want to know how can I get download (actual download) url from these sites, or at least how these sites are hiding this info (and where), so I can get that somehow...

Is there any open source library or framework to help me with this? How firefox or other desktop browser get this link?

Any help will be much appreciated!

Update 1 : I don't want to bypass their advertising and revenue streams. Almost all file sharing companies also provide free downloads with low bandwidth, I only want to use that service. there are many download managers available now for iPhone like - "Downloads Lite". I just want to build a similar functionality.

Was it helpful?

Solution

Let's start from the end of your question:

How firefox or other desktop browser get this link?

AFAIK, download managers intercepts downloads that are to start in a browser and manage them themselves. So, the link, and all the rest of requirements (cookies and so on) so that the download takes actually place, come from the browser.

I think you could follow the same approach:

  1. use a UIWebView to browse to the content you would like to download;

  2. intercept any change of page or download by defining – webView:shouldStartLoadWithRequest:navigationType: in your web view delegate;

  3. in case it is a download of some supported content, return NO from webView:shouldStartLoadWithRequest:navigationType (so that the UIWebView does not do anything), and pass the address to your custom download manager to do the actual downloading.

In my experience, this will also maintain cookies (i.e., UIWebView and ASIHTTP will share them), but YMAMV.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top