Ejemplo n.º 1
0
function get_peer_list($hash)
{
    if (rtorrent_xmlrpc_cached('system.client_version') == '0.7.9') {
        return array();
    }
    return rtorrent_multicall('p', array($hash, ''), array('get_address', 'get_client_version', 'get_completed_percent', 'get_down_rate', 'get_down_total', 'get_id', 'get_id_html', 'get_options_str', 'get_peer_rate', 'get_peer_total', 'get_port', 'get_up_rate', 'get_up_total', 'is_encrypted', 'is_incoming', 'is_obfuscated', 'is_snubbed'));
}
Ejemplo n.º 2
0
        </select>
        <input type="submit" value="Go" class="themed" />
        <input type="checkbox" id="leave-checked" name="leave_checked" />
        <label for="leave-checked" class="gray-text">Leave torrents checked</label>
      </div><!-- class="bottomtab" -->

    </form><!-- id="control-form" -->

    <div id="footer">
      <div align="center" class="smalltext">
        <a href="http://libtorrent.rakshasa.no/" target="_blank">
          rTorrent client <?php 
echo rtorrent_xmlrpc_cached('system.client_version');
?>
           / lib <?php 
echo rtorrent_xmlrpc_cached('system.library_version');
?>
        </a> |
        <a href="rssfeed.php">RSS Feed</a> |
        Page created in <?php 
echo round(microtime(true) - $execstart, 3);
?>
 secs.<br />
        Based on <a href="http://rtgui.googlecode.com" target="_blank">rtGui v0.2.7</a> by Simon Hall &copy; 2007-2008<br />
        Modifications by James Nylen, Gurvan Guezennec &copy; 2010-2011
      </div>
    </div><!-- id="footer" -->

  </div><!-- id="wrap" -->
</body>
</html>
Ejemplo n.º 3
0
 if ($i >= $max_urls) {
     $to_add[] = array('error' => "Can only add {$max_urls} URLs at a time");
     break;
 }
 $url = $maybe_urls[$i];
 if (preg_match('@^magnet:\\?@i', $url)) {
     // Magnet URL logic adapted from http://wiki.rtorrent.org/MagnetUri
     // and rutorrent source code
     $version = rtorrent_xmlrpc_cached('system.client_version');
     // According to the above page, 0.8.9+ is OK except for 0.9.0
     // TODO: What's the bug in 0.9.0?
     if ($version != '0.8.9' && $version < '0.9.1') {
         $to_add[] = array('error' => 'Magnet URLs are only supported in rTorrent 0.8.9 or 0.9.1+.');
         continue;
     }
     $dht_stats = rtorrent_xmlrpc_cached('dht_statistics');
     if ($dht_stats['dht'] != 'auto' && $dht_stats['dht'] != 'on') {
         $to_add[] = array('error' => 'Magnet URLs require DHT to be enabled.  See ' . 'LINK{http://libtorrent.rakshasa.no/wiki/RTorrentUsingDHT} for more info.');
         continue;
     }
     // Parse query string
     parse_str(substr($url, strlen('magnet:?')), $params);
     if (!preg_match('@^urn:btih:[a-z0-9]{40}$@i', $params['xt'])) {
         $to_add[] = array('error' => 'Invalid magnet link (info hash not found).');
         continue;
     }
     $hash = strtoupper(substr($params['xt'], strlen('urn:btih:')));
     if ($params['dn']) {
         $name = preg_replace('@[^a-z0-9_\' -]@i', '_', $params['dn']);
         $name = preg_replace('@\\.torrent$@i', '', $name);
     } else {