Thread: error with ext
View Single Post
  #13  
Old 4th April 2009, 17:46
hack346 hack346 is offline
Banned
 
Join Date: Mar 2008
Turkey
Posts: 80
Smile
open your function.php

find:

Code:
function torrent_scrape_url($scrape, $hash) {
    $ch = curl_init();
    $timeout = 5;
    curl_setopt ($ch, CURLOPT_URL, $scrape.'?info_hash='.escape_url($hash));
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
    $fp = curl_exec($ch);
    curl_close($ch);

    $ret = array();
    if(!$fp) {
        $ret['seeds'] = -1;
        $ret['peers'] = -1;
    }else{
        $stats = BDecode($fp);
        $binhash = addslashes(pack("H*", $hash));
        $seeds = $stats['files'][$binhash]['complete'];
        $peers = $stats['files'][$binhash]['incomplete'];
        $downloaded = $stats['files'][$binhash]['downloaded'];
        $ret['seeds'] = $seeds;
        $ret['peers'] = $peers;
        $ret['downloaded'] = $downloaded;
    }
    return $ret;
}
change with:

Code:
function torrent_scrape_url($scrape, $hash) {
    ini_set('default_socket_timeout',10); 
    @$fp = file_get_contents($scrape.'?info_hash='.escape_url($hash));
    $ret = array();
    if(!$fp) {
        $ret['seeds'] = -1;
        $ret['peers'] = -1;
    }else{
        $stats = BDecode($fp);
        $binhash = addslashes(pack("H*", $hash));
        $seeds = $stats['files'][$binhash]['complete'];
        $peers = $stats['files'][$binhash]['incomplete'];
        $downloaded = $stats['files'][$binhash]['downloaded'];
        $ret['seeds'] = $seeds;
        $ret['peers'] = $peers;
        $ret['downloaded'] = $downloaded;
    }
    return $ret;
}
in conclusion, restore your old code

that error is not a tracker source bug

that error means : This torrent does not exist in this tracker. (this error is available for external torrents)
Reply With Quote