function uSiteGet($torrent) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $torrent); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5'); curl_setopt($ch, CURLOPT_NOBODY, 0); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 0); curl_setopt($ch, CURLOPT_TIMEOUT, 60); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); return curl_exec($ch); } $fn = uSiteGet($_GET['torrent']); require_once "benc.php"; $dict = bdec_file($fn, (1024*1024)); header("Content-Disposition: attachment; filename=\"local_".$url."; charset=windows-1251\""); header ("Content-Type: application/x-bittorrent"); echo $dict; |