示例#1
0
 public function getMessages()
 {
     $instance = VuzeRPC::getInstance();
     return array($instance->lastError);
 }
 /**
  * gets current status of all Running Transfers (realtime)
  * for transferStat popup
  *
  * @return array (stat) or Error String
  */
 function monitorRunningTransfers()
 {
     //by default, monitoring not available.
     $vuze = VuzeRPC::getInstance();
     $vuze->torrent_get_tf();
     $filter = array('running' => 1);
     $stat = $vuze->torrent_filter_tf($filter);
     return $stat;
 }
示例#3
0
            }
            if (!isset($cfg["total_download"])) {
                $cfg["total_download"] = 0;
            }
            $cfg["total_upload"] = $cfg["total_upload"] + GetSpeedValue($aTorrent["rateUpload"] / 1000);
            $cfg["total_download"] = $cfg["total_download"] + GetSpeedValue($aTorrent["rateDownload"] / 1000);
        }
    }
}
// end of Transmission RPC bloc
// ---------------------------------------------------------------------
if ($cfg["vuze_rpc_enable"]) {
    $bUseRPC = true;
    require_once "inc/classes/VuzeRPC.php";
    //one client for all vuzerpc transferts
    $rpc = VuzeRPC::getInstance($cfg);
    //we can ask vuze data directly (not from .stat files)
    $vuzeResults = $rpc->torrent_get_tf_array();
}
// end of Vuze RPC requests
// ---------------------------------------------------------------------
$nbRpc = 0;
foreach ($arList as $mtimecrc => $transfer) {
    // displayname
    $displayname = $transfer;
    // may need a special config panel to clean names...
    $displayname = str_replace('.', "_", $displayname);
    $displayname = preg_replace('#([^_]+_(com|org|net|info)_)#i', "", $displayname);
    $displayname = preg_replace('#(_torrent)$#i', "", $displayname);
    $arToClean = array("http_", "_www_", "isohunt");
    $displayname = str_ireplace($arToClean, "", $displayname);
function addVuzeMagnetTransfer($userid = 0, $url, $path, $paused = true)
{
    global $cfg;
    require_once 'inc/classes/VuzeRPC.php';
    $rpc = VuzeRPC::getInstance();
    $content = $path . "\n";
    //... max_ul
    //... todo
    $id = $rpc->torrent_add_url($url, $content);
    $hash = false;
    if ($id !== false) {
        $hash = $rpc->torrent_get_hashids(array($id));
    } else {
        AuditAction($cfg["constants"]["error"], "Download Magnet : " . $rpc->lastError);
    }
    return $hash;
}