def torrents(): method = 'torrent-get' arguments = { 'fields': [ 'id', 'name', 'eta', 'percentDone', 'totalSize', 'rateDownload', 'rateUpload', 'downloadedEver', 'uploadedEver', 'uploadRatio', 'status' ] } return jsonify(t.send(method, arguments)['torrents'])
def remove_torrent(id: int): method = 'torrent-remove' arguments = {'ids': id} return jsonify(t.send(method, arguments))
def remove_torrents(): method = 'torrent-remove' arguments = {} return jsonify(t.send(method, arguments))
def add_torrent(): method = 'torrent-add' arguments = {'filename': request.json['filename']} return jsonify(t.send(method, arguments))
def stop_torrent(id: int): method = 'torrent-stop' arguments = {'ids': id} return jsonify(t.send(method, arguments))
def stop_torrents(): method = 'torrent-stop' arguments = {} return jsonify(t.send(method, arguments))