New method to download from 4shared just check the attached script ! tnx.
Full demo script (the comments are in Romanian but i think that doesn't bother you as a programmer ! :p
attached bellow:
PHP Code:
<?php
//Set up constants used .
define('CALL_BACK','jQuery'); define('LOGIN','USER'); define('PASSWORD','DEMO');
// The link we download from !
$file='http://www.4shared.com/mp3/-QwopVGN/Connect-R_-_People__Radio_Edit.htm';
################# This line does everything (login 4shared) !! ##############
$url='http://www.4shared.com/login?callback='.urlencode(CALL_BACK).'&login='.urlencode(LOGIN).'&password='.urlencode(PASSWORD).'&doNotRedirect=false&fpRedirParam='.urlencode($file).'';
// Get cookie from header (they are already selected from array !)
$arr=get_headers($url, 1);
// This one process cookie
function cookme($content){preg_match_all( '#=(?P<idses>.+?);#si', $content, $get ) ; return $get['idses'][0];}
//Check if curl extension is installed if not use file_get_contents.
if ( in_array( "curl", get_loaded_extensions() ) ) {
$crl = curl_init() ;
curl_setopt ($crl, CURLOPT_URL,$file);
curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
//------------------------------------------------------------------------------------
//-------------------------------------------------------------------------
//-----------------------------------------------
Full demo script (the comments are in Romanian but i think that doesn't bother you as a programmer ! :p
attached bellow:
Comment