Pogledajte određenu poruku
Staro 10. 11. 2011.   #1
webarto
expert
Grand Master
 
Avatar webarto
 
Datum učlanjenja: 11.04.2010
Poruke: 998
Hvala: 141
893 "Hvala" u 153 poruka
webarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished roadwebarto is on a distinguished road
Default wrzuta.pl Downloader (PHP)

Free MP3 for all

PHP kd:

/**
 * @author Webarto.com
 * @copyright 2011
 * @url http://webarto.com/
 * @version 0.1
 */

class Wrzuta {
    
    public function 
get($url){
        
        
$vars explode('/'$url);

        
$host $vars[2];
        
$key $vars[4];

        
$site 'wrzuta.pl';
        
$lang 'pl';
        
$random mt_rand(01000000);

        
$xml "http://{$host}/xml/plik/{$key}/{$site}/undefined/{$random}";

        
$data $this->curl($xml);

        
$xml = (array) simplexml_load_string($data'SimpleXMLElement'LIBXML_NOCDATA);

        
$url $xml['file']->storeIds->fileId;
        
$filename $xml['file']->name;
        
        
$data $this->curl($url);
        return 
file_put_contents($filename$data);
        
    }
    
    private function 
curl($url)
    {
        
$curl curl_init();
        
curl_setopt($curlCURLOPT_URL$url);
        
curl_setopt($curlCURLOPT_RETURNTRANSFER1);
        
$data curl_exec($curl);
        
curl_close($curl);
        return 
$data
    }
    

Usage:

PHP kd:
$wrzuta = new Wrzuta;
$wrzuta->get('http://qwasssos.wrzuta.pl/audio/0ke13NpBRA7/04._clubbed_to_death_kurayamino_mix'); 
__________________
Github // LinkedIn // PHP // ZCE // Stackoverflow PHP // Site5 Web Hosting
webarto je offline   Odgovorite uz citat