Tu peut interagir avec rtorrent par RPC, c'est ce que je fait en php (que j'execute ensuite en tant qu'exec), tu peut le faire en command line aussi avec un client rpc :
http://xmlrpc-c.sourceforge.net/doc/xmlrpc.html
La partie qui t'interessera dans mon script c'est celle ou je genere la liste des torrents.
$tableau_torrent = array();
$response = do_call(xmlrpc_encode_request('download_list', ''),$login,$password,$url);
$p = xml_parser_create();
xml_parse_into_struct($p, $response, $vals, $index);
xml_parser_free($p);
$index = $index["STRING"];
if(count($index)==0) return "erreur";
foreach($index as $keyhash){
$hash = $vals[intval($keyhash)]["value"];
$response = do_call(xmlrpc_encode_request('d.get_custom1', $hash),$login,$password,$url);
@preg_match('#<value><string>(.*)</string></value>#', $response, $matches);
$tableau_torrent[$hash]["label"] = html_entity_decode(@$matches[1]);
$response = do_call(xmlrpc_encode_request('d.get_base_filename', $hash),$login,$password,$url);
@preg_match('#<value><string>(.*)</string></value>#', $response, $matches);
$tableau_torrent[$hash]["repertoire"] = html_entity_decode(@$matches[1]);
$response = do_call(xmlrpc_encode_request('d.get_complete', $hash),$login,$password,$url);
@preg_match('#<value><i8>(.*)</i8></value>#', $response, $matches);
$tableau_torrent[$hash]["complete"] = intval(@$matches[1]);
}
function do_call($request,$login,$password,$url) {
$header[] = "Content-type: text/xml";
$header[] = "Content-length: ".strlen($request);
$header[] = 'Authorization: Basic '. base64_encode($login.":".$password);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
$data = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
} else {
curl_close($ch);
return $data;
}
}