Possible Duplicate:
Headless, scriptable Firefox/Webkit on linux?
I've been researching all the afternoon a way to download files from the sharing sites, like
- mediafire,
- 4shared,
- etc.
I couldn't figure a way, even for these that don't have a captcha confirm.
Keyword: captcha
Is there any link where i could find more info, os if someone can help me.
Right now I fail with: mediafire
Right now i'm experiencing an error when i try to fetch the download link from mediafire page, cause before the link shows up, there's a text like: 'Authorize Download', and few moments after the page loads, the link is refreshed, and when i try to get the link using DOMDocument, i'm not able to.
Sorry if i'm talking too much, i just want to give a full brief of my problem, to avoid useless discussion. Here's the curl code i'm using at this moment:
function download($url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt');
curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_TIMEOUT, 20000);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');
return curl_exec($ch);
}
EDIT 1: If you're wondering why i've marked this post with the Zend tag, is that 'cause i'm using zend framework, actually i'm researching Zend_Http_Client
right now... see if it can handle my problem.