示例#1
0
文件: views.py 项目: alucryd/denpa
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'])
示例#2
0
文件: views.py 项目: alucryd/denpa
def remove_torrent(id: int):
    method = 'torrent-remove'
    arguments = {'ids': id}
    return jsonify(t.send(method, arguments))
示例#3
0
文件: views.py 项目: alucryd/denpa
def remove_torrents():
    method = 'torrent-remove'
    arguments = {}
    return jsonify(t.send(method, arguments))
示例#4
0
文件: views.py 项目: alucryd/denpa
def add_torrent():
    method = 'torrent-add'
    arguments = {'filename': request.json['filename']}
    return jsonify(t.send(method, arguments))
示例#5
0
文件: views.py 项目: alucryd/denpa
def stop_torrent(id: int):
    method = 'torrent-stop'
    arguments = {'ids': id}
    return jsonify(t.send(method, arguments))
示例#6
0
文件: views.py 项目: alucryd/denpa
def stop_torrents():
    method = 'torrent-stop'
    arguments = {}
    return jsonify(t.send(method, arguments))