使用https://github.com/kaysond/deluge-php 提供的类,简单使用:
1 2 3 4 5 6 7 8 9 10 11 12 13 | $host = "192.168.168.5:8112" ; $password = "deluge" ; $d = new deluge( $host , $password ); //返回只包含当前状态Downloading中的 $filter = array ( 'state' => "Downloading" ); //返回指定的这此参数的值 $params = array ( 'name' , 'hash' , 'max_upload_speed' , 'eta' ); $list = $d ->getTorrentsStatus( $filter , $params , '' ); var_dump( $list ); $options = array ( 'max_upload_speed' => 100, 'max_download_speed' => 100); $res = $d ->addTorrentUrl( $url , $options , '' ); var_dump( $res ); |
参考:
https://media.readthedocs.org/pdf/deluge/develop/deluge.pdf