1

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.

Community
  • 1
  • 1
  • 5
    I'd imagine all the hardships you're going through are put in-place by those sites specifically to prevent precisely what you're trying to do. – Mike B Jul 18 '12 at 19:56
  • It's for an academical project... It's my last work for college... – Jorge Luis Ferrari Jul 18 '12 at 20:02
  • 3
    @JorgeLuisFerrari Then you should choose a different "academical project" because professors tend to frown upon students violating terms of service in the name of academia. –  Jul 18 '12 at 20:07
  • This doesn't really have anything to do with Zend. You first need to figure out how to download the media - use your browser and some Javascript to break down the problem. Implementing in PHP later should be a lot more straight forward. – Nick Caballero Jul 19 '12 at 03:51

0 Answers0