def tell_waiting_download_rpc(): jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', 'method':'aria2.tellWaiting', 'params':['token:'+TOKEN, 0, 100, ['gid', 'status', 'dir', 'totalLength', 'completedLength', 'downloadSpeed', 'files', 'errorCode', 'errorMessage', 'connections', 'pieceLength', 'numPieces', 'connections']]}) c = opener.open(JSONRPC_LINK, jsonreq) data = json.load(c)['result'] return data
def unpause_all_download_rpc(): jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', 'method':'aria2.unpauseAll', 'params':['token:'+TOKEN]}) c = opener.open(JSONRPC_LINK, jsonreq) data = json.load(c)['result'] return data
def change_url_download_rpc(download_id, link): jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', 'method':'aria2.changeUri', 'params':['token:'+TOKEN, download_id, 1, [], [link]]}) c = opener.open(JSONRPC_LINK, jsonreq) data = json.load(c)['result'] return data
def add_download_rpc(link): jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', 'method':'aria2.addUri', 'params':['token:'+TOKEN, [link]]}) c = opener.open(JSONRPC_LINK, jsonreq) data = json.load(c)['result'] return data
def remove_download_rpc(download_id): jsonreq = json.dumps({'jsonrpc':'2.0', 'id':'qwer', 'method':'aria2.remove', 'params':['token:'+TOKEN, download_id]}) c = opener.open(JSONRPC_LINK, jsonreq) data = json.load(c)['result'] return data